-2

Is the main class JobScheduler? Most things i've read about JobScheduler are about setting up jobs in the future, but those jobs they talk about are like for wifi downloads or something. Would this be the same case for an alarm clock app?

What classes / components do I need to build an alarm clock android app?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
albert kim
  • 333
  • 2
  • 14
  • **1** - AlarmManager. **2** - (optional) BroadCastReceiver. See the [official docs](http://developer.android.com/training/scheduling/alarms.html) – Phantômaxx Jan 23 '16 at 23:53

2 Answers2

0

I think you should use

android.provider.AlarmClock

It requeres permission

com.android.alarm.permission.SET_ALARM

Take a look at this answer:

How to set Alarm using alarm clock class

Community
  • 1
  • 1
Flávio Filho
  • 475
  • 4
  • 14
0

Refer to Android Alarms:

Alarms (based on the AlarmManager class) give you a way to perform time-based operations outside the lifetime of your application.

So

  • AlarmManager is a class in Android which is used access device alarm service.

You have to istantiate an alarm:

AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);

Set alarm:

alarmManager.set(int type, long triggerAtMillis, PendingIntent operation)

Then you instantiate an Intent broadcast in other classes to be notified of an alarm, and more , I suggest you read the guide above them, or see this: Alarm Example.

Michele Lacorte
  • 5,323
  • 7
  • 32
  • 54