Android英文文档翻译系列(1)——AlarmManager
来源:互联网 发布:淘宝会员要钱吗 编辑:程序博客网 时间:2024/03/29 08:29
AlarmManager
extends ObjectClass Overview
This class provides access to the system alarm services.
这个类可以提供访问系统闹钟服务,
These allow you to schedule your application to be run at some point in the future.
他允许你安排你的的应用在未来某个时间点运行。
When an alarm goes off, the Intent
that had been registered for it is broadcast by the system,
当闹钟时间到了,注册进系统广播的Intent,
automatically starting the target application if it is not already running.
将自动运行目标程序如果程序还没有启动的话。
Registered alarms are retained while the device is asleep (and can optionally wake the device up if they go off during that time), but will be cleared if it is turned off and rebooted.
The Alarm Manager holds a CPU wake lock as long as the alarm receiver's onReceive() method is executing.
This guarantees that the phone will not sleep until you have finished handling the broadcast.
Once onReceive() returns, the Alarm Manager releases this wake lock.
This means that the phone will in some cases sleep as soon as your onReceive() method completes.
If your alarm receiver called Context.startService()
, it is possible that the phone will sleep before the requested service is launched.
To prevent this, your BroadcastReceiver and Service will need to implement a separate wake lock policy to ensure that the phone continues running until the service becomes available.
Note: The Alarm Manager is intended for cases where you want to have your application code run at a specific time,even if your application is not currently running.
说明:
For normal timing operations (ticks, timeouts, etc) it is easier and much more efficient to use Handler
.
对于大多数定时操作(提醒,超时等)应用Handler将更简单和高效。
You do not instantiate this class directly; instead, retrieve it throughContext.getSystemService(Context.ALARM_SERVICE)
.
你不需要实例化它的对象,只需要通过Context.getSystemService(Context.ALARM_SERVICE)获取。
英文太菜了,意识还是很模糊,需要加强英语啊,多多阅读英文文档。
Context.startService()
,你的手机将可能在请求的服务运行之前 就睡死。- Android英文文档翻译系列(1)——AlarmManager
- Android英文文档翻译系列(2)——HandlerThread
- Android英文文档翻译系列(3)——AsyncTask
- Android英文文档翻译系列(4)——PopupWindow
- Android英文文档翻译系列(5)——VPNService
- Android英文文档翻译系列(4)——PopupWindow
- Android英文文档翻译系列(5)——VPNService
- 翻译英文技术文档
- Android—AlarmManager的使用
- Android官方文档系列(翻译)
- Spring英文参考文档翻译
- Android API文档翻译——Service
- unity官方文档翻译——Android
- Python爬虫基础实战——用爬虫来自动翻译英文文档
- android官方技术文档翻译——Android Lint
- GRUB2英文文档的部分翻译
- Hibernate学习英文文档翻译2
- 关于Map英文文档的一段翻译
- AndroidのUI体验之上拉下拉
- AndroidのBuild工具之Ant动手实践
- (转)关于android设备管理器的一些分析
- Apktool源码解析——第一篇
- Apktool源码解析——第二篇
- Android英文文档翻译系列(1)——AlarmManager
- Android英文文档翻译系列(2)——HandlerThread
- Android英文文档翻译系列(3)——AsyncTask
- JavaScript之indeOf与lastIndexOf
- Android英文文档翻译系列(4)——PopupWindow
- Android英文文档翻译系列(5)——VPNService
- Android英文文档翻译系列(4)——PopupWindow
- Android英文文档翻译系列(5)——VPNService
- CSDN专栏收集