title: Android schedule a task 4 times per hour
body: <p>I need to run a task to collect some data 4 times per hour. I guess best way to do it is using AlarmManager. I managed to get following code working and it runs for every 10 sec.</p>
  
  <pre><code>AlarmManager manager = (AlarmManager)getSystemService(Context.ALARM_SERVICE);
  int interval = 10000;
  
  Intent alarmIntent = new Intent(this, AlarmReceiver.class);
  PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, alarmIntent, 0);
  manager.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(), interval, pendingIntent);
  Toast.makeText(this, "Alarm Set", Toast.LENGTH_SHORT).show();
  </code></pre>
  
  <p>But I want my task to run 4 times per hour. Exactly at XX.00, XX.15, XX.30, XX.45. This is to generate some data graphs.</p>
  
  <p>Can somebody tell me how to archive this? Should I use Calendar class? I could not find any clear method.</p>
  
  <p>Thanks!</p>