原文:个人翻译,水平有限,欢迎看官指正。

                                                             public class

AlarmManager

extends Object

java.lang.Object
   ↳ android.app.AlarmManager

Class 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)获取。

英文太菜了,意识还是很模糊,需要加强英语啊,多多阅读英文文档。

 
 
                                                                    
                                                               当设备在休眠中,注册的闹钟将会保留(如果时间到了将会看情况唤醒设备),但是如果闹钟关掉了                                                                    或者闹钟重启了讲会清除前面的设定。               
 
 
 
                                                                Alarm Manager 将保持CPU激活状态到闹钟广播的接收者的onReceive() 方法运行。
 
 
 
 
                                                               这将可以保证手机不会休眠除非你终结广播事件的处理。                
 
 
 
                                                                onReceive()返回一次,Alarm Manager就会释放唤醒锁。
 
 
                                                                这就意味着你的手机在某种情况下一沉睡,你的 onReceive() 方法将结束,
 
 
 
                                                                如果闹钟广播的接收者,调用了 Context.startService(),你的手机将可能在请求的服务运行之前                                                                    就睡死。
 
 
                                                                为了防止上述情况的发生,你的广播接收器和服务需要实现独立的设备唤醒机制,确保你的手机可以                                                                       继续运行除非服务已经生效。
 
 
 
 
 
                                                                        Alarm Manager是为了应用在这中情况下的,当你需要让你的程序在某个特定的时间执行,甚                                                                       至你的程序并没有运行的时候。
 
 
 
 
 
 
 
 

Android英文文档翻译系列(1)——AlarmManager的更多相关文章

  1. Android英文文档翻译系列(6)——LocalBroadcastManager

    public class LocalBroadcastManager extends Object java.lang.Object    ↳ android.support.v4.content.L ...

  2. Android英文文档翻译系列(5)——VPNService

      API14位于android.net.VpnService 类概述|Class OverviewVpnService is a base class for applications to ext ...

  3. Android英文文档翻译系列(4)——PopupWindow

    public class PopupWindow extends Object //直接继承至Object java.lang.Object ↳ android.widget.PopupWindow  ...

  4. Android英文文档翻译系列(3)——AsyncTask

      AsyncTask——异步任务   个人认为这是翻译比较好的一次.. Class Overview//类概述 AsyncTask enables proper and easy use of th ...

  5. Android英文文档翻译系列(2)——HandlerThread

      public class   HandlerThread extends Thread   Class  Overview Handy class for starting a new threa ...

  6. Android进阶——多线程系列之Thread、Runnable、Callable、Future、FutureTask

    多线程一直是初学者最抵触的东西,如果你想进阶的话,那必须闯过这道难关,特别是多线程中Thread.Runnable.Callable.Future.FutureTask这几个类往往是初学者容易搞混的. ...

  7. Android提升篇系列:Activity recreate(Activity 重新创建/自我恢复)机制(一)

    注:本文中的recreate是指当内存不足时,Activity被回收,但再次来到此Activity时,系统重新恢复的过程.例如:当Activity A到Activity B时,如果内存不足,A被回收, ...

  8. Android控件系列之RadioButton&RadioGroup(转)

    学习目的: 1.掌握在Android中如何建立RadioGroup和RadioButton 2.掌握RadioGroup的常用属性 3.理解RadioButton和CheckBox的区别 4.掌握Ra ...

  9. Android网络编程系列 一 TCP/IP协议族

    在学习和使用Android网路编程时,我们接触的仅仅是上层协议和接口如Apache的httpclient或者Android自带的httpURlconnection等等.对于这些接口的底层实现我们也有必 ...

随机推荐

  1. UTF-8以字节为单位对Unicode进行编码

    UTF-8以字节为单位对Unicode进行编码.从Unicode到UTF-8的编码方式如下: Unicode编码(16进制) UTF-8 字节流(二进制) 000000 - 00007F 0xxxxx ...

  2. 载波帧听Carrier Sense

    在发送数据之前,以太网会“帧听”线缆,判断是否有其他数据传输. 如果通信介质上无载波,即没有被占用,则可以利用通信介质进行传送. 网卡芯片PHY具有上述功能. 数据链路层相关技术 共享介质网络 从通信 ...

  3. /dev/null脚本中作用

    /dev/null设备文件只有一个作用,往它里面写任何数据都直接丢弃. 因此保证了该命令执行时屏幕上没有任何输出. 在shell中常见. command  > /dev/null   2> ...

  4. win10无法访问局域网共享文件?(因微软账户和本地账户登陆问题导致)

    1 笔记本系统win10 X64企业版,其中一文件夹已设置为“共享”.本地帐号登录系统. 2 平板电脑系统win8.1 X64专业版,可以顺畅的访问笔记本的共享文件.微软帐号登录系统. 3 平板电脑系 ...

  5. SQL Server查询某个字段存在哪些表中

    一.查询SQL Server中所有的表 SQL语句:SELECT * FROM sys.tables name列表示所有的表名. 二.查询SQL Server中所有的列 SQL语句:SELECT * ...

  6. laravel 视图与传参

    1:先建立好一个控制器HgjController,其中index方法 return  view('hgj'); 2: 建立视图 在resources/views/hgj.blad.php <ht ...

  7. java.lang.UnsatisfiedLinkError: No implementation found for int com.xxx.xx中的couldn’t find “XX.so”或loadLibrary("xxx")失败

    我觉得这是个神坑,虽然早几年网上就很多po出来的解决方式,但是同样的问题,我的bug却稳如泰山,一点用都没有,好气 下面总结一下 这里前面先是有个系统打印信息 I/System.out: loadLi ...

  8. k近邻法(KNN)和KMeans算法

    k近邻算法(KNN): 三要素:k值的选择,距离的度量和分类决策规则 KMeans算法,是一种无监督学习聚类方法: 通过上述过程可以看出,和EM算法非常类似.一个简单例子, k=2: 畸变函数(dis ...

  9. RBAC 基于角色的访问控制

    RBAC(Role-Based Access Control,基于角色的访问控制),就是用户通过角色与权限进行关联.简单地说,一个用户拥有若干角色,每一个角色拥有若干权限.这样,就构造成“用户-角色- ...

  10. Erlang的Web库和框架

    ChicagoBoss,Nitrogen ,Zotontic,BeepBeep,ErlyWeb,Erlang Boss. 转自:http://bbs.chinaunix.net/thread-3764 ...