Answer the question
In order to leave comments, you need to log in
Running dependent tasks?
Beaver to all, Androidovody!
Tell me, please, is it possible in Android without having a root to launch dependent tasks?
Example: by clicking one shortcut, I want to launch program A first, when it runs, program B, and when it runs, close both two.
Something like scripts.
Is this feasible? An important point - without rutting the machine.
As a bonus, if you can’t do without rooting, then to hell with it, tell me how to proceed in this case?
In an unattainable ideal, I have the following sequence:
- press the shortcut
- turn on GPS
- run a program that quickly determines satellites (A-GPS)
- run a program that determines the coordinates and writes them and some more information to a specialized database (third-party, purchased craft that you can’t refuse. Integrators-s..)
- turn off both programs
- turn off GPS
- give a signal to the user
Answer the question
In order to leave comments, you need to log in
It seems to me that the solution is in the form of a separate utility, which inside itself launches the necessary activities one by one.
BUT
In stock Android firmware (even rooted) not everything can be done automatically. For example, On/Off GPS is not programmatically possible, you can only show the user the settings window. Here there will be a hitch.
This is how to launch the application "from within" your application:
Intent i = new Intent(Intent.ACTION_MAIN);
PackageManager manager = getPackageManager();
i = manager.getLaunchIntentForPackage("app package name");
i.addCategory(Intent.CATEGORY_LAUNCHER);
startActivity(i);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question