Phonegap 3.3 app for Android behaves very different when debugging in Eclipse vs. release -
some background on application: developing app used small user study group. go through 2 separate short questionnaires throughout day. within day schedule 7 notifications fire. if user clicks on notification taking complete 1 of 2 survey types. each notification cancelled within 3 minutes of triggering. if user not access notification within time, the app records notification has been missed. there bedtime function (user receives no notifications) , delay notification function notifications triggered.
i add local notifications plugin: https://github.com/katzer/cordova-plugin-local-notifications
so on weird issues... have been debugging phonegap application religiously past 2 weeks , seems working when debug application in eclipse phone. member of research group says sees glaring bugs in application when runs release, have not reproduce them while debugging in eclipse. figure using old apk , doesn't know talking about, had fixed issues mentioning...
then unplug phone , carry around me day , until next morning when alarm scheduled go off , wake me up. hear nothing, continue sleeping. when wake see have stack of 3 notifications in status bar, of cancel @ same time 3 minutes after wake phone up... should mention sake of debugging, increased number of surveys day 50, explaining quick succession of notifications.
now i've come conclusion issue how android conducts memory management-- android kill low priority tasks, such javascript timeout functions have running via background-mode plugin
background mode plugin use: https://github.com/katzer/cordova-plugin-background-mode
it turns out , android, plugin enables/disables flag tells android not kill process... sake of memory management, flag overridden , js functions running in background of application killed... explains previous strange behavior.
however, there couple other odd things happen app when running in release... if delay notification (cancels current notification , adds 1 ten minutes now), login process screws up, requiring me login twice @ minimum. login procedure repeats on , on again, taking user main menu sending them login screen. other times cannot log in @ all... however, if keep trying log in, give way , can in, after quite few tries...
i have been through code thoroughly , there no way code result in sort of behavior... wondering if memory management issue mentioned above contributing these strange states of application? why not occur when debug within eclipse (this has never happened when debugging)?
i have no experience debugging issues memory, explanation why code acting strangely...
i can post code, don't know how use be... want know if sounds familiar has experienced issues android managing memory.
i've been in contact phonegap support , have say,
"i talked our lead android developer on our team , had say:
"yeah, guy going garbage collected if leaves cordova app running long period of time. allow apps run in background short periods default since people expect android life cycle, not on top of stack low priority, , need implement background service he's wanting.
as far running on eclipse, debugger attached kept alive, because debugger system process , has higher priority."
al"
Comments
Post a Comment