user21321
user21321

Reputation: 131

Installing two apps using one apk

I have 2 apps:

1 - ContentProvider;

2 - Application that uses this ContentProvider.

I need to install these 2 apps using single apk file. I want to push these two apps simultaneously, in Eclipse if I add to buildpath of one app another project and add several lines in the manifest.Is it possible to install simultaneously two apps(one of them is ContentProvider) using one apk?

Upvotes: 3

Views: 3193

Answers (3)

Samuel Rajan
Samuel Rajan

Reputation: 9

Yes it's possible to have two apps (internally activities) installed in one api.

Extending to dac2009's answer..

Here is one sample Manifest file that does this.

`<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.dualapp"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="19" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name_people"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.dualapp.MeetPeopleActivity"
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name_people"
            android:taskAffinity="com.example.dualapp.MeetPeopleActivity" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity
            android:name="com.example.dualapp.MeetTechieActivity"
            android:icon="@drawable/ic_tech"
            android:label="@string/app_name_techie"
            android:taskAffinity="com.example.dualapp.MeetTechieActivity" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>

</manifest>`

Installing this puts two app icons in my mobile.

Upvotes: 0

dac2009
dac2009

Reputation: 3561

You may define multiple activitys, services etc in one manifest.xml. So if you were to move both of your applications into one project, and then add them both to the manifest, you can in a way install multiple apps in one apk.

Look here for more info about the manifest: http://developer.android.com/guide/topics/manifest/manifest-intro.html

However, as already pointed out, the application-tag can only occur once.

Upvotes: 2

CommonsWare
CommonsWare

Reputation: 1006674

Is it possible to install simultaneously two apps(one of them is ContentProvider) using one apk?

No, sorry.

Upvotes: 2

Related Questions