Nizze Active Member Licensed User Longtime User Apr 9, 2019 #1 Hi all I have been playing with Erels Websocket push . And i have noticed som difference in what phones i use. When i use my newest Huawei P20 ( android 8.0.0) everything works as expected. But on another device running Android 7.1.2 it does not work the same way . The problem is the service module the stops working . I have in the service module : Code: #Region Service Attributes #StartAtBoot: true #StartCommandReturnValue: android.app.Service.START_STICKY #End Region And i have been trying different : Service.XXXX in Service_Start If i use : Code: StartServiceAt(Me, DateTime.Now + 2 * DateTime.TicksPerMinute, False) Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_ALWAYS 'Service.StartForeground(0,Null) Then it seems to work okey , but i get a notificaton sound everytime the services is restarted. wich is enoying . Can u disable that sound ? Or is there another way to keep the service alive ?
Hi all I have been playing with Erels Websocket push . And i have noticed som difference in what phones i use. When i use my newest Huawei P20 ( android 8.0.0) everything works as expected. But on another device running Android 7.1.2 it does not work the same way . The problem is the service module the stops working . I have in the service module : Code: #Region Service Attributes #StartAtBoot: true #StartCommandReturnValue: android.app.Service.START_STICKY #End Region And i have been trying different : Service.XXXX in Service_Start If i use : Code: StartServiceAt(Me, DateTime.Now + 2 * DateTime.TicksPerMinute, False) Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_ALWAYS 'Service.StartForeground(0,Null) Then it seems to work okey , but i get a notificaton sound everytime the services is restarted. wich is enoying . Can u disable that sound ? Or is there another way to keep the service alive ?
DonManfred Expert Licensed User Longtime User Apr 9, 2019 #2 Example of a long running task https://www.b4x.com/android/forum/threads/background-location-tracking.99873/ Upvote 0
Example of a long running task https://www.b4x.com/android/forum/threads/background-location-tracking.99873/
Nizze Active Member Licensed User Longtime User Apr 9, 2019 #3 DonManfred said: Example of a long running task https://www.b4x.com/android/forum/threads/background-location-tracking.99873/ Click to expand... I took some of the code into my prolject and so far so god . Thanks for helping out DonManfred !! // Br Nizze Upvote 0
DonManfred said: Example of a long running task https://www.b4x.com/android/forum/threads/background-location-tracking.99873/ Click to expand... I took some of the code into my prolject and so far so god . Thanks for helping out DonManfred !! // Br Nizze