Application name can be changed at anytime you want. Even after you publish the App on playstore. The package name is more important. You can’t change it once you publish an App on PlayStore. You will have to publish a different App with a different name if you want a different package.
In this post, I will show you how to change the App name and package name in Android Studio.
Changing the application name is easy. It is defined in res -> values -> strings.xml. By default, it is the string under key name app_name.
<resources> <string name="app_name">My Application</string> </resources>
Just change it and you are done.
Changing the package name is bit difficult than changing the name because it is used in multiple places of the App. But Android Studio provides an easy way to do that.
- First, click on the gear icon on left project panel of Android Studio and unselect the Compact Middle Packages selection.
- Now, it will show the package in different parts.
You need to change middle or last part one by one. Right click on it, click Refactor -> Rename
Click on Rename package and rename it as showing below :
Click on Refactor and click on Do Refactor button shown below. Done.
If you want to revert the change, just use Ctrl + Z or Cmd + Z. Here, I renamed the last part of the package. Similarly, you can also use the same approach to rename the middle part of the package.
- How to validate an email in Kotlin in Android
- How to hide soft keyboard in Android (Kotlin) programmatically
- How to change the theme of Android Studio
- Create a recyclerview with image from API in Kotlin Android
- How to delete an item from a recyclerview in Android(Kotlin)
- How to add pull to refresh/ swipe refresh in an Android project in Kotlin