title: How to keep my alarm to be ringing for 1 minute in android?
body: <p>I need to ring my alarm for 1 minute on my application.But it just ringing only for a single second.</p>
  
  <p>Suggestions plz..
  Thanks for your precious time!..</p>
  
  <p>Please find my sources for reference</p>
  
  <p><strong>AndroidAlarmService.java</strong></p>
  
  <pre><code>public class AndroidAlarmService extends Activity {
  
  private PendingIntent pendingIntent;
  private static final int PERIOD=60000; // 1 minute
  
   /** Called when the activity is first created. */
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.main);
  
   Intent myIntent = new Intent(AndroidAlarmService.this, RepeatingAlarm.class);
   pendingIntent = PendingIntent.getBroadcast(AndroidAlarmService.this, 0, myIntent, 0);
  
   AlarmManager aM = (AlarmManager)getSystemService(ALARM_SERVICE);
  
   Calendar c=Calendar.getInstance();
   c.set(Calendar.HOUR, 6);
   c.set(Calendar.MINUTE, 0);
   c.set(Calendar.SECOND, 0);
  
    PendingIntent pi = PendingIntent.getBroadcast(getApplicationContext(), 0, new Intent(getApplicationContext(),AndroidAlarmService.class),PendingIntent.FLAG_UPDATE_CURRENT);
  
  
   aM.setRepeating(AlarmManager.RTC_WAKEUP, c.getTimeInMillis(),PERIOD,pendingIntent);
  
      }
   }
  </code></pre>
  
  <p><strong>RepeatingAlarm.java</strong></p>
  
  <pre><code> public class RepeatingAlarm extends BroadcastReceiver
  {
      @Override
      public void onReceive(Context context, Intent intent)
      {   
          AlarmManager mgr = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
  
          Toast.makeText(context,"Alarm Started.....", Toast.LENGTH_LONG).show();
  
  
          Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
          Ringtone r = RingtoneManager.getRingtone(context, notification);
          r.play();
  
          // Vibrate the mobile phone
          Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
          vibrator.vibrate(500);
  
          }
      }
  </code></pre>