Created
February 22, 2011 18:21
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} | |
}); | |
}); |
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
What modules are required to run this code? Can you show me the link to the module itself?