Wednesday, 4 February 2015

What are the Predicates of Alarms, Pending intents and the Alarm Manager in Android ?

  1. Pending intents are intents that are kept in a pool and reused.You cannot new a pending intent.You really locate a pending intent with an option to reuse, update, and so on.
  2. An intent is uniquely distinguished by its action, data URI, and category.The detalis of the uniqueness are specified in the filterEquals() API of the intent class.
  3. A pending intent is furthur qualified (in addition to the base intent it depended on) by the request code.
  4. Alarms and pending intents(even intents, for that matter) are not independent.A given pending intent cannot be used for multiple alarms.The last alarm will override the previous alarms.
  5. Alarms are not persistent across boots.Whatever alarms you have set through the alarm manager will be lost when the device reboots.
  6. You will need to persist alarm parameters yourself if you would like to retain them beyond device reboots.You will need to listen to broadcast boot events and time-change events to reset these alarms as needed.
  7. The implication of the intent-based cancel API is that, when you use or persist alarms, you will also need to persist intents so that those alarms can be cancelled at a later time when needed.

No comments:

Post a Comment