Hello im trying to make a simple fully working alarm clock but im stuck on making proper alarms... what i dont understand is this :
https://developer.android.com/training/scheduling/alarms.html
// Set the alarm to start at 8:30 a.m.
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());
calendar.set(Calendar.HOUR_OF_DAY, 8);
calendar.set(Calendar.MINUTE, 30);
// setRepeating() lets you specify a precise custom interval--in this case,
// 20 minutes.
alarmMgr.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),
1000 * 60 * 20, alarmIntent);
we set current time in milis to the calendar so if we get time in milis it will fire right now what is the purpose of setting current time in milis and then assigning the hour and minute ?
set time in milis sets the ammount of miliseconds from the year 1970 until now ?
calendar get time in milis returns the amount of milis since the hour we set? or ? i dont understand these lines at all, why do we set current time in millis and then set hour to fire?
EDIT - if i set alarm to trigger at 10:00 and its 10:05 what should i do ? it fires imediately........