-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
你好,这个项目有3个主要的service,主要后台业务应该写在哪个service上? #1
Comments
PlayerMusicService主要是保持进程存活,防止系统自动清理,一般不写业务在这里,只要它存在,你的进程时存活的,所以业务写哪里都可以,尽量不要写PlayerMusicService里。如果你的APP被用户或系统杀死,那么你需要拉起进程,这时你可以在AliveJobService中来检测包含业务逻辑的组件是否存在,没有的话就启动它,AliveJobService不推荐写业务。DaemonService与PlayerMusicService类似。 |
@jiangdongguo 有个问题,后台播放mp3 ,肯定对耗电有影响,但是具体影响到什么程度不知道。有什么办法测试吗? 本工程在Android4.4.4手机下测试,程序直接崩溃。 @abbenyyyyyy 业务层可以单独在启动一个service,在AliveJobService中检测你的业务service是否存活 ,如果不存活就启动,这样就可以了。 |
厉害,之前写过的保活在华为手机上只要自己主动杀死该 APP 的进程,就不会起来。没想到该项目测试结果真叫人兴奋啊!厉害啊,厉害。可以学习学习看怎么弄得。感谢了 |
(测试机为小米系列)7.0还是会死掉。6.0 进入doze 模式,需要不断 通过jobservice 拉起来,但是时间不固定。7.0 手机jobservice 不能起到作用,锁屏 三分钟 系统照样死掉 |
小米5 android 8.0测试锁屏半小时依然在运行 |
如题,主要有DaemonService、PlayerMusicService还有AliveJobService,我的业务逻辑应该要放在哪一个service上面?
另外PlayerMusicService的主要作用是拉起业务Service?具体应该怎么做呢?
主要工作遇到的困难是华为7.0机型的后台存活,希望能得到解答,谢谢。
The text was updated successfully, but these errors were encountered: