Android Question timer that is triggered every day at e.g. 23 uhr.

FrankDev

Active Member
Licensed User
Longtime User
hello people

how can I best set a timer that is triggered every day at e.g. 23 uhr.

Best regards
and a nice weekend
 

DonManfred

Expert
Licensed User
Longtime User
how can I best set a timer that is triggered every day at e.g. 23 uhr.
if you want to use a TIMER then you have to run the app 24/7 using a foregroundservice.

Use StartServiceAtExact and let a service run at the specified time.
Note that will be not exact this time on higher androids.

Do NOT use the Starterservice for this.
 
Upvote 1

FrankDev

Active Member
Licensed User
Longtime User
the app is always active and in the foreground.
and always 'on

AddPermission(android.permission.WAKE_LOCK)

if i then start the app with
StartServiceAtExact

that I must also always somehow reset the date ?
 
Upvote 0

FrankDev

Active Member
Licensed User
Longtime User
hi DonManfred

i have the whole thing at an access control
when people log in i could attach it to this process

that is always called with the same data (regarding time and date). (e.g. that the job is called today at 23 o'clock)

it will be overwritten again and again and will be called only once ?
 
Upvote 0
Top