termux / termux-api

Termux add-on app which exposes device functionality as API to command line programs.
https://f-droid.org/en/packages/com.termux.api/
2.24k stars 449 forks source link

AlarmClock: ability to list/search/show/set/delete/edit alarms on the default clock app #390

Open iwconfig opened 3 years ago

iwconfig commented 3 years ago

Feature description

I very much need and want the ability to list/search/show/set/delete/edit alarms on the default clock app.

My work schedule varies greatly each day so I want to automate my alarm clock with greater control. While I know some other ways to accomplish this, I prefer Termux as much as possible and in my case Termux would also be the best tool for the job.

Automate, Tasker and the like does not seem to support a lot of what you can get out of the AlarmClock provider, only setting a new alarm. Additional plugins for these with calendar support and whatnot are quite hackish, depending on your needs.

This requires the permission com.android.alarm.permission.SET_ALARM.

Reference implementation

I'm no android developer, but the Android API seem to support this

Java example taken from here:

  Intent openClockIntent = new Intent(AlarmClock.ACTION_SET_ALARM);
  openClockIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  openClockIntent.putExtra(AlarmClock.EXTRA_HOUR, 10);
  context.startActivity(openClockIntent);
justpeanuts commented 1 year ago

Comment to support the feature request.