Android的服务与长期居住的HttpConnection [英] Android service with long living HttpConnection
本文介绍了Android的服务与长期居住的HttpConnection的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
I am tring to develop a project that connects to
彗星服务器长期生活 连接。我做这个工作的服务。 但是,当Android设备进入空闲模式,该线程我从服务开始停止工作,不关闭连接,或者尝试一个新的连接。
a comet server with long living connections. i do this job in a service. But when android device goes to idle mode, the thread i started from service stops working and do not close connections or try a new connection.
在那里,我应该用这个东西任何方法。
is there any method that i should use for this stuff.
推荐答案
使用PowerManager.WakeLock解决我的问题。我知道,它杀死baterry使用,但是,我不得不用很长的生活服务。
Using PowerManager.WakeLock solved my problem. I know, it kills baterry usage but, i had to use a long living service.
这篇关于Android的服务与长期居住的HttpConnection的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文