2

I have one application, one startup view, two app icons and two app names.

I have to work with two app names and icons, it's crucial. The app it's the same.

The name and the icon changes with different signature type. free and not free signature.

I have two different icons and two different names for my app. And i want to change that in my java code. it's possible? Or change that in apk generation without change manifest file all the time.

I have icon1.png and icon2.png in drawable-hdpi/.

Jorge B.
  • 1,144
  • 2
  • 17
  • 37
  • What is the criteria to say which icon / title is used ? – XGouchet Nov 21 '12 at 11:12
  • one boolean var in my start activity. – Jorge B. Nov 21 '12 at 11:17
  • Ok, but what changes the boolean value ? The icon is created at Install time, and I don't think you can change it after, unless you update your app. If it's a different name / icon which changes with the country, or type of phone you can use the localisation with a drawable-hdpi-fr and drawable-hdpi-en for example (https://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources) – XGouchet Nov 21 '12 at 11:22
  • The name and the icon changes with different signature type. free and not free signature. – Jorge B. Nov 21 '12 at 11:31
  • Ok, then I guess Jorge's answer is the one to use (try adding this info in your question so that people know the context of your problem) – XGouchet Nov 21 '12 at 12:10

2 Answers2

2

You could automate the different builds using an ANT build.xml file with parameters. There are several examples on how to do this for Android in Google.

Jorge
  • 477
  • 2
  • 6
1

Sure, you have to go to the Manifest file and look out for:

<activity
            android:name=".Activity1"
            android:label="@string/title_activity_main" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

Please ignore the names, you will find your activity names.

The activity you want to use as the first activity should be as it is. But the activity which you do not want to show up in the launcher needs to be edited like:

<activity
                android:name=".Activity2"
                android:label="@string/title_activity_main" >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />


                </intent-filter>
            </activity>

the <category android:name="android.intent.category.LAUNCHER" /> should be removed.

This will create only one icon and one name

<android:label="@string/title_activity_main">

Change the label please

kittu88
  • 2,451
  • 5
  • 40
  • 80
  • The activity1 and activity2 are the same activity. only i want is to change the name and the icon of my app in my java code. – Jorge B. Nov 21 '12 at 11:23