Skip to content Skip to sidebar Skip to footer

Multiple Application Files In One Android App

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 pr

Solution 1:

Ok, since the idea I head is obviously not realizable I came up with the following workaround:

  1. I created an Apllication class in the new Project

    publicclassNewApplicationextendsOldSuperApplication {}
    
  2. I added a method

    publicstaticvoidsetApplication(RGCApplication a) {
        CONSTANT_1 = a.CONSTANT_1;
        ...
    } 
    
  3. after selecting the desired "sub-app" on the startscreen in this case application "A" i call

    NewApplication.setApplication(newAApplication());
    

    or

    NewApplication.setApplication(newBApplication());
    

I'm not sure if this is smelly coding or not, but it works!

Solution 2:

Probably you want three activity that can be launched. Add in the manifest something like this:

<activityandroid:name=".Activityone"android:label="First Activity" ><intent-filter><actionandroid:name="android.intent.action.MAIN" /><categoryandroid:name="android.intent.category.LAUNCHER" /></intent-filter></activity><activityandroid:name=".Activitysecond"android:label="Second Activity" ><intent-filter><actionandroid:name="android.intent.action.MAIN" /><categoryandroid:name="android.intent.category.LAUNCHER" /></intent-filter></activity><activityandroid:name=".Activitythree"android:label="Third Activity" ><intent-filter><actionandroid:name="android.intent.action.MAIN" /><categoryandroid:name="android.intent.category.LAUNCHER" /></intent-filter></activity>

In this way user has three icons (activity) to click.

Solution 3:

You can not integrate 3 different apk and its respective code-base to run by single apk, either integrate all 3 code-base in single application and divide all 3 as different modules to run depending upon selection by user.

Post a Comment for "Multiple Application Files In One Android App"