Android Question timer and service module

bgsoft

Well-Known Member
Licensed User
Longtime User
Hi

I've seen some post that suggests not put a timer on a Service Module.

In the application of Android "Kiosk mode" tutorial a timer is used in the Service Module. ( https://www.b4x.com/android/forum/threads/android-kiosk-mode-tutorial.10839/ )

I have to make a "kiosk mode" application, 24 hours run, it is advisable to put a timer of 500 milliseconds in the service module? Or is it better to use the StartServiceAt

regards
 

tigrot

Well-Known Member
Licensed User
Longtime User
I put timers in services, since I'm sure that the event is fired when It's need. I have a small APP to serve incoming SMS and store in DB. It have been running for months with no problem. But I built the logic on a service, so it can work also in background.
 
Upvote 0

bgsoft

Well-Known Member
Licensed User
Longtime User
And no problems with Android kill the service and the timer stops working?
 
Upvote 0

bgsoft

Well-Known Member
Licensed User
Longtime User
Thanks for your answers

Services are made to be reliable. So what's the problem with "StartServiceAt"? Add a "#StartAtBoot" so nothing can go wrong (even if the device reboots).
Yes I already know that.
But I have read some very expert people post, they recommend not put a timer on a service module.
And seeing one in the application of the kiosk, I thought maybe something has changed in B4A and no longer give problems
 
Upvote 0

bgsoft

Well-Known Member
Licensed User
Longtime User
Thanks for the clarification Erel
 
Upvote 0

swamisantosh

Member
Licensed User
Longtime User
I put timers in services, since I'm sure that the event is fired when It's need. I have a small APP to serve incoming SMS and store in DB. It have been running for months with no problem. But I built the logic on a service, so it can work also in background.

I looking for code to read incoming SMS and store in DB
 
Upvote 0

tigrot

Well-Known Member
Licensed User
Longtime User
Be aware that the OS of a kiosk must be able to run ininterrupted for months. I have been writing them on XP platforms about 10 years ago. They were reliable but once or twice every year they were unresponsible. I had to produce an external watchdog to reset the malfunctioning hardware. I don't know if Android hardware/OS is worth of such use... How many times a month do you need to reset your smartphone?
 
Upvote 0
Top