You can combine them into one project.
Create a project which has a package name of a base package name. For example, if your current apps are com.package.booklist
and com.package.bookreader
create a project with the package com.package
. Now copy all the code from the book list into the com.package.booklist
sub package, and all the code from the book reader into the com.package.bookreader
.
Now you need to combine the AndroidManifests. You can copy all <activity>
etc. elements into the new project's manifest. Now, you'll need to prefix all classes in the reader with .bookreader
and all the classes in the book list with .booklist
. So you'll have a manifest that looks something like:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.package"
android:versionCode="1"
android:versionName="1" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity android:name=".booklist.BookListActivity" >
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" >
</category>
<action android:name="android.intent.action.MAIN" >
</action>
</intent-filter>
</activity>
<activity android:name=".bookreader.BookReaderActivity" >
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" >
</category>
<action android:name="android.intent.action.MAIN" >
</action>
</intent-filter>
</activity>
</application>
</manifest>
Remove the:
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" >
</category>
<action android:name="android.intent.action.MAIN" >
</action>
</intent-filter>
intent-filter from the Activity that you don't want in the launcher.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…