Using zxing in Google Glass

I am trying to use zxing on google stack, but I am getting error above.

I am using zxing 2.2 core.jar I also get this error message on the device display "Sorry, the Android camera has a problem. You may have to restart the device."

I am glad of the intention of my active work

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); } 

Eclipse Error Message

 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) 12-16 15:29:24.585: W/CaptureActivity(2150): at com.google.zxing.client.android.camera.CameraManager.openDriver(CameraManager.java:78) 

Links to GDK cameras ( https://developers.google.com/glass/develop/gdk/reference/com/google/android/glass/media/Camera )

There is a lot of information on how to use it, but there are other questions like this.

Google Glass preview image scrambled with new version of XE10

which make me think you can use zxing on glass.

+6
source share
2 answers

I do not include

 <uses-permission android:name="android.permission.CAMERA"/> 

at the top of my manifest.

This blocks my camera to open.

If someone is trying to integrate zxing, I suggest using this tutorial.

http://damianflannery.wordpress.com/2011/06/13/integrate-zxing-barcode-scanner-into-your-android-app-natively-using-eclipse/

+2
source

This BarcodeEye project is a ZXing port for Google Glass that works.

The source is online. He decided for my use case

https://github.com/BarcodeEye/BarcodeEye

+1
source

All Articles