Triratana Sampatanukul

unread,
Dec 21, 2017, 7:49:29 PM12/21/17
to MIT App Inventor Forum
Hello
I am working on a project that is able to set the alarm an updates message which occurs when an alarm is triggered each time player enter new text. For example, if a user set alarm with the message "Buy computer at 9 AM" then he closed the app. Later, he is told to also buy Camera so he has to open the app again then enter "Camera" in textbox and press button whose duty is to check whether there is already an alarm at that time(9AM). If there is already one it will delete previous alarm and set new alarm at the same time with message "Buy computer and camera at 9AM". If not, It will just set the alarm with the same message.

Is there any way to accomplish this?
Thank you!
PS: Sorry for my bad English.


Taifun

unread,
Dec 21, 2017, 8:28:36 PM12/21/17
to MIT App Inventor Forum

have you seen the alarm extension?

http://puravidaapps.com/alarm.php


to cancel an alarm is currently not possible as extension, because the max. API Level we can use currently is API Level 22. cancel is available starting from API Level 24, see also https://developer.android.com/reference/android/app/AlarmManager.html#cancel(android.app.AlarmManager.OnAlarmListener)

you might want to use the activity starter to open the default alarm app for the user to cancel an alarm...


Taifun

Triratana Sampatanukul

unread,
Dec 21, 2017, 10:25:05 PM12/21/17
to mitappinv...@googlegroups.com
Thank you very much Taifun. I am using your Alarm extension. It's very cool. I will take a look at activity starter soon but now I want to know how use your "Setting" extension to set Alarm ringtone for users that don't have SD card?
Thank you!

Taifun

unread,
Dec 22, 2017, 7:30:43 AM12/22/17
to MIT App Inventor Forum
you don't need an external sdcard to set a ringtone
you might want to try the example app
Taifun
PS: for completely new questions, please start a new thread next time, thank you.

Triratana Sampatanukul

unread,
Dec 22, 2017, 10:36:12 AM12/22/17
to mitappinv...@googlegroups.com
Thank you very much Taifun and sorry for my mistake about posting. But I asked that question because I had read your extension page already and it states that sound files must be on SD card in the mp3 format. At first, I didn't really understand why it is like that so I tried using your example app by downloading apk from Ringtone test.aia project provided on that page and opened your app and set my alarm ringtone to car alarm then pressed Get button to make sure that car alarm was set as my alarm ringtone then I open default alarm clock app and set the alarm 1 minute after. The result was that my alarm ringtone wasn't set to the one that I selected in the app. 

My thought is that I need to change the destination directory for copying to the one that default alarm clock use? But I am not sure because Get ringtone procedure returns value according to what I had set to so the directory used for storing ringtone might be correct already.
How can I get this to work?
I apologize you if I missed something due to my limited knowledge of both English and android.
Thank you in advance.


Taifun

unread,
Dec 22, 2017, 10:50:09 AM12/22/17
to MIT App Inventor Forum
I now edit the documentation and replaced "sdcard" by "internal sdcard"
when we talk about the sdcard, usually we always talk about the internal sdcard ... App Inventor components only can access files on the internal sdcard...

to set the ringtone in the example app, you have to click the Set ringtone button

Taifun

Triratana Sampatanukul

unread,
Dec 22, 2017, 11:41:02 AM12/22/17
to mitappinv...@googlegroups.com
Thank you for clarification Taifun.
 I had already pressed Set ringtone but it didn't work which I just find out that it is because my phone normally uses sound called "Neon" as the alarm sound. If I change that to the default sound my current and future alarm will use the default sound instead which can be set by your extension. But the problem is that how can I make sure all users are currently using default alarm sound which is unlikely(at least for me) because when I get a new phone I will play with it by adjusting many setting like ringtone sound, notification sound and alarm sound to be anything I like which normally isn't the default one..
Thank you in advance.

Taifun

unread,
Dec 22, 2017, 1:02:12 PM12/22/17
to MIT App Inventor Forum
the extension can set any ringtone independent of any default ringtone, which might have been previously set

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

Taifun

Trying to push the limits of App Inventor! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun. 



Triratana Sampatanukul

unread,
Dec 22, 2017, 7:46:52 PM12/22/17
to MIT App Inventor Forum
I am using your app provided on documentation page, not mine.
Maybe you can understand what the problem is by watching this video.
Thank you.

Taifun

unread,
Dec 23, 2017, 12:16:21 PM12/23/17
to MIT App Inventor Forum
which device and Android version are you using for your tests?
Taifun

Triratana Sampatanukul

unread,
Dec 23, 2017, 8:03:00 PM12/23/17
to MIT App Inventor Forum
I am using Nokia 5 with Android 7.1.1.

Triratana

Taifun

unread,
Dec 24, 2017, 5:53:56 AM12/24/17
to mitappinv...@googlegroups.com
ok so after watching the video you are saying: getting and setting a ringtone using the extension works fine, but after setting another ringtone in the default alarm app the extension does not refresh and still displays the old previously set ringtone

I will add this into the notes of the extension and probably will look into fixing this later one day if I find some time

as workaround close the example app, open it again and the correct ringtone should be displayed

Taifun

Reply all
Reply to author
Forward
0 new messages