Running an Application after boot

redrocks

Member
Licensed User
Longtime User
Hi,

I want to start my Basic4Android application just after booting my tablet to run automatically without user intervention. Can someone give some indication to do it, maybe using a service?
 

pappicio

Active Member
Licensed User
Longtime User
Hi,

I want to start my Basic4Android application just after booting my tablet to run automatically without user intervention. Can someone give some indication to do it, maybe using a service?

use a service that "start at boot" to open your apk when you restart device!

like this:

B4X:
'Service module
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
   StartActivity(main)
   StopService("")
End Sub

Sub Service_Destroy

End Sub
 
Upvote 0

redrocks

Member
Licensed User
Longtime User
It works!
The reason for doing this is that the tablet will be dedicated to this application so it is better to go directly to the running application for the user.

Thank you very much for your prompt reply.:sign0098:
 
Upvote 0

Steve

Member
Licensed User
Longtime User
On a similar note, is it possible to make the service boot preference adjustable by the user? Or am I better off setting a flag, always starting the service, and killing it immediately if the user doesn't want it to start with the device? This approach seems wasteful, but I can certainly go that route if it's the best option for now.

Thanks,
Steve
 
Upvote 0
Top