I made three apps, which I now want to ship in one apk file (one installation). On startup of the "wrapper app" the user should decide which app to run.
So far, so good, but the problem is, each app is using global constants from an Application file. Is there a way to build the three apps into one, where each app uses its own application file?
Thanks!
To avoid confusion i add a short example:
App 1:
public class AApplication extends Application {
public static String CONSTANT_1 = "aaa";
}
App 2:
public class BApplication extends Application {
public static String CONSTANT_1 = "bbb";
}
App 3:
public class CApplication extends Application {
public static String CONSTANT_1 = "ccc";
}
Ok, since the idea I head is obviously not realizable I came up with the following workaround:
I created an Apllication class in the new Project
public class NewApplication extends OldSuperApplication {}
I added a method
public static void setApplication(RGCApplication a) {
CONSTANT_1 = a.CONSTANT_1;
...
}
after selecting the desired "sub-app" on the startscreen in this case application "A" i call
NewApplication.setApplication(new AApplication());
or
NewApplication.setApplication(new BApplication());
I'm not sure if this is smelly coding or not, but it works!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With