使用C2DM推送服务时出现ANR
我目前正在使用 C2DM 推送服务开发 Android 应用程序。当然,它在模拟器中运行顺利,但是当我在我的设备上安装时,由于互联网速度连接等原因,我遇到应用程序超时。
我可以做什么来防止这种情况发生?
I'm currently developing an android app using the C2DM push service. Of course it runs smootly in the emulator, but when I installed on my device, I'm getting application timeouts because of the internet speed conection or so.
What can i do to prevent this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没什么可做的。发送 C2DM 消息时,您可以指定消息的重要性(是否应该唤醒设备,或者等待用户唤醒设备)。但是,只有当您使用字段
delay_while_idle
指定它时,才会发生这种情况。有两个因素在起作用:手机是否已连接到 Google(顶部栏中的连接是否为绿色(至少在 Nexus 1 上))以及连接的速度有多快。据我所知,唯一可以加快速度的方法就是使用 wifi。
There is not much to do. When sending the C2DM message you can specify the importance of the message (should it wake the device, or wait for when the user wakes it). However, this will only happen, if you specify it with the field
delay_while_idle
.Two factors come in to play: Is the phone connected to Google (is the connection green in the top bar (on nexus one at least)) and how fast is the connection. The only way you can speed this up, is to be on wifi, as far as I know.