0

I'm currently trying to call a barcode scanner from my own Google Glass App. What I've done so far is to create a new intent which looks like this:

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

I always receive the following error:

no activity found to handle intent com.google.zxing.client.android.scan

Do I have to import something special? I know that there is a Glass implementation called BarcodeEye but this is actually full working glassware, isn't it?

EDIT: I'm able now to open the barcode scanner :) I've imported the current /android from the current ZXing library, added the current core-SNAPSHOT to it and marked it as a library project. In my main application I've added the /android as a library and also added the SNAPSHOT. With the following code I'm right now able to open the barcode scanner:

     Intent objIntent = new
     Intent("com.google.zxing.client.android.SCAN");
     objIntent.putExtra("SCAN_MODE",
     "ONE_D_MODE,QR_CODE_MODE,PRODUCT_MODE,DATA_MATRIX_MODE");
     startActivityForResult(objIntent, UPC_CODE_REQUEST);

The problem at the moment is that after a scan was successfully done the app is not jumping back to the activity from where I called the intent for the barcode. It just closes the barcode scanner and also my main application. I'm not getting any errors from the console. Maybe someone knows what's happening and why the "onActivityResult" method is not called.

Greetings Stef

user2858559
  • 39
  • 1
  • 9

1 Answers1

0

This is fairly confused. You're trying to invoke an external app by Intent, but it doesn't exist, which is what the error tells you. You can try building and installing the Glass app from the original open source project in order to respond to the Intent: https://github.com/zxing/zxing/tree/master/glass

You're importing an app, /android which isn't supposed to be "imported" into other projects. It's not designed for Glass but may sort of work, poorly. But none of that is necessary if you're using Intents from your app.

Sean Owen
  • 66,182
  • 23
  • 141
  • 173
  • Hey, well I actually went through this tutorial http://damianflannery.wordpress.com/2011/06/13/integrate-zxing-barcode-scanner-into-your-android-app-natively-using-eclipse/ and thought that it would be right, isn't it? – user2858559 Nov 08 '14 at 18:59
  • Not for Glass, and no it is not really appropriate to clone the app completely like that. – Sean Owen Nov 08 '14 at 19:55
  • So what do you suggest then? Taking the ZXing Glass app and using this one? What I read about was that with this one I'm only able to scan QR-Codes – user2858559 Nov 08 '14 at 23:47