0

I am developing an application for two different clients.
The core of the application is the same, just the application launcher icon and the webservice urls are different.

xml for urls

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="url">http://www.customer1_url.com/</string>
   <!-- <string name="url">http://www.customer2_url.com/</string> -->
</resources>

For the url I have to comment out one url everytime I built the application

Application manifest file:

   <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name">
        <activity
            android:name=".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>
    </application>

As for the icon, I have to change the drawables in the res folder everytime when building.
Is it possible to do this in a single project?
I was wondering if there is a good way to realize this without going through my way of doing it.
I search in the internet the equivalent of #ifdef for xml file, and no luck so far.

4

1 回答 1

1

Android 库项目用于公共部分,并为特定的客户端应用程序创建不同的项目。

于 2013-06-14T02:42:05.370 回答