R ranba790 Member Licensed User Longtime User Aug 5, 2021 #1 I need to run logic reading values from a Bluetooth IOIO board every 200 msec. In the past, I have used successfully in the sub Service_Start B4X: Copy StartServiceAt ( "" ,DateTime.Now+200,True) with the newer android version, I am getting a reading every couple of seconds instead of msec Is there an issue replacing the StartServiceAt with sleep(200) in the Service_Start sub and never exit the sub till the program is terminated? for example B4X: Copy Sub Service_Start (StartingIntent As Intent) Do While ShutDown=False Connection_Maneger Process_Reading Sleep(200) Loop CancelScheduledService("") StopService("") Notification1.Cancel(1) ExitApplication End Sub thanks
I need to run logic reading values from a Bluetooth IOIO board every 200 msec. In the past, I have used successfully in the sub Service_Start B4X: Copy StartServiceAt ( "" ,DateTime.Now+200,True) with the newer android version, I am getting a reading every couple of seconds instead of msec Is there an issue replacing the StartServiceAt with sleep(200) in the Service_Start sub and never exit the sub till the program is terminated? for example B4X: Copy Sub Service_Start (StartingIntent As Intent) Do While ShutDown=False Connection_Maneger Process_Reading Sleep(200) Loop CancelScheduledService("") StopService("") Notification1.Cancel(1) ExitApplication End Sub thanks
Erel B4X founder Staff member Licensed User Longtime User Aug 6, 2021 #3 ranba790 said: Is there an issue replacing the StartServiceAt with sleep(200) in the Service_Start sub and never exit the sub till the program is terminated? Click to expand... No. And it will behave exactly like a timer. Upvote 0
ranba790 said: Is there an issue replacing the StartServiceAt with sleep(200) in the Service_Start sub and never exit the sub till the program is terminated? Click to expand... No. And it will behave exactly like a timer.