Android Question launch application start-up of the device and launch process in the background

Roberto P.

Well-Known Member
Licensed User
Hi
how can I do that an application starts and activates itself when the device and make sure that in the background launches a procedure for reading data from the server?
Thank You
 

eurojam

Well-Known Member
Licensed User
Ciao Roberto,
a starting point to your question: add a service modul and set the flag "startAtBoot" to TRUE and then call your activity Main
B4X:
#Region  Service Attributes
    #StartAtBoot: true
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub
Sub Service_Create

End Sub

Sub Service_Start (StartingIntent As Intent)
  Log("Start....")
  StartActivity(Main)
End Sub

Sub Service_Destroy

End Sub
Tanti saluti
Stefan
 
Top