> - Snip -
>
Hey Jomo,
Does this actually allow an app to run in the background - or does it just emulate that action?
I need a plugin which will allow my app to constantly monitor the phones GPS and then reopen the app if the GPS stays in the same place for some time. Will this plugin do that?
If so you've got a sale
To understand the concept we'll need to explain the "life cycle" of an app. Taking Android as a example, when you minimize the app, it will go to Pause state. In Pause state, your app still runs but you can't see it. So putting a app to Pause state is similar to the traditional concept of "background". We can bring it to Resume state and everything goes like before.
But, if you didn't bring the app to foreground for some period, Android will bring your app to Stop state. This is what we don't want to see because Stop state released almost every resources. So when you bring an app from Stop state back to Start state, you'll see the splash screen again and all your game data will be lost.
Now the problems are:
1. Typically, Android automatically kills your app in Pause state if it has been paused for several minutes.
2. If you installed some memory management app like CleanMaster, sometimes it will kills your apps in Pause state.
So the conclusion is: We need to keep our app in Pause state and Avoiding it being killed(stopped) by Android or other memory management apps.
========
And secondly, this plugin brings back your game to foreground when user touching corresponding notification bar(like the notification bar for un-read SMS). I'm sorry this plugin can't automatically bring your game to foreground. Alternatively, it can add a notification bar or play alarm sounds in background.