androidzxinggoogle-goggles

Google Goggles via IntentIntegrator Works But No 'Capture' Button


I've done some research (Stack Overflow and on the web) and see that there are some other questions about Google Goggles and the possibility of using it with Android; via an Intent. I realize it is not officially supported and that we are all still waiting for Google to open up the API or provide us the functionality to easily use it in our apps.

That said - I would still like an answer / some clarification on the following, if anyone can help?

Referencing this question: zxing intent "google goggles" doesn't recognize barcodes

It is answered that Google Goggles does decode barcodes, which indeed it does... so in my app I am calling to the latest version of the Google Goggles app via the IntentIntegrator:

https://code.google.com/p/zxing/wiki/ScanningViaIntent https://code.google.com/p/zxing/source/browse/trunk/android-integration/src/com/google/zxing/integration/android/IntentIntegrator.java

This call via the IntentIntegrator successfully opens Google Goggles in scan mode (of sorts), however there is no 'Capture' button displayed on the UI, it is hidden / unavailable ... so it is not possible to take a shot / capture any image, to see if the callback with result to my app works.

So my thoughts are:

Code sample of how I'm making the call to open Google Goggles below. Also another way to do the same thing is included, but commented out for reference.

    // Try and open Google Goggles for scanning
    try{

        IntentIntegrator integrator = new IntentIntegrator(getSupportActivity());
        integrator.initiateScan(IntentIntegrator.TARGET_ALL_KNOWN);

        //Intent intent = new Intent("com.google.zxing.client.android.SCAN");
        //intent.setPackage("com.google.android.apps.unveil");
        //startActivity(intent);

    }catch(Exception e){
        Log.e(ScanFragment.class.getName(), "onViewCreated > Error creating scan Intent to Google Goggles: " + e.getMessage()); 
    }
    //>

Any help on finding out more on this would be greatly appreciated; thanks.

// WildStyle


Solution

  • Yes, I am actually not sure Goggles supports this Intent anymore. It is not in the list of apps that will be targeted by default. So I don't think you are opening Goggles if you are using IntentIntegrator; you are opening one of the Barcode Scanner apps. They don't have a capture button, you just bring the barcode into view.

    If it's really opening Goggles, maybe it was previously set as the default for this Intent and that is taking precedence. Try clearing application handler associations in Settings.