I had a massive reading and still I think there is not a clear/complete Answer to this question.
First some stuff to clarify : this question is not concern with batt
You can use setExact similarly to setRepeating.
void scheduleAlarm(Context context) {
AlarmManager alarmMgr = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
Intent yourIntent = new Intent();
//TODO configure your intent
PendingIntent alarmIntent = PendingIntent.getBroadcast(context, MyApplication.ALARM_REQUEST_CODE, yourIntent, PendingIntent.FLAG_UPDATE_CURRENT);
alarmMgr.setExact(AlarmManager.RTC_WAKEUP, timeToWakeUp, alarmIntent);
}
The two differences are:
You will have to schedule the next occurrence in the onReceive of your BroadcastReceiver.
public class AlarmReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
//TODO process alarm
scheduleAlarm(context);
}}