Android Question Autostart vs. User start

ebasic

Member
Licensed User
Longtime User
Hello dear b4ppc communuty

I've got one question.


I wrote an app which is loading some profiles on app start.

I want it to "start, load profile and apply, exit app" after every reboot. Which is working fine.

How do I do the detection IF the app was started by user or on boot_completed ? I hope you can help me and understand my question.

My temporary solution was, upon manual start and loading of profile and exit I allows you to tap the app gui to stop the exiting process.

So basically, the question is: "I want my app to know if it's started upon a BOOT or upon my request(user start).

Thank you very much.
 

DonManfred

Expert
Licensed User
Longtime User
loading profile, app gui....

Are you sure you are talking about Basic4Android???
 
Upvote 0

ebasic

Member
Licensed User
Longtime User
Yeah, everything works fine. Except I want it to load on android boot - load profile - exit (it does that). But it does it also on user start(manually starting app).
 
Upvote 0

ebasic

Member
Licensed User
Longtime User
I actually got this all working.

1. I run the app - the app checks if there is any config file
2. if there is a config file it loads it and exits
3. if there is no config file it keeps the app opened for new settings to be applied
4. on a system reboot the service is started
5. the service starts the main app
6. the app obviously starts, loads the config if available and exits

Now, which I wanted is:

1. if I start the app manually it should not exit, it should know that I(user) have started the app, it should only wait for input, for different settings etc to be applied.

2. if the app(via service) is started on android boot it should do the exactly thing it's doing now.

Maybe I've now explained it more in details. The app also has root access.

Thank you once again
 
Upvote 0

ebasic

Member
Licensed User
Longtime User
To update the thread. I didn't grab too much into the depths but I've fixed it by adding scripts to the "/etc/init.d", the scripts are autoexecuted on android boot.

If the user runs the app it just loads the last result, doesn't have to apply any settings.
 
Upvote 0
Top