简体   繁体   English

用于PhoneGap / cordova的条形码扫描仪

[英]Barcode scanner for PhoneGap/cordova

I am building one android application using cordova/phonegap and Javascript. 我正在使用cordova / phonegap和Javascript构建一个Android应用程序。 I am using scandit barcode scanner for scanning functionality. 我使用scandit条形码扫描仪进行扫描功能。 Scandit barcode scanner occupies entire screen while scaaning. Scandit条形码扫描仪在扫描时占据整个屏幕。 But I need scanning only in perticular area/div in my application. 但是我只需要在我的应用程序中的特定区域/ div中进行扫描。 How can I solve that issue? 我该如何解决这个问题? Is there any other scanner which can solve this issue? 还有其他扫描仪可以解决这个问题吗?

If you are just calling BarcodeScanner via an intent you have no control. 如果您只是通过意图调用BarcodeScanner,则无法控制。 However if you are embedding the Java code from the BarcodeScanner app in your app you have all the java code and xml resources available and can edit them how you like. 但是,如果您在应用程序中嵌入BarcodeScanner应用程序中的Java代码,则可以使用所有可用的Java代码和xml资源,并可以按照自己的喜好进行编辑。 It will all be Java and native Android resource stuff though.. not html. 它将全部是Java和本机Android资源的东西虽然..而不是HTML。

If you are embedding the layout is 如果你是嵌入布局的话

http://code.google.com/p/zxing/source/browse/trunk/android/res/layout/capture.xml http://code.google.com/p/zxing/source/browse/trunk/android/res/layout/capture.xml

and the activity that does the scanning you want to edit is 以及要编辑的扫描活动是

http://code.google.com/p/zxing/source/browse/trunk/android/src/com/google/zxing/client/android/CaptureActivity.java http://code.google.com/p/zxing/source/browse/trunk/android/src/com/google/zxing/client/android/CaptureActivity.java

If you add a button in the layout and call finish in the OnClickListener you set up in the activity it would be a back as you desire.. 如果您在布局中添加一个按钮并在OnClickListener中调用完成,那么您在活动中设置它将成为您想要的后退。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM