Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: How to customize the label under the launcher icon

Tags:

android

The name of my Android app is 14 characters long with no spaces, as such, the full name is not visible on the home screen when displayed under the launcher icon.

I want to use an alternate name for displaying under the launcher icon, so I can break up the name into two strings separated by a space - so that the words should wrap.  

How can this be done?

like image 351
JohnRock Avatar asked Jun 26 '10 18:06

JohnRock


People also ask

How do you change labels on Android?

Go to the app > manifests > AndroidManifest. xml file and change the android:label field in your application node in AndroidManifest.

Can you customize Android icons?

Select Icon from the settings menu that opens. The available icons for that app from the various icon packs installed on your phone appear under the Available Icons section. Select the one you like. Customize the app icon's style and theme from the Style and Themed tabs.


2 Answers

Modify your res\values\strings.xml to have two strings:

  1. app_name_wrappable = "App Name"
  2. app_name = "AppName"

Then modify your AndroidManifest.xml (or anywhere else you want the wrapping behavior) to read:

<application 
    android:icon="@drawable/icon" 
    android:label="@string/app_name_wrappable">

And leave everything else the same as it is currently.

like image 85
Lee Avatar answered Nov 05 '22 02:11

Lee


If you want to see the name of your app below the app icon, you should change the android:label of the starting activity as the required app name.

Should use String.xml for that:

 <string name="app_name">YourAppName</string>//Add this code in Strings.xml file

Change AndroidManifest.xml as below:

 <application
        android:allowBackup="true"
        android:icon="@drawable/icon2"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.crm_executive.MainActivity"
            android:label="@string/app_name" >
        </activity>
</application>
like image 20
Riya Avatar answered Nov 05 '22 04:11

Riya