Change application name and label

32,495

Solution 1

You can change the name (or package) of your application in AndroidManifest.xml in the <manifest package="..." part and you can change the name of the app by changing the android:label attribute in the <application> tag in the same file.

Please note that changing the package of your application essentially registers as a totally different application from the previous one (as far as Android is concerned).

Solution 2

Can you post your Manifest file here. Below works well for me:

<application android:icon="@drawable/launcher_icon"
    android:label="@string/app_name" android:theme="@android:style/ Theme.NoTitleBar">

Solution 3

in your activity

this.setTitle("your text");

this works for me

Solution 4

go to strings.xml in res/values folder and changed the value of "app_name"

<resources>
<string name="app_name">DESIRED_NAME</string>
</resources>

also, rename the name of the .apk file after building the apk. I think this will solve your problem.

Share:
32,495
Renjith
Author by

Renjith

Updated on December 23, 2020

Comments

  • Renjith
    Renjith over 3 years

    Installer window

    I would like to change the application name and label in the installer window (see the attached image). Name and label is, by default, the package name. Even though I added custom name and label in AndroidManifest.xml, it is not reflected in this installer window.

    AndroidManifest.xml is given below.

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.style"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="10" />
    
    <application android:icon="@drawable/icon" 
                android:label="@string/app_name">
        <activity android:name=".StylePageActivity"
                  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>
    </manifest>
    

    And the custom name in strings.xml (or /res/values/base-strings.xml) is

    <string name="app_name">Demo Application</string>
    
  • Renjith
    Renjith almost 13 years
    <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".StylePageActivity" 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>
  • Hanry
    Hanry almost 13 years
    i think there may be problem with variable app_name change it from folder res/values/strings.xml>app_name=YourAppName
  • Renjith
    Renjith almost 13 years
    I don't want to change the package name. All I need is a meaningful label to application.
  • sparkymat
    sparkymat almost 13 years
    Then you need to change android:label which is now pointing to @string\app_name . app_name is defined in res\strings.xml. You can change the value there to change the label name.
  • Renjith
    Renjith almost 13 years
    Yes I did. But failed! Still showing the same package name. Meanwhile I analysed manifest file of K9 mail. It has also android:label in it. I copied apk file and tried to install. Again in the installer window is the package name as label
  • sparkymat
    sparkymat almost 13 years
    Please paste your AndroidManifest.xml (update your question with the contents of AndroidManifest.xml).
  • sparkymat
    sparkymat almost 13 years
    AndroidManifest.xml looks ok. Can you paste the relevant parts of strings.xml?
  • sparkymat
    sparkymat almost 13 years
    This is quite weird. I have no idea why its not reflecting. Make sure you are doing clean build and uninstall-reinstall the application.
  • Renjith
    Renjith almost 13 years
    Me neither! I have observed the same in popular e-mail client, K9.
  • Ash
    Ash almost 13 years
    @Renjith Hi.. Can you remove/uninstall app from ur emulator/phone and give a clean build and install it again!! Your menifest file looks good!!
  • Renjith
    Renjith almost 13 years
    @Ash No way! this is really eating ma head off. I did a clean build, uninstalled the app, rebooted the phone and tried installing again. But still the label in the installer window is that of the package.
  • Renjith
    Renjith almost 13 years
    @Ash but what intrigues me is even the email client application (K9 mail), available from the android market, has package name as label in the installer window.
  • Ash
    Ash almost 13 years
    @Renjith The screen shot you have mentioned of Installer Window is of which Application..I will try to reproduce it on my phone/emulator. Usually I go to Application->Manage Application to see and manage all the app installed on my phone. Are you using a third party installer app.
  • Renjith
    Renjith almost 13 years
    @Ash That is a small application I developed. You can try with any of the apk files.
  • Ash
    Ash almost 13 years
    @Renjith Sorry i meant..how can i see the screen which u have pasted here, In my phone when i go to Application->Manage Application I dont see package names there only App name n their details!!
  • Renjith
    Renjith almost 13 years
    @Ash Follow these to reproduce. (a) Copy apk file to your phone. (b) Browse it using file manager. (c) Tap the file (d) In the dialog, choose 'Open App Manager' and there you're!
  • Ash
    Ash almost 13 years
    @Renjith with my file Browser i dont see Open App Manager option , It just ask for install/cancel option..Are u using third party App Manager?
  • Renjith
    Renjith almost 13 years
    @Ash Were you able to reproduce the above screen?
  • Ash
    Ash almost 13 years
    @Renjith ..no as i could not find that App
  • Renjith
    Renjith almost 13 years
    @Ash It is one of the popular applications in android market. Search for 'Astro file manager' in the market!