How To Change App Name Android Studio
This is a simple example for Application name and package rename. Have you find your self in a situation when creating an Application, in the middle of the development or later, there is a change name request? Or you wanted your app to be renamed? Below is an explanation how to do that.
First, open new or existing Android studio project. After loading, locate your root app folder. In this example the root app folder path is app/src/java/com/denofdevelopers/changeappnameandpackage. In your case the path will be app/src/java/<your domain>/<your app name> OR app/src/java/<your app name>. In this example the domain is ../com/denofdevelopers/… and the app name is changeappnameandpackage.
The app name (by default) is located in strings.xml resource file under app_name. In this example that resource string is:
<string name = "app_name" > ChangeAppNameAndPackage </string> |
And this is shown as your application name under the app icon on the phone:
1. Change name of the Application
Changing the name of the application, does not change the application it self. It is not different application. Just its name it is changed. To do this, we need to go to our strings.xml file and simply add name that we want. The name will be displayed under the application icon on our phone and we are done.
<string name = "app_name" > App Name Changed </string> |
2 Change package of Application
Changing the package of the application does not change the application itself. The changing of app package is made by right clicking on app package, in our case changenameandpackage -> refactor -> rename and you'll have this warning message:
Click on rename package and do actual rename.
In our case the package is renamed to – newapppackage:
3. Change ID of the Application (Name and Package also)
Changing the id of the application does change the application itself. It is a completely. ID of the package is unique identifier of the app, distinguishing from other apps. The changing of app ID is made by changing the applicationId in app build.gradle file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | apply plugin : 'com.android.application' android { compileSdkVersion 28 defaultConfig { applicationId "com.denofdevelopers.changeappnameandpackage" // <-- change this in to newapppackage minSdkVersion 21 targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile ( 'proguard-android.txt' ) , 'proguard-rules.pro' } } } dependencies { implementation fileTree ( dir : 'libs' , include : [ '*.jar' ] ) implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support.constraint:constraint-layout:1.1.3' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' } |
This application ID is determined by your app package. The old one is com.denofdevelopers.changeappnameandpackage and we will change to com.denofdevelopers.newapppackage, so we will have completely new application. Click on sync project and wait for the syncing to finish. The result is this:
This is same app with same source code, but different name, package and app ID
Related
2019-02-28
How To Change App Name Android Studio
Source: https://denofdevelopers.com/how-to-change-android-application-name-package-and-app-id/
Posted by: riveracrourt.blogspot.com
0 Response to "How To Change App Name Android Studio"
Post a Comment