Android Question Simple alarm clock

Sergey_New

Well-Known Member
Licensed User
Longtime User
Please help me create an alarm clock that goes off once a day at a set time, for example at 9:00. When triggered, a notification should appear. API 29+. I did not find any suitable examples.
Maybe I asked the question incorrectly, but in other words, I do not need an alarm clock, but I need the application to notify at the right time about the time that has come.
This is what I have come to. Now I need the notification to come not when I press a button, but when the required time is reached.
 

Attachments

  • NB6_B4A.zip
    13.2 KB · Views: 3
Last edited:

Alex_197

Well-Known Member
Licensed User
Longtime User
Please help me create an alarm clock that goes off once a day at a set time, for example at 9:00. When triggered, a notification should appear. API 29+. I did not find any suitable examples.
Maybe I asked the question incorrectly, but in other words, I do not need an alarm clock, but I need the application to notify at the right time about the time that has come.
This is what I have come to. Now I need the notification to come not when I press a button, but when the required time is reached.
check this https://www.b4x.com/android/forum/threads/setting-alarm-for-a-specific-time.71167/
 
Upvote 0

Sergey_New

Well-Known Member
Licensed User
Longtime User
check this
Where should I place this code in my example?
B4X:
Dim i As Intent
   i.Initialize("android.intent.action.SET_ALARM", "")
   i.PutExtra("android.intent.extra.alarm.HOUR", 16)
   i.PutExtra("android.intent.extra.alarm.MINUTES", 58)
   i.PutExtra("android.intent.extra.alarm.SKIP_UI", False)
  StartActivity(i)
 
Upvote 0

Alex_197

Well-Known Member
Licensed User
Longtime User
Where should I place this code in my example?
B4X:
Dim i As Intent
   i.Initialize("android.intent.action.SET_ALARM", "")
   i.PutExtra("android.intent.extra.alarm.HOUR", 16)
   i.PutExtra("android.intent.extra.alarm.MINUTES", 58)
   i.PutExtra("android.intent.extra.alarm.SKIP_UI", False)
  StartActivity(i)
I think that you can use some button like Set the Alarm and put it on button click.
 
Upvote 0
Top