============ Problem Description ============
I need to implement a function that the Android program starts a service after running, this service service needs to be running all the time, after the normal exit the program, the services still exist, normal operation.
However, if I force stop after using Android Optimizer or other tools, or if Meizu clears the current running program, the service will no longer start.
Is there a way to ensure that the service has been running, not forced to kill or able to reside in memory, similar to Weibo or Baidu input method, the process is not cleared, how to achieve?
============ Solution ============
1
You can set up broadcast registration,
Start service automatically when network starts
Start service automatically when phone starts
If you do not kill the other tools at all, it is forbidden to kill the process, I am afraid to write JNI registered to the underlying system service. Do not know possible to achieve.
============ Solution ============
2
General Service is forced to kill will restart the seemingly
============ Solution ============
3
Unless you register as a system service in the INIT.R can be achieved of course this needs to compile the system.
You can set the kill to restart service this slightly rogue point as a third party not to be killed apparently impossible
============ Solution ============
4
Locking the service with power management should be possible, but to handle the issue of releasing the power lock, the battery will be very powerful.
How to make Android service not purged or resident memory