我需要從相同的代碼庫構建到不同的應用程序。第一個應用程序具有拼車功能,第二個應用程序具有搜索和註冊車廂的功能。現在這兩個應用程序需要不同。他們的切入點是我需要改變的一切。有沒有辦法在啓動期間提供構建時間選項來更改Intent-Filter?從相同的代碼庫構建2應用程序
有很多關於爲常見功能創建jar的建議。但我不想這樣做。有沒有其他方法?
我需要從相同的代碼庫構建到不同的應用程序。第一個應用程序具有拼車功能,第二個應用程序具有搜索和註冊車廂的功能。現在這兩個應用程序需要不同。他們的切入點是我需要改變的一切。有沒有辦法在啓動期間提供構建時間選項來更改Intent-Filter?從相同的代碼庫構建2應用程序
有很多關於爲常見功能創建jar的建議。但我不想這樣做。有沒有其他方法?
是, 創建兩個清單文件。 使用Maven編譯(我假設你也可以使用Ant) 創建兩個配置文件。 根據配置文件設置清單。
即。
的pom.xml
<profile>
<id>Target1</id>
<properties>
<customerManifest>Target1Manifest.xml</customerManifest>
</properties>
</profile>
<profile>
<id>Target2</id>
<properties>
<customerManifest>Target2Manifest.xml</customerManifest>
</properties>
</profile>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<androidManifestFile>${customerManifest}</androidManifestFile>
<sdk>
<platform>15</platform>
</sdk>
</plugin>
此切換出來的清單,以便您可以設置單獨的入口點。
所以當你構建調用mvn clean package -P TargetX –
希望這有助於到u http://stackoverflow.com/questions/4188250/how-to-create-multiple-android-apps-from-one-code-base&http://developer.android.com/ training/multiple-apks/index.html –
我已經度過了兩次,不,他們沒有解決我的問題。謝謝。 – Siddharth