I am making an application for Birth Day Alarm. If date saved in SQLite matches the current date, then the Alarm should be started.
Can any one give me some suggestion or any link ?
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
setAlarm();
}
private void setAlarm()
{
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis());
cal.clear();
cal.set(2012,2,8,18,16);
AlarmManager alarmMgr = (AlarmManager)getSystemService(Context.ALARM_SERVICE);
Intent intent = new Intent(this, AlarmReceiver.class);
PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intent, 0);
// cal.add(Calendar.SECOND, 5);
alarmMgr.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), pendingIntent);
}
After this, I do not understand what to do since I am new. Can any one suggest me the process or link?
You should do more research on a topic before posting a problem but well, here are a few links that should solve your problem.
http://justcallmebrian.com/?p=129
http://www.androidcompetencycenter.com/2009/02/android-basics-alarm-service/