I need to make a simple alarm app for class but every thing I looked at uses extensions that I don’t want to pay for so how would I do it if it’s just a time picker and a button to start it
Anyone?
**
**
Using a FREE extension:
Using a counter
This is a way to set an alarm for demonstration purposes.
Use a Clock component
Use the Clock to set the time to go off. Keep it running in incrementing by using the Clock.Timer event handler to play an mp3 alarm sound (using Player)
Your alarm will stop working if you use only the native Blocks when your screen turns off. Two ways to prevent the Screen closing without using a Foreground or Background method (which requires an extension) :
Stay Awake block routine using a Notifier
or you use Taifun’s Tools Extension: https://puravidaapps.com/tools.php
[
Using either an extension or a block routine drains your device battery rapidly . These work around methods are not running the app in the Background, they force the app
screen to stay open .
Try some Blocks and if you have issues, post what you have done here and someone will provide specific advice.
So by just using the clock and no other extensions the alarm will work as long as the app is running correct?
Not quite that simple, but almost You have to keep the screen from going off,
You need the clock component and a TImePicker to set the time to trigger the alarm at a specific time (or hard code the alarm time). You need an mp3 to make the alarm set off at the time you choose for the app to provide an alarm sound or use the Sound vibrate to announce the alarm when the alarm time is reached.
Can you show me what the code might look like for that
let me look; I have some code but not on this PC.
What about
Taifun
I’m about to crash out I don’t want and extension just show me how to do it without I don’t care about the drawbacks
This post was flagged by the community and is temporarily hidden.
This post was flagged by the community and is temporarily hidden.
Hi @MarwanA191, you should not spam the community, please be patient and await for their reply. Keep the topic clean.
This is due by today
will open the alarms view in your device, from there you can set an alarm, manually.
This is probably what you want:
but it will fail, because you would need to set a permission in the manifest.xml of your app after you have built it - build app, decompile, edit manifest, rebuild app.
Permission required:
com.android.alarm.permission.SET_ALARM
If this is homework, then after many months of learning programming, you certainly already have some skills. So show what you have tried, show your blocks.
I suspect that this is not supposed to be a typical system alarm, but something like a timer that counts down, for example, 5 minutes and makes a sound after 5 minutes? Something like a timer for boiling eggs .
I am on my phone now so I can not do blocks..
Here's the simple way for class
Screen1.intialize
Set clock1.Enabled to false
Set Textbox1.Text to 10
Button1.Click
Set Textbox1.Text to 10
Set Clock1.Enabled to true
Clock1.Timer
If Textbox1.Text. > 0 then
Set Textbox1.Text to Textbox1.Text - 1
Else
Set textbox1.text to 'Boom!'
Set Clock1.Enabled to false
Oh my, what did you try?
This example shows the concept of an alarm. The audible alarm rings for 15 seconds. The alarm is also a red button 'flag' that stays lit for 15 seconds. You need to supply your own alarm mp3 file and put it into Media. There isn't any code to force the Screen to stay on; you'll have to code that to keep the Screen on (keep it from closing). The app only has one alarm setting which can be reset manually.
Notice that the TimePicker is not used; instead I made my own picker (Button2 and the two textboxes) for the 24 hour clock time system. Using military time makes the alarm simple to code by eliminating the need for AM/PM.
There is no documentation; the example is not a tutorial.
There are lots of other ways of coding a simple alarm.
Here's my blocks, with just a Button and a Clock from the Sensors Drawer.
What do you mean by just a button how would that even work