Alarm manager In android SDK
<pre><code>private static final int HELLO_ID = 0;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Date dat  = new Date();//initializes to now
        Calendar cal_alarm = Calendar.getInstance();
        Calendar cal_now = Calendar.getInstance();
        cal_now.setTime(dat);
        cal_alarm.setTime(dat);
        cal_alarm.set(Calendar.MONTH,3);
        cal_alarm.set(Calendar.YEAR,2012);
        cal_alarm.set(Calendar.DAY_OF_MONTH,4);
        cal_alarm.set(Calendar.HOUR_OF_DAY,19);//set the alarm time
        cal_alarm.set(Calendar.MINUTE, 15);
        cal_alarm.set(Calendar.SECOND,0);


        if(cal_alarm.before(cal_now)){//if its in the past increment
            cal_alarm.add(Calendar.DATE,1);
        }

        Intent intent = new Intent(AlarmManagerTestActivity.this,
                AlarmReceiver.class);
        PendingIntent pendingIntent = PendingIntent.getBroadcast(
                AlarmManagerTestActivity.this, 0, intent, 0);
        AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);

        alarmManager.set(AlarmManager.RTC_WAKEUP, cal_alarm.getTimeInMillis(), pendingIntent);  
    }
</code></pre>

<p>Hello,I want to set alarm and notification on specific date,i am using code given here but i am unable to set alarm on specifc date.Please let me know what is the mistake here.</p>

<p>Thanks in advance
Trapti</p>
