Saturday 15 March 2014

cordova - Phonegap app on Android platform - keep app running -


I have a phonegap app that acts as a communication service for a specific group of people Phonegap-plugins GitHub page Using local notification planning, I have applied the notification in the app so that whenever a new message gets received, an alert will appear if the app is in the background.

About an hour later, however, no further information will be found, and it appears that the process was killed. When I come back to the app, instead of starting it, it starts completely, from where I left it last time. I'm convinced that after a certain time, Android stopped playing the app in the background.

Does anyone know that as long as the user is asked to stop, stop killing the Android process? Commonswear suggests, you can write a dummy service to keep your app alive, but at the same time it can be written as appropriate. Suggestion, if you are going in an effort to write an original dummy service, you can basically write the actual service and do it with it.

A quick and dirty solution, maybe you can use partial WakeLock () to keep the CPU while keeping your app in the background.

I have successfully used this approach to stay alive in this background so that they can get and process status updates.

In your case, it is not okay to be alive to get the information, which was intended for partial Wakelock and therefore I'm not sure that Android will kill your app anytime after that, because There is nothing (unlike me who is constantly receiving status updates and processing), but it can work without the need to write a service, so be able to try.

See my, which has the updated version of my code. I updated the plugin for use with Cordova 2.8.0, but also extended it to be able to get a partial callclock.

No comments:

Post a Comment