Cordova App - working on emulator (visual community) but not on device


I've encountered something that I'm unable to understand :

I have these few lines in my index.html :

<button id="btn1" type="button">Click Me</button>
<script type="text/javascript" src="scripts/camera.js"></script>
<p id="DebugMessagesOnScreen">SomeMessage</p>

and a camera.js file with the following lines :

function doStuff() {
    document.getElementById("DebugMessagesOnScreen").innerHTML = "ButtonPressed";
document.getElementById("btn1").addEventListener('click', doStuff);

Now, on the emulater - when the button is pressed - the 'SomeMessage' in

<p id="DebugMessagesOnScreen">SomeMessage</p>

changes, as expected, do "ButtonPressed".

However - a click on the button on a real android device doesn't change the text. (the button itself seems to react to the press since it blinks/refresh shortly every time I press it).

I think this is the Down/Up button press part from the console :

D/InputReader(  738): AP_PROF:AppLaunch_dispatchPtr:Down:459601588, ID:0, Index:2083680096
I/AP_PROF (  738): unable to open /proc/mtprof/status entry
D/PowerManagerService(  738): userActivityFromNative
W/ResourceType(19662): No package identifier when getting name for resource number 0x00000064
D/PowerManagerService(  738): userActivityNoUpdateLocked: eventTime=459601588, event=2, flags=0x0, uid=1000
D/PowerManagerNotifier(  738): onUserActivity: event=2, uid=1000
D/PowerManagerService(  738): updateUserActivitySummaryLocked: mWakefulness=Awake, mUserActivitySummary=0x1, nextTimeout=459715588 (in 113997 ms)
D/PowerManagerService(  738): newScreenState = 2
I/View    (19662): Touch down dispatch to org.apache.cordova.engine.SystemWebView{42178518 VFEDH.C. .F...... 0,0-1280,670 #64}, event = MotionEvent { action=ACTION_DOWN, id[0]=0, x[0]=49.960968, y[0]=104.78502, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=459601588, downTime=459601588, deviceId=2, source=0x1002 }
D/PowerManagerDisplayController(  738): requestPowerState: screenState=2, useProximitySensor=false, forceProximitySensorEnable=false, forceWakeUpEnable=false, screenBrightness=204, screenAutoBrightnessAdjustment=0.0, useAutoBrightness=false, useEcoBrightness=false, blockScreenOn=false, waitForNegativeProximity=false
I/PowerManagerService(  738): setBrightness mButtonLight 0.
D/PowerManagerService(  738): updateScreenStateLocked: mDisplayReady=true, newScreenState=2, mWakefulness=1, mWakeLockSummary=0x0, mUserActivitySummary=0x1, mBootCompleted=true
D/PowerManagerService(  738): handleSandman: canDream=false, mWakefulness=Awake
D/OpenGLRenderer(19662): prepareDirty (0.00, 0.00, 1280.00, 720.00) opaque 1 <0x7cbca060>
D/OpenGLRenderer(19662): finish <0x7cbca060>
D/InputReader(  738): AP_PROF:AppLaunch_dispatchPtr:Up:459601613, ID:0, Index:2083681392

Any ideas ?

Thanks Ofer.

asked on Stack Overflow Aug 9, 2016 by H. ofer • edited Aug 9, 2016 by H. ofer

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0