M
M
mittel2012-10-02 14:39:09
satellite navigation
mittel, 2012-10-02 14:39:09

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

2 answer(s)
S
solo12zw74, 2012-10-02
@solo12zw74

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.

S
solo12zw74, 2012-10-02
@solo12zw74

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);

where "app package name" is the fully qualified package name of the application. It can be obtained from the AndroidManifest.xml file. Or maybe something else.
Accordingly, you can run several applications "from within" your application.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question