我只是在绝望中写这篇文章:)我被指派为Android 1.6手机制作一个独立的条形码扫描仪(作为概念证明).
为此,我发现了ZXing库.
我用谷歌搜索,在StackOverflow上阅读相关主题,使用常见的等等.似乎没有任何帮助,我只是不能在这个精神封锁上打个洞:/
我知道可以使用lib,并创建自己的独立条形码扫描仪.我读过使用Zxing人提供的"条码扫描器",这是迄今为止最简单的解决方案(通过Intent).不幸的是,这不是一个选项,需要一个独立的应用程序.
总结一下我的问题:
我试图让我的代码项目依赖于ZXing源文件夹中的Android文件夹.当我这样做时,会出现一些错误,主要涉及'org.apache'(??)
我只是想不出来......所以一些提示将是最有帮助的.
提前谢谢:)
我想将zxing扫描仪集成到我的应用程序中而无需外部应用程序(来自Play商店的zxing扫描仪).这是我的代码
Button scan = (Button) findViewById(R.id.scan_button);
scan.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent("com.google.zxing.client.android.SCAN");
intent.setPackage("com.mypackage.app");
intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
startActivityForResult(intent, SCANNER_REQUEST_CODE);
}
});
@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
if (requestCode == SCANNER_REQUEST_CODE) {
// Handle scan intent
if (resultCode == Activity.RESULT_OK) {
// Handle successful scan
String contents = intent.getStringExtra("SCAN_RESULT");
String formatName = intent.getStringExtra("SCAN_RESULT_FORMAT");
byte[] rawBytes = intent.getByteArrayExtra("SCAN_RESULT_BYTES");
int intentOrientation = intent.getIntExtra("SCAN_RESULT_ORIENTATION", Integer.MIN_VALUE);
Integer orientation = (intentOrientation == Integer.MIN_VALUE) ? null …Run Code Online (Sandbox Code Playgroud) 我打算将条形码阅读器集成到我的应用程序中.是否已有Android API?
我一直在开发一个Android应用程序来扫描条形码和QR码并将结果发送到其他应用程序(HTTP).我已经通过互联网阅读了大部分文档,并且在堆栈中通过流程阅读并使其正常工作.我能够在我的设备上运行独立的zxing android应用程序,我也可以运行我自己的独立Android应用程序来使用Zxing意图扫描条形码.但即使在这里阅读了这么多问题以及互联网上的一些博客之后,我也无法满足我的严格要求.
我想实现以下目标.1.我不想在我的设备中安装单独的条形码扫描仪应用程序以使我自己的应用程序工作(扫描条形码).我使用了以下代码
Intent intent = new Intent("com.google.zxing.client.android.SCAN");
startActivityForResult(intent, 0);
Run Code Online (Sandbox Code Playgroud)
当我在我的设备中运行应用程序时,它会询问"选择应用程序以完成此操作"并显示"Google"和"Google Goggles"并打开Google页面默认摄像头并扫描条形码.我希望CaptureActivtiy默认捕获页面(不是Google的)来扫描条形码.3.我尝试在我自己的应用程序中使用ZXing作为库,但它没有用.
你能告诉我到底哪里出错吗?
我试图在谷歌玻璃上使用zxing,但是我收到了上面的错误.
我使用zxing 2.2 core.jar我也在设备显示屏上收到此错误消息"抱歉,安卓摄像头遇到问题.您可能需要重启设备".
我正在对我的oncreate活动发起意图
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = new Intent("com.google.zxing.client.android.SCAN");
intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
startActivityForResult(intent, 0);
}
Run Code Online (Sandbox Code Playgroud)
Eclipse错误消息
12-16 15:29:24.578: I/PlatformSupportManager(2150): Using implementation class com.google.zxing.client.android.camera.open.GingerbreadOpenCameraInterface of interface com.google.zxing.client.android.camera.open.OpenCameraInterface for SDK 9
12-16 15:29:24.578: I/GingerbreadOpenCamera(2150): Opening camera #0
**12-16 15:29:24.585: W/CaptureActivity(2150): Unexpected error initializing camera**
12-16 15:29:24.585: W/CaptureActivity(2150): java.lang.RuntimeException: Fail to connect to camera service
12-16 15:29:24.585: W/CaptureActivity(2150): at android.hardware.Camera.native_setup(Native Method)
12-16 15:29:24.585: W/CaptureActivity(2150): at android.hardware.Camera.<init>(Camera.java:374)
12-16 15:29:24.585: W/CaptureActivity(2150): at android.hardware.Camera.open(Camera.java:315)
12-16 15:29:24.585: W/CaptureActivity(2150): at com.google.zxing.client.android.camera.open.GingerbreadOpenCameraInterface.open(GingerbreadOpenCameraInterface.java:57) …Run Code Online (Sandbox Code Playgroud) 在 Android 开发工具中,如何使用ZXing 库在不使用相机的情况下从屏幕上读取 QR 码?
请问有人可以帮我吗?
我想将zxing源代码集成到我的android应用程序中.我已经下载了zxing1.5并将整个代码集成到我的应用程序中,我通过意图调用活动"CaptureActivity".它仅显示摄像机视图,但不扫描条形码.你可以告诉我如何解决这个问题,因为我希望我的应用程序是独立的.我不想在设备中单独安装BarcodeScanner.apk.
提前致谢....