How To Change Application Name And Icon With Android Studio

Android Studio has a lot of customization options, like Changing Our Application Name and Icon.

  • Changing The Name :

When you Start a New Project you will find your App lik That :

  • In the title bar of our activity.
  • As the caption under our icon in the home screen launcher.
  • In the Application list in the Settings app.
  • And so on.

We should change that to be “OUR NEW NAME”, Double-click on the res/values/strings.xml file in your project explorer.

In the XML editor for the string resources, you will find an element that looks like:

<string name=“app_name”>Trial</string>

Change the text node in this element to “NEW NAME”. Then save your changes, giving you something like:

<resources>
<string name=“app_name”>NEW NAME</string>
</resources>

  • Changing the Icon :

You need to creat an icon with photoshop and right-click over the res/ directory in your main source set in the project explorer, and choose New > Image Asset from the context menu. That will bring up the Asset Studio wizard:

Change-Name-Icon

Click the “Image” radio button in the “Asset Type” row. Then, click the “…” to the right of the “Path” field and choose the “YOUR-IMAGE-ICON.png” file that you created.
Also, ensure that “Scaling” is set to “Shrink to Fit”, and choose “None” from the “Shape” drop-down. This should give you a preview of what the icons will look like:

Leave the rest of the wizard alone, then click Next to proceed to the next page:

You should get a warning towards the bottom, indicating that if you finish the wizard, you will overwrite existing files. This is expected, as we are trying to replace the old ic_launcher.png files with new ones. So, go ahead and click Finish.

  • Removing the Other Icon

Android 7.1 introduced the concept of having a separate “round icon”. This icon would be used on certain devices, based on hardware settings. So, for example, the Google Pixel line of devices use the round icon. We replaced the regular launcher icon, but we still have the stock round icon, and so we have a mismatched set.

We could use the Image Asset wizard to create a separate round icon for use on these devices. Instead, for simplicity, we will get rid of the round icon; devices that can use the round icon fall back to the regular icon when a separate round icon is not provided.

To do this, Go to “AndroidManifest.xml” and remove the android:roundIcon=”@mipmap/ic_launcher_round” attribute from the <application> element.

Then, go into one of the mipmap directories (e.g., res/mipmap-hdpi/), click on the ic_launcher_round.png file in there, and delete it (e.g., via the Delete key). You will be prompted with a confirmation dialog:

Click OK to proceed, and click Yes on the “Delete alternative resource files for other configurations” dialog that follows it. This will get rid of ic_launcher_round.png from all of the mipmap directories.

  • Running the Result

If you run the resulting app, you will see that it shows up with the new name and icon.

Android Dev

Android Developer.

Leave a Reply

Your email address will not be published. Required fields are marked *