title: How to check date from sqlite database?
body: <p>I have sqlite database table which contacts friend and his contacts with date of birth.I want to ring  Alarm when any date match from database with current date.Please Anyone help me How I do this task.
                 Actually I want to Match date 2 time a day daily please suggest me.</p>
  
  <p>I am using this code </p>
  
  <pre><code>private void setAlarm(String name,String date)
  {
      String[] arrdob =date.split("/");
      Calendar cal = Calendar.getInstance();       //for using this you need to import java.util.Calendar;
  
      // add minutes to the calendar object
      cal.set(Calendar.MONTH,Integer.parseInt(arrdob[1]));
      cal.set(Calendar.YEAR, Integer.parseInt(arrdob[2]));                
      cal.set(Calendar.DAY_OF_MONTH,Integer.parseInt(arrdob[0]));
      cal.set(Calendar.HOUR_OF_DAY,14);
      cal.set(Calendar.MINUTE,35);
      System.out.println("1");
  
      Intent alarmintent = new Intent(getApplicationContext(), AlarmReceiver.class);
      alarmintent.putExtra("title","B'Day Alarm");
      alarmintent.putExtra("subject","Hi!Todays "+name+" B'Day");
  
      PendingIntent sender = PendingIntent.getBroadcast(getApplicationContext(), HELLO_ID,
      alarmintent,PendingIntent.FLAG_UPDATE_CURRENT |  Intent.FILL_IN_DATA);
      //VERY IMPORTANT TO SET FLAG_UPDATE_CURRENT... this will send correct extra's informations to 
      //AlarmReceiver Class
     // Get the AlarmManager service               
      AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
      am.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), sender);
  }
  </code></pre>
  
  <p>call this method at when insert value into database.
                                                      AlarmReceiver class is as:</p>
  
  <pre><code>private static int NOTIFICATION_ID = 1;
  
  @Override
  public void onReceive(Context context, Intent intent) //
  {
      // NotificationManager mNotificationManager = 
      System.out.println("2");
     //context.getSystemService(Context.NOTIFICATION_SERVICE);
  
      NotificationManager manger = (NotificationManager)     
      context.getSystemService(Context.NOTIFICATION_SERVICE);
      Notification notification = 
          new Notification(R.drawable.ic_launcher, "Combi Note",System.currentTimeMillis());
      PendingIntent contentIntent = PendingIntent.getActivity(context, 
              NOTIFICATION_ID, 
              new Intent(context, AlarmReceiver.class), 0);
  
      Bundle extras=intent.getExtras();
      String title=extras.getString("title");
   //here we get the title and description of our Notification
      String note=extras.getString("subject");
      notification.setLatestEventInfo(context, note, title, contentIntent);
      notification.flags = Notification.FLAG_INSISTENT;
      notification.defaults |= Notification.DEFAULT_SOUND;
  </code></pre>
  
  <p>//here we set the default sound for our 
  //notification</p>
  
  <pre><code>    // The PendingIntent to launch our activity if the user selects this notification
      manger.notify(NOTIFICATION_ID++, notification);
  }
  </code></pre>