魅力程序猿

  • 首页
  • Java
  • Android
  • APP
    • 扑克计分器
    • Video Wallpaper
  • 联系我
  • 关于我
  • 资助
道子
向阳而生
  1. 首页
  2. Android
  3. 正文

Android 服务保活(一)

2016年10月27日 8256点热度 0人点赞 2条评论

Android 进程拉活3种方法:

A. 提供进程优先级,降低进程被杀死的概率

方法一:监控手机锁屏解锁事件,在屏幕锁屏时启动1个像素的 Activity,在用户解锁时将 Activity 销毁掉。

方法二:启动前台service。

B. 在进程被杀死后,进行拉活

方法一:注册高频率广播接收器,唤起进程。如网络变化,解锁屏幕,开机等

方法二:双进程相互唤起。

方法三:依靠系统唤起。

C. 依靠第三方

根据终端不同,在小米手机(包括 MIUI)接入小米推送、华为手机接入华为推送;其他手机可以考虑接入腾讯信鸽或极光推送与小米推送做 A/B Test。

现在鹅厂的微信、qq、邮箱都是利用双进程相互唤醒,可见双进程相互唤醒是比较靠谱的一个方法,其他 方法可以作为辅助。

标签: Android 服务保活
最后更新:2016年10月27日

daozi

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

  • Laticia

    No, they don't want to upset the huge number of cultural enrichers they have invited into Norway. I suppose Krsitiansen felt torn between her loyalty to the Norwegian state(such as it still is!) and the vultural - I mean cultural enrichers from Pakistan, Somalia etc.

    2016年12月19日
    回复
  • Steffie

    people were leaving them via twlecer.Exttilent design. Love the flow, but I think I love the fact that you are back to blogging here once more.yay!

    2016年12月19日
    回复
  • razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
    取消回复
    搜索
    联系方式

    QQ群:179730949
    QQ群:114559024
    欢迎您加入Android大家庭
    本人QQ:136049925

    赐我一丝安慰
    给我一点鼓励

    COPYRIGHT © 2023 魅力程序猿. ALL RIGHTS RESERVED.

    Theme Kratos Made By Seaton Jiang

    豫ICP备15000477号