0

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?

MPelletier
  • 16,256
  • 15
  • 86
  • 137
  • 1
    Stackoverflow ain't Google, try to find some links yourself. – Egor Jul 07 '12 at 16:19
  • i have fetch all record from sqlite and set alarm manager and call service but i am not do proper way please give some link or tutorial. – Sandeep Tiwari Jul 07 '12 at 16:24
  • Then post your specific problem... – AAnkit Jul 07 '12 at 16:27
  • please mail me if possible ASAP sandeep15usarauli@gmail.com thanks lot – Sandeep Tiwari Jul 07 '12 at 16:27
  • 2
    Yes y not,, It cost u around 250$ :) – AAnkit Jul 07 '12 at 16:30
  • thanks lot dear I am learner not business men ,I post my question on stackoverflow for help not deal thanks.. I will try myself .. – Sandeep Tiwari Jul 07 '12 at 16:33
  • 1
    I used sarcasm in my first comment, That u should post specific question on SO, not complete requirement, You can break ur requirement into smallest possible steps.. Try it, do some learning/reading .. IF still it is out of ur hand,, then come and post specific problem, Which should include , problem, What u tried, expected output , current output, and logcat error if any.. – AAnkit Jul 07 '12 at 16:39
  • You need to create a BroadcastREceiver class to receive the message when the alarm is triggered off. Check the links that I have posted in my answer below. – Swayam Jul 07 '12 at 16:58

2 Answers2

1

You should post specific question/problem on SO, not complete requirement, follow below steps

1) break ur requirement into smallest possible steps..

2) Try Step by step, do some learning/reading ..

3)IF still it is out of ur hand,, then come and post specific problem,

4)You question on SO should include , problem, What u tried, expected output , current output, and logcat error if any.

AAnkit
  • 27,299
  • 12
  • 60
  • 71
0

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/

Swayam
  • 16,294
  • 14
  • 64
  • 102