service可以像静态broadcastReceiver一样,即使APP已经退出,仍然在后台运行吗?
ringa_lee2017-04-17 17:27:17
In fact, even static broadcastReceivers can be killed. At present, domestic mobile phones attach great importance to background services. Like Huawei mobile phones, third-party services will be killed when the screen is turned off, except for joining the whitelist of Huawei Butler. Apps such as QQ and WeChat are whitelisted by default. Answer the original poster’s question below:
Using remote service can make the app exit the service and still run in the background, but it can be easily killed by some housekeeping software. Therefore, you can increase the priority of the service by setting the service as a foreground service, which can reduce the probability of being killed.
The killer tip: Change the package name of your app to com.tencent.mm, guaranteed not to die, haha.
伊谢尔伦2017-04-17 17:27:17
Look at the introduction of the service on google, it is impossible for domestic mobile phones, the native system will stop when there is not enough memory
迷茫2017-04-17 17:27:17
You can search for articles about process keep-alive
Android service background keep-alive principles and test results
PHP中文网2017-04-17 17:27:17
Don’t QQ have this function? Although I have turned it off, the background service can still receive friend information