Now you can Subscribe using RSS

Submit your Email

Sunday

How to change/rename company domain and package name in Android Studio

Vishal Shrestha
Usually package name in Android Studio resembles something like this - com.vishal.someapp.
There are different ways to rename package name for your app in Android Studio. It depends on which part of the package name you want to rename. If you just want to rename the last part, (i.e someapp in the example above), it is relatively easier. If you want to rename the company domain, for your app, you have to move everything from your current company domain folder, (i.e vishal in the above example) to a new folder of your desired name, changing domain name in Android Studio is also easy at android studio does all the job for you. So let's begin with changing package name -  
change company domain and package name android studio


Changing package name in Android Studio
  1. Select the package same you want to replace and right click on it(shortcut is shift+F6).
    Renaming package name in Android Studio 1
  2. Click on Refactor and then rename.
  3. A dialog box will pop-up giving some information as shown below, click on rename package.
    Renaming package name in Android Studio 2

  4. A new dialog will show up, type your desired name and then click on refactor.
  5. This is the final step, all the usage of the current package name with be shown, now simply click of do refactor and you are done.
    Renaming package name in Android Studio 3
Changing company domain name in Android Studio.
  1. Similar to changing package name, select the package for which you want to change the company domain, and then right click on it.
  2. Click on refactor then move.
  3. A dialog box will pop up with three options, select the move package option and then click ok.
  4. A new dialog will pop us asking you for new package to move to, enter you desired company domain. Just enter the new name for the company domain you want only and click on refactor.
  5. Finally, just as the last step above, click on do refactor after it looks for usage and you are done! You have successfully change the company domain name in Android Studio.
It's pretty easy to do once you figure out how, if you have any problems, feel free to comment them below. I'll get back to you asap.

Vishal Shrestha / Author & Founder

A developer by profession, a born Adventurer. I mainly do Android but like to get my hands dirty with web development and a little bit of Python. I would't rather go on a Trek than a party and you can find me having a few rounds with the heavy bag to let out the steam ;)

For Business info : My Portfolio Site.

0 comments:

Post a Comment

Coprights @ 2017 | The Code City by Vishal Shrestha Vishal Shrestha