如何让android进入低功耗状态
我有一个高度数据计算密集型应用程序,必须每 60 秒处理一次通过蓝牙接收的数据,然后在接下来的 60 秒内保持低功耗状态。我检查了 PowerManager api,但无法使用它。我有办法完成任务吗?
i have a highly data computation intensive application that has to process data received via bluetooth every 60 seconds and then stay in low power state for the next 60 seconds. i checked out the PowerManager api but i am unable to use it. is there a way i could accomplish the task?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您不能“将 android 置于低功耗状态”。如果没有任何东西持有
WakeLock
来强制 CPU 保持运行,Android 在一段时间不活动后自然会进入睡眠模式。You cannot "put android on low power state". Android naturally will go into a sleep mode after a period of inactivity, if nothing is holding a
WakeLock
to force the CPU to stay running.您可以使用 PowerManager goToSleep() 方法“强制设备进入睡眠状态。覆盖所有持有的唤醒锁”: http://developer.android.com/reference/android/os/PowerManager.html#goToSleep%28long%29
You can use PowerManager goToSleep() method to "force the device to go to sleep. Overrides all the wake locks that are held": http://developer.android.com/reference/android/os/PowerManager.html#goToSleep%28long%29