After having published a first extension and after what was commented by the leading users, about what had to change in the extension, I published it again with the recommended changes.
The extension now complies with the nomeclature instructions indicated in
I also try to adapt it to what is indicated in
- Is it novel? Has your type of extension been done before by other extension developers. Do we really need it again? What is different/unique about it, when compared with the other similar extensions?
Although there is already an alarm extension (that I know of), this is paid, and the one I publish is free and also adds the source code for it.
- Can the features or methods of the extension be completed with the built-in blocks and components of AppInventor? If so, there is any real need for an extension to do the same thing. There may be exceptions to this rule, where the compilation of the blocks is long and complex, and can be replaced with a simple method. A good example of this might be Saj's List Bubble Sort & Shuffle Methods 29 method (blocks) and Hossein's List Utils 21 (extension)
The extension only does what cannot be done with the App Inventor components, so the .aia file that accompanies it is almost as important as the extension.
What does the extension do?
- Create exact alarms in time.
- Delete alarms already created.
- Guarantees permissions for Android versions 14 or higher
- Notifies us when an alarm has occurred
- We can choose when the alarm occurs, open the application or present us with a notification
- You can open the device's default alarm sound and close it.
- Alarms recover when you turn off or restart the device
Special configuration for Xiaomi devices
What to do with the .aia file
- An alarm manager is created, creating a database with the alarms created or deleted.
- Create simple alarms (time specified in seconds)
- Create alarms at a given time and date
- Create snooze alarms with a given hour and minutes and a day of the week
- Every time the activity starts, all pending alarms are regenerated
I now explain the different blocks of the extension
CreateAlarm(void)
Create an exact alarm at the indicated time, the "delay" must be specified in milliseconds and the "request" is a number that identifies the alarm.
CancelAlarm(void)
Delete an alarm, with the "request" that we have previously assigned to it.
CheckPermission (boolean)
For Android versions 14 or higher, check that the SCHEDULE_EXACT_ALARM permission is granted
StartAlarmMusic and StopAlarmMusic (void)
You can open the device's default alarm sound and close it.
AlarmNow (boolean)
Indicates that the alarm has occurred
NotificationTitle (String)
You can assign a title to the alarm notification
OpenScreen (boolean)
If the value is true, when the alarm occurs, the activity will be opened, if false, a notification will be opened
In future posts I will detail and explain the .aia file
es.mariosoft.Alarm.aix (19,0 KB)
Alarmar.aia (124,6 KB)
AlarmSource.zip.txt (5,5 KB)
Un Saludo