Android Code - How do i rename an Android Studio Project with New Name ( New Application Name )?- Complete Steps

I wanted to create a new application with the same code from my previous application.
I wanted to just rename it , rather than going through a complete copy paste of all the java files and android manifest file.

Some screen shots which I took while renaming my project.

Steps :
Right Click on the Package name -> Refractor ->Rename -> enter the name of the package ->Click “Refractor”.
Do not edit any of the build files except “build.gradle” under the “app” folder.
- You have to rename the :

defaultConfig {
    applicationId "com.XXXX.XXXXX"
    minSdkVersion 15
    targetSdkVersion 23

Dont forget to rename your
1 - AndroidManifest.xml file :


2 - src/main/res/values/strings.xml :

<string name="app_name">XXXX</string>

You might get some errors. Just click on Refractor and Rebuild the project. You are done. You have a new application with the same code.

I found a good resource from stack over flow.Click here.


Popular posts from this blog