Android Question StartServiceAt every 0.5 seconds

ranba790

Member
Licensed User
Longtime User
Hi
I used StartServiceAt every 0.5 seconds (StartServiceAt ( "" ,DateTime.Now+500,True)) to read results from a connected IOIO board. This used to work fine in the past.
When running it today on a newer android the service restart every ~5 seconds. setting the service restart at values over 5000(5 seconds )works good but any value lower then 5000 is being ignore
Any way to make the software start the service every 0.5 seconds
Thanks
 

ranba790

Member
Licensed User
Longtime User
You shouldn't use StartServiceAt for such short intervals. Use a regular timer instead and a foreground service to prevent Android from killing the process.
Hi
Any issues using sleep(500) in the service?
Thanks
 
Upvote 0

MaFu

Well-Known Member
Licensed User
Longtime User
Please start a new thread for any new question.

Post more details in the new htread. Did you got any error?
???
No need for a new thread in this case (imho). It's not a new question but rather belongs to Erel's answer and the same subject.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…