public Alarm saveAlarm(int month,int date,int hour,int minute){
  Alarm alarm=new Alarm();
  alarm.id=SECURE_RANDOM.nextInt();
  alarm.month=month;
  alarm.date=date;
  alarm.hour=hour;
  alarm.minute=minute;
  SharedPreferences.Editor editor=mSharedPreferences.edit();
  editor.putString(String.valueOf(alarm.id),alarm.toJson());
  editor.apply();
  return alarm;
}

public Alarm saveAlarm ( int month , int date , int hour , int minute ) { Alarm alarm = new Alarm ( ) ; alarm . id = SECURE_RANDOM . nextInt ( ) ; alarm . month = month ; alarm . date = date ; alarm . hour = hour ; alarm . minute = minute ; SharedPreferences . Editor editor = mSharedPreferences . edit ( ) ; editor . putString ( String . valueOf ( alarm . id ) , alarm . toJson ( ) ) ; editor . apply ( ) ; return alarm ; }
stores an alarm in the sharedpreferences .
