Android Question About StartServiceAt

jkhazraji

Active Member
Licensed User
Longtime User
in a code line like the following:
B4X:
    StartServiceAt("", DateTime.Now + 1000, True) 'will start after one seconds.
can this lead to overloading of the device processor or memory since it calls the service every single second even during sleep?
 

jkhazraji

Active Member
Licensed User
Longtime User
Thanks..Is it necessary to start the service from the "Main" module or the "Starter" service before calling Service.StartForeground or it will start automatically ?

B4X:
Sub Process_Globals
      Dim n AsNotification
End Sub
Sub Service_Create
       n.Initialize
       .
       .
       .
       n.SetInfo("Title", "Body", Main)
End Sub
Sub Service_Start (StartingIntent AsIntent)
        Service.StartForeground(1, n)
End Sub
NB : Code is taken from another thread
 
Last edited:
Upvote 0
Top