Question

My application purpose just simply captures a ISBN number then converts ISBN to a string. I know about the zxing project, however after skimming their code and research, I couldn't find the way to use their code without using Intent.

Intent intent = new Intent("com.google.zxing.client.android.SCAN");
intent.putExtra("SCAN_MODE", "ISBN");
startActivityForResult(intent, 0);

How can I avoid this step to make my application standalone from Barcode Scanner application ?

Was it helpful?

Solution

Your problem seem to be the dependency on Zxing Barcode Scanner being present on users devices. As Gene mentions in his comment Zxing provides a "IntentIntegrator" library for this use case. It's a small Java library that you bundle with your app and handles the case where Zxing is not installed on the phone for you, amongst other things.

It is described at http://code.google.com/p/zxing/wiki/ScanningViaIntent. See also http://code.google.com/p/zxing/source/browse/trunk#trunk%2Fandroid-integration%2Fsrc%2Fcom%2Fgoogle%2Fzxing%2Fintegration%2Fandroid for details (source for this library).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top