See the App Inventor Extensions document about how to use an App Inventor Extension.
For questions about this extension or bug reports please start a new thread in the
App Inventor community. Thank you.
For feature requests please contact me by email.
To be a sponsor of a new method already is possible starting from only 10 USD! With your contribution you will help the complete App Inventor community. Thank you.
Aug 26th, 2016: Initial Version released
Mrz 31th, 2020: Paid version released, which adds the weekday property for repeating alarms and is able to set a timer
This extension enables you to set an alarm programmatically for devices > API Level 9, Android 3.0 (Honeycomb).
Required permission: com.android.alarm.permission.SET_ALARM
Note: You will have to build the app to be able to test it, because the companion app does not offer the required permission.
Returns whether user interface should be skipped.
Specifies whether user interface should be skipped. Default is true.
Specifies weekdays for repeating alarms. This is a list in csv format with values from 1(SUN) to 7 (SAT).
To use that property, minimum Android API Level is 19 (Android 4.4).
Set alarm.
Set timer-
Event raised after setting the alarm or timer.
Note: you have to build the app to be able to use this method!
Note: you have to build the app to be able to use this method!
Q1: I find it a bit strange that your error messages say something like "hour should be < 24" while you just test for the text field being empty.
A: Yes, you are correct. The better solution is to check for empty string and additionally for hour < 24 and minute < 60.
Q2: How can I set an alarm for some date and some hour and minute?
A: Unfortunately the AlarmClock API does not offer these features, see also
here.
But you can set the weekday for repeating alarms in the paid version of the extension.
You will need min. API Level 19 (Android 4.4) for that.
Q3: Is it possible to cancel an alarm?
A: To cancel an alarm just use the activity starter together with the following blocks (min. API Level is 24), see also
here.
Note: you have to build the app to be able to use this method!
Q4: I tried to test this application on the LDPlayer 4 emulator (Android 7.1) and it did not work?
A: As you found out yourself, this will not work in an emulator.
Q5: If I make an alarm on the basis of this extension, will it activate at the right time, like a usual alarm clock?
A: Yes, see also these questions and answers.
Q6 Does it work in the background?
A: Yes, if you define an alarm at a given time, the alarm will start no matter if your app is open or not.
Q7 This clock is in military time (24hrs). How do I set the alarm time for 12 hours so I can get AM & PM?
A: The hour value for the AlarmClock API expects a value between 0 and 23, see also
here.
You can use 12 hour format inside your app, just convert it into 24h format before calling the Set method, see also this example screenshot
Download the 12 hour example (aia file)
Q8 What is the process for changing the timer from 24 to 12 hour?
A: The timer expects a value in seconds to countdown, for example 120 seconds. There neither is a 24 nor a 12 hour mode.
Q9 Why does my app not open after clicking the alarm notification?
A: the extension uses the alarm clock API,
which is the default alarm clock... there is no connection between your default alarm clock and your app...
If you like to open your app after clicking the notification, try the Alarmmanager extension.
The alarm test app is available in Google Play. You can test the examples following these steps
You can buy this extension (aix file).
With your payment you accept the
terms and conditions below.
Payment options
1.
Please transfer 12 USD via Paypal
to Pura Vida Apps
2.
After having received your payment I will be happy to send the download link to you. Please let me know your Google account!
I usually will send the download link not later than 24 hours after having received your payment.
Thank you! Taifun
The free version offers restricted functionality. See the documentation above about which blocks are available or not.
Developing and maintaining snippets, tutorials and extensions for App Inventor takes a lot of time.
I hope it saved some of your time. If yes, then you might consider to donate a small amount!
or donate some mBTC to Address:
1Jd8kXLHu2Vkuhi15TWHiQm4uE9AGPYxi8
Thank you! Taifun
Download free version of the Alarm extension (aix file)
Download free version of the Alarm Test project (aia file)
Back to top of page ...
This work by Pura Vida Apps
is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License
with attribution (name=Pura Vida Apps and link to the source site) required.