Reputation: 778
I have an app that has the Cordova Barcode Scanner to scan the UPC number. It works fine on iOS and returns the results as expected. However on Android Marshmallow 6.1 it scans and shows the message Product found on the camera screen but doesn't return any values to my view as expected. I have scanned through my entire app and no where I have the text Product found. Not sure what is the source of this message. Please help.
Problem persists on Android 5.1 as well.
You can see this Product found message. I have search through my app code as well as the code for my apis. None works. Please see the URL below:
https://drive.google.com/open?id=0B81YQAjfP0R2VmU2V1I1QTg3NWc
Also see the iOS version of it that is fully functional:
https://drive.google.com/open?id=0B81YQAjfP0R2RkhEeVlOVUlLUmc
Please see the debug code below. nothing is published in the console when barcode scanner is called.
D/PowerManagerService( 946): turnOffButtonLight mButtonLightTimeout = 2000 D/PowerManagerService( 946): Trun on the button and after 2000s,then turn off the button ! D/AutomaticBrightnessController( 946): ZTE_PM_LIGHT updateAmbientLux: mLightSensorListener lux is 9.0 D/AutomaticBrightnessController( 946): ZTE_PM_LIGHT updateAmbientLux: mLightSensorListener lux is 14.0 D/PowerManagerService( 946): turnOffButtonLight mButtonLightTimeout = 2000 D/AutomaticBrightnessController( 946): ZTE_PM_LIGHT updateAmbientLux: mLightSensorListener lux is 3.0 D/PowerManagerService( 946): Trun on the button and after 2000s,then turn off the button ! D/AutomaticBrightnessController( 946): ZTE_PM_LIGHT updateAmbientLux: mLightSensorListener lux is 12.0 D/AutomaticBrightnessController( 946): ZTE_PM_LIGHT updateAmbientLux: mLightSensorListener lux is 9.0 D/PowerManagerService( 946): turnOffButtonLight mButtonLightTimeout = 2000 D/ConnectivityService( 946): updateNetworkScore for NetworkAgentInfo [WIFI () - 109] to 51 D/ConnectivityService( 946): rematching NetworkAgentInfo [WIFI () - 109] D/ConnectivityService( 946): Network NetworkAgentInfo [WIFI () - 109] was already satisfying request 1. No change. D/ConnectivityService( 946): notifyType AVAILABLE for NetworkAgentInfo [WIFI () - 109] D/AutomaticBrightnessController( 946): ZTE_PM_LIGHT updateAmbientLux: mLightSensorListener lux is 11.0 D/PowerManagerService( 946): Trun on the button and after 2000s,then turn off the button ! I/ActivityManager( 946): START u0 {act=com.google.zxing.client.android.SCAN cat=[android.intent.category.DEFAULT] pkg=com.test.testapp296079 cmp=com.test.testapp296079/com.google.zxing.client.android.CaptureActivity} from uid 10110 on display 0 V/WindowManager( 946): addAppToken: AppWindowToken{2ac1f12b token=Token{2571457a ActivityRecord{1e190da5 u0 com.test.testapp296079/com.google.zxing.client.android.CaptureActivity t35}}} to stack=1 task=35 at 1 V/WindowManager( 946): Adding window Window{2ec02634 u0 com.test.testapp296079/com.google.zxing.client.android.CaptureActivity} at 9 of 13 (after Window{3d1aa37b u0 com.test.testapp296079/com.test.testapp296079.MainActivity}) V/WindowManager( 946): Adding window Window{2c8f09d2 u0 SurfaceView} at 9 of 14 (before Window{2ec02634 u0 com.test.testapp296079/com.google.zxing.client.android.CaptureActivity}) D/AutomaticBrightnessController( 946): ZTE_PM_LIGHT updateAmbientLux: mLightSensorListener lux is 9.0 D/AutomaticBrightnessController( 946): ZTE_PM_LIGHT updateAmbientLux: mLightSensorListener lux is 17.0 D/PowerManagerService( 946): turnOffButtonLight mButtonLightTimeout = 2000 D/AutomaticBrightnessController( 946): ZTE_PM_LIGHT updateAmbientLux: mLightSensorListener lux is 8.0 D/AutomaticBrightnessController( 946): ZTE_PM_LIGHT updateAmbientLux: mLightSensorListener lux is 110.0 D/AutomaticBrightnessController( 946): updateAutoBrightness: value=0.16730924 *255 = 42.663857 D/AutomaticBrightnessController( 946): updateAutoBrightness: mScreenAutoBrightness=21, newScreenAutoBrightness=43 D/DisplayPowerController( 946): ZTE_PM updatePowerState mPowerRequest.dozeScreenState=0 D/DisplayPowerController( 946): ZTE_PM_PROX updatePowerState state=2 D/DisplayPowerController( 946): ZTE_PM_PROX disable ProxSensor while NO useProximitySensor D/AutomaticBrightnessController( 946): ZTE_PM mScreenAutoBrightnessAdjustment no change D/AutomaticBrightnessController( 946): shuangdan LightSensorchanged = true,autolcdenable = true,autobuttonEnabled = false D/AutomaticBrightnessController( 946): updateAutoBrightness: value=0.16730924 *255 = 42.663857 D/DisplayPowerController( 946): ZTE_PM_LHX_animate mPowerState.getScreenBrightness() 21 mPowerState.getActualScreenBrightness() 21 D/DisplayPowerController( 946): ZTE_PM_animate animate LCD brightness to 43
Upvotes: 0
Views: 211
Reputation: 778
Alright, this was really being the Android first timer issue.
Turns out a very silly issue that is OS specific caused it to fail. iOS handles false as a 0 and android as a text string false. I just had to put this condition and it worked.
if($scope.cancelled === 0 || $scope.cancelled === false)
Upvotes: 0