I know it is possible to scan a movie and see if the movie is available at the store. How would I do this using zxing? I did look over the links pertaining this and I am having a difficulty time understanding it all. I did download the .apk file and convert it to .zip, but I do not see any classes in the folders. I am really confused and I wish there was a web site that explains how to use zxing to make this possible.
anyone have any web sites they know of that will get me started?
thanks.
The easiest way to use zxing is to call it by Intent.
ReplyDeleteIntent intent = new Intent("com.google.zxing.client.android.SCAN");
intent.setPackage("com.google.zxing.client.android");
startActivityForResult(intent, REQUEST_CODE_SCANNER);
This will launch the scanner activity, if Barcode Scanner is installed. After a barcode is recognized it will return to your activity and call
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
Log.i(TAG, "ACTIVITY RESULT");
if (requestCode == REQUEST_CODE_SCANNER) {
if (resultCode == RESULT_OK) {
// get the scanner/input results
String result = intent.getStringExtra(SCAN_RESULT);
String format = intent.getStringExtra(SCAN_RESULT_FORMAT);
} else if (resultCode == RESULT_CANCELED) {
// nothing to do
}
}
}
With these values you can then query any database to get information about the scanned product.
You might furthermore check, if the Barcode Scanner is installed. I'm doing this is my own app. If the scanner isn't installed, I give the user the possibility to launch the Android Market with the Barcode Scanner App preselected, so he just needs to hit "Download".