Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts
Monday, May 7, 2012
Very good explanation for Intent calls
http://www.brighthub.com/mobile/google-android/articles/39467.aspx
Tuesday, April 24, 2012
Encoding ZXing with Intent
Android : http://stackoverflow.com/questions/2489048/qr-code-encoding-and-decoding-using-zxing
(for iOS) http://dev4mac.blogspot.co.uk/2011/10/qr-using-zxing-zebra-crossing.html
My code: package com.thetmonaye.ucl;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;
import android.view.View;
public class EncoderActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.encoder);
//Pointers to Text fields
final EditText receive_amount = (EditText) findViewById(R.id.receive_amount);
final EditText emailAddressField = (EditText) findViewById(R.id.emailAddress);
final EditText memoField = (EditText) findViewById(R.id.memo);
final EditText barcodeField = (EditText) findViewById(R.id.barcode);
Button qrButton = (Button) this.findViewById(R.id.create_QR_button);
qrButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// getting the values from the EditText Fields
String amount = receive_amount.getText().toString();
String email = emailAddressField.getText().toString();
String memo = memoField.getText().toString();
String barcode = barcodeField.getText().toString();
if (amount != null && email != null && memo != null && barcode != null)
{
// URI to be encoded as a QR code
String uri = "thetUcl:"+"amount="+amount+"&"+"email="+email+"&"+"memo="+memo+"&"+"barcode="+barcode;
generateQRCode(uri);
}
}
});
}
private void generateQRCode(String data) {
// call it simply by Intent and you don't need to add library or any codes
Intent intent = new Intent("com.google.zxing.client.android.ENCODE");
intent.putExtra("ENCODE_TYPE", "TEXT_TYPE");
intent.putExtra("ENCODE_DATA", data);
intent.putExtra("ENCODE_FORMAT", "QR_CODE");
startActivity(intent);
}
}
Saturday, April 21, 2012
Android Malloc or Gabage Collection Handling (for infinite loop)
http://groups.google.com/group/android-developers/browse_thread/thread/79a9b5352cef9146
Friday, April 20, 2012
ZXing Encoding Method
Calling Encoder with Intent: http://code.google.com/p/zxing/issues/detail?id=1032
When you want to use libraries: http://www.vineetmanohar.com/2010/09/java-barcode-api/
When you want to use libraries: http://www.vineetmanohar.com/2010/09/java-barcode-api/
Monday, April 16, 2012
static classes(when dealing with adapters)
you might normally come across when you call the adapter from another class, they ask the class to be static
eg: private TescoJsonParser TJP= new TescoJsonParser();
String sessionkey= TescoJsonParser.login("youremail@gmail.com","password");
ProductDetails parsedResult=TescoJsonParser.getProductByBarcode(contents,sessionkey );
products.add(parsedResult);
productLists.setAdapter(new ProductViewAdapter(this,products));
I cannot use TJP.login(....,...);
here is why:
http://www.javaworld.com/javaworld/javaqa/1999-08/01-qa-static2.html
eg: private TescoJsonParser TJP= new TescoJsonParser();
String sessionkey= TescoJsonParser.login("youremail@gmail.com","password");
ProductDetails parsedResult=TescoJsonParser.getProductByBarcode(contents,sessionkey );
products.add(parsedResult);
productLists.setAdapter(new ProductViewAdapter(this,products));
I cannot use TJP.login(....,...);
here is why:
http://www.javaworld.com/javaworld/javaqa/1999-08/01-qa-static2.html
Monday, April 9, 2012
some new findings (BigDecimal, onResume)
BigDecimal= to get the rounded double value eg. from 2.5555555 to 2.56
onResume => I was having problems with SQlite database for not updating my scanned values into total, but I realized I was calling the total in onCreate, but not in onResume
After I call it in onResume, everything is perfect ! :)
why SQL not visible in the database?
Cos' of security issue and so we need to reboot the android
http://stackoverflow.com/questions/3810710/why-cant-data-folder-be-displayed-just-like-in-ddms-file-explorer
how to? http://forum.unity3d.com/threads/112703-Override-Unity-Data-folder-path
REBOOTING : http://www.tomsguide.com/us/Root-Your-Android-Phone,review-1688-2.html
why SQL not visible in the database?
Cos' of security issue and so we need to reboot the android
http://stackoverflow.com/questions/3810710/why-cant-data-folder-be-displayed-just-like-in-ddms-file-explorer
how to? http://forum.unity3d.com/threads/112703-Override-Unity-Data-folder-path
REBOOTING : http://www.tomsguide.com/us/Root-Your-Android-Phone,review-1688-2.html
Subscribe to:
Posts (Atom)