Android Question [SOLVED] About Long Running Services...

Magma

Expert
Licensed User
Longtime User
Hi there...

i know that android is not happy for android.app.Service.START_STICKY ... so many apps must change...

Found somewhere a very good example of Erel the MyLocation (https://www.b4x.com/android/forum/threads/99873/#content) that just GPS Tracking..

but all these commands can run at any android version ? for ex. at android 4.1, 4.2 ?

B4X:
Sub Service_Create
    Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_NEVER 'we are handling it ourselves  - THAT Will work at android v4 ?
    lock.PartialLock '- THAT Will work at android v4 ?
End Sub

Sub Service_Start (StartingIntent As Intent)
    Service.StartForeground(nid, CreateNotification("..."))
    StartServiceAt(Me, DateTime.Now + 30 * DateTime.TicksPerMinute, True)
End Sub

Thanks again for answers i ll take :)
 
Last edited:
Top