문제

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 ?

도움이 되었습니까?

해결책

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).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top