Question: What are the parameters of the following: 

```
alarmMgr.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),
                AlarmManager.INTERVAL_FIFTEEN_MINUTES, alarmIntent);

```

And of the following: 

```
alarmMgr.setInexactRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),
        AlarmManager.INTERVAL_DAY, alarmIntent);

```

What is the difference and also how are the two different in terms of functionality?

Answer: 
Both examples schedule a repeating alarm that will send the given `alarmIntent`. On both cases, the first time it is sent will be immediate (`calendar.getTimeInMillis()` returns [the current time](http://www.tutorialspoint.com/java/util/calendar_gettimeinmillis.htm)). On both cases, the device will be woken up when the alarm needs to be sent (as evident by `AlarmManager.RTC_WAKEUP`).

There are two differences between these calls. The simpler one is that the intent will be sent every fifteen minutes on the first call, and every day on the second call (as you can see in the third parameter). The more complicated difference is the function call itself: `setRepeating` will schedule the first alarm for **exactly** every fifteen minutes; `setInexactRepeating` will schedule the second alarm for **approximately** every 24 hours, meaning it might deviate from that interval - with the advantage of consuming less power.

Do notice that this has changed in API 19, where these two calls are synonymous. See [this guide](http://developer.android.com/training/scheduling/alarms.html), and [this API documentation](http://developer.android.com/reference/android/app/AlarmManager.html).
**setRepeating is more accurate** and **setInexactRepeating is for saving battery but no accurate** , setInexactRepeating is good for maintenance in background for example and setRepeating is necessary for example for alarm clock .