Search code examples
androidgoogle-visionandroid-vision

Android Multi-tracker sample project runs but shows no form of detection


I have been trying to test the new Vision API and got the multi-tracker app running in Android Studio.

I am running the sample app on my phone, but I am not able to detect any barcodes. I have tested ISBN codes, QR codes, and faces. Both with large images due to the focusing issue; however, I don't see anything happening with detection.

What should I expect to see? How do I get barcodes detected from the sample app?


Solution

  • I would guess that the reason that you aren't detecting anything with the sample app is that the vision libraries weren't successfully downloaded to your device. This will happen if the device is in a "low storage" state. We recently updated the samples to check for this condition and provide feedback to the user. For example:

    // Check for low storage.  If there is low storage, the native library will not be
    // downloaded, so detection will not become operational.
    IntentFilter lowstorageFilter = new IntentFilter(Intent.ACTION_DEVICE_STORAGE_LOW);
    boolean hasLowStorage = registerReceiver(null, lowstorageFilter) != null;
    
    if (hasLowStorage) {
        Toast.makeText(this, R.string.low_storage_error, Toast.LENGTH_LONG).show();
        Log.w(TAG, getString(R.string.low_storage_error));
    }
    

    https://github.com/googlesamples/android-vision/blob/master/visionSamples/photo-demo/app/src/main/java/com/google/android/gms/samples/vision/face/photo/PhotoViewerActivity.java#L91

    If you are encountering this, freeing up space on the device should do the trick.