search

Home  >  Q&A  >  body text

android - service可以像静态broadcastReceiver一样,即使APP已经退出,仍然在后台运行吗?

service可以像静态broadcastReceiver一样,即使APP已经退出,仍然在后台运行吗?

怪我咯怪我咯2771 days ago680

reply all(5)I'll reply

  • ringa_lee

    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.

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 17:27:17

    This is not possible

    reply
    0
  • 伊谢尔伦

    伊谢尔伦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

    reply
    0
  • 迷茫

    迷茫2017-04-17 17:27:17

    You can search for articles about process keep-alive
    Android service background keep-alive principles and test results

    reply
    0
  • PHP中文网

    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

    reply
    0
  • Cancelreply