I am developing a mobile application using Alpha Anywhere, and using the PhoneGap that is included within it. I have so far created the application successfully, however I have hit a problem with the app running in the background on my device. My app revolves around a timer that I need to keep running constantly in the background on the phone. I have a done a lot of searching online and have lot found anything that I can use, as of yet.

I found that in the config.xml that PhoneGap creates, that the "keep running" preference has to be set to true, which I have done -
<preference name="KeepRunning" value="true" />

I have also found a plugin called "Background Mode" https://build.phonegap.com/plugins/490 which I have put into my config.xml -
<gap:plugin name="de.appplant.cordova.plugin.background-mode" version="0.5.0" />

The plugin then mentions that you need window.plugin.backgroundMode.enable(); in the Javascript - which I have put into the onPhoneGapReady Event. https://github.com/katzer/cordova-pl...7714/README.md

However my app still gets killed in the background and I don't know what else I can try. I have seen something called a WakeLock, however it is Android only and will drain a lot of power from the battery of the device and shouldn't really be used.

Does anybody have any ideas?