Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] AlarmManager accuracy


from what you've said, if API level 16 is used, then shouldn't the current approach work, as the documentation says that it will be inexact starting in API level 19?

1) Would supporting API level 19 bring additional benefits?  Would it mean that API level 16 was not supported and that it would not run on older Android versions?

2) there hasn't been a plan because until you mentioned it I didn't realize it was a problem!  It would be great if you could try a fix and see that it works.  I'm all for you helping out (check the contribution guidelines, but I want to check that this is the right approach.


On 03/05/2015 09:11 AM, Kamaljeet wrote:
I am using Paho MQTT Android service on a Kitkat device. I noticed that sometimes AlarmManager notification does not happen and this leads to disconnection. After searching the reason for this, I found this note in the Android documentation:

Beginning in API 19, the trigger time passed to this method is treated as inexact: the alarm will not be delivered before this time, but may be deferred and delivered some time later. The OS will use this policy in order to "batch" alarms together across the entire system, minimizing the number of times the device needs to "wake up" and minimizing battery use. 

There are two alternates to solve this issue; either use setExact or setWindow function to schedule the alarm. In order to use either of these functions, the minimum API needed is 19.

When compiling Paho Java and Android service based on Maven commands mentioned below, it always uses API 16:

My questions:
1) Is there a plan to support API 19 or later for the Paho Android service?
2) Is there a plan to change the AlarmManager call from set to setWindow? I will be happy to help with this task.


paho-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Ian Craggs                          
icraggs@xxxxxxxxxx                 IBM United Kingdom
Paho Project Lead; Committer on Mosquitto

Back to the top