Skip to content

Instantly share code, notes, and snippets.

@billdawson
Created February 22, 2011 18:21
Show Gist options
  • Save billdawson/839101 to your computer and use it in GitHub Desktop.
Save billdawson/839101 to your computer and use it in GitHub Desktop.
QR Code Scan Example from Marshall's "Developing Native Android Apps with Titanium" Webinar
qrScanButton.addEventListener("click", function(e) {
var intent = Ti.Android.createIntent({
action: "com.google.zxing.client.android.SCAN"
});
intent.putExtra("SCAN_MODE", "QR_SCAN_MODE");
var activity = Ti.Android.currentActivity;
activity.startActivityForResult(intent, function(e) {
if (e.resultCode == Ti.Android.RESULT_OK) {
var contents = e.intent.getStringExtra("SCAN_RESULT");
var format = e.intent.getStringExtra("SCAN_RESULT_FORMAT");
Ti.UI.createNotification({
message: "Contents: " + contents + ", Format: " + format
}).show();
} else if (e.resultCode == Ti.Android.RESULT_CANCELED) {
Ti.UI.createNotification({
message: "Scan canceled!"
}).show();
}
});
});
@sswathi
Copy link

sswathi commented Feb 1, 2013

i am student i want to develop on barcode would please suggest me or sample source code mail for me
[email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment