user4224107
user4224107

Reputation:

how can make multiple project just in an apk file

I would like an Android build system procedure, command line or Eclipse, to generate several .apk files from a single source codebase. Some common reasons for this - having specific versions for markets with different requirements or a free and paid version.

Upvotes: 1

Views: 121

Answers (1)

Vibhor Chopra
Vibhor Chopra

Reputation: 657

Use Activity-alias in manifest file to launch multiple apks from single apk.

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

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

<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<application
    android:allowBackup="true"
    android:icon="@drawable/images"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" android:logo="@drawable/images">
    <activity
        android:name="com.mmx.mccandmnc.MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <!-- Alias activity used to set the wallpaper on Home. The alias is used
         simply to have a different label. -->
    <activity-alias android:name="WallpaperActivity"
        android:targetActivity="LoginActivity"
        android:label="@string/activity_set_wallpaper">
        <intent-filter>
            <action android:name="android.intent.action.SET_WALLPAPER" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity-alias>
</application>

</manifest>

Upvotes: 1

Related Questions