Android Question Receiver - Set a repeating alarm

Alexander Stolte

Expert
Licensed User
Longtime User
Hello,

I come from the following thread:

"Worth reading: https://developer.android.com/training/scheduling/alarms"
I took Erel's words to heart and read through the article and found the following:

From the article:
"Repeating alarms allow the system to notify your app on a recurring schedule.

A poorly-designed alarm can cause battery drain and put a significant load on servers. For this reason, on Android 4.4 (API level 19) and higher, all repeating alarms are inexact alarms.

A repeating alarm has the following characteristics:

  • An alarm type. For more discussion, see Choose an alarm type.
  • A trigger time. If the trigger time you specify is in the past, the alarm triggers immediately.
  • The alarm's interval. For example, once a day, every hour, or every 5 minutes.
  • A pending intent that fires when the alarm is triggered. When you set a second alarm that uses the same pending intent, it replaces the original alarm."

How can I implement the whole thing in B4A with receivers, to start a receiver every day at 10 o clock?
 

asales

Expert
Licensed User
Longtime User
Here is my example using services.
It works fine in my apps, but with some issues, as I said in this post.
And will be changed in Android 14:
You can change to receiver using this code.
 

Attachments

  • schedulingtest.zip
    10.4 KB · Views: 207
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…