Code example for AlarmManager

Methods: setInexactRepeating

0
		// Start 30 seconds after boot completed 
		cal.add(Calendar.SECOND, 30);
		// 
		// Fetch every 30 seconds 
		// InexactRepeating allows Android to optimize the energy consumption 
		service.setInexactRepeating(AlarmManager.RTC_WAKEUP,
				cal.getTimeInMillis(), REPEAT_TIME, pending);
 
		// service.setRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), 
		// REPEAT_TIME, pending); 
 
	} 
}