How do I change the company domain name in Android Studio after creating a project?

Please Share On:

Today, I am going to show you how can you change the company domain name in the android studio after creating a project. You have just created a new project and you don’t like a company domain name or you have copy existing project and refactor into anther project name and you want to change the domain name too. The process is pretty simple and cool.

Following the following step to change the company domain name. Look over the following image, I have “com.geetaregmi.usCitizenshipTest” as a package name where “geetaregmi” is a domain name. I want to replace it into another domain name.

Here are the steps to do:

Step 1:

Right click on the package name -> Refactor -> Move

Step 2:

A message will pop up and ask what kind of refactor we need to do? Choose the first one and click OK.

Step 3:

A new warning message will pop up as shown below. Simple click “Yes” without worrying.

Step 4:

A new dialog box will pop up where you remove the old domain name and replace by new one which you like.The old domain name looks like below.

Now, I changed “geetaregmi” into “elsebazaar”. The new domain looks like below.

Make sure the two checkbox “Search in comments and strings” and “Search for text occurrences” must checked. Click “Refactor”.

Step 5:

An another dialog box will appear to confirm for domain name change. Click “Yes”.

Step 6:

Now, all the old domain name has been searched to change. Now last step to do. At the bottom of your android project screen. Click “Do Refactor”, which will change all old domain name into your new domain name.

Step 7: That’s it. See the final result. The domain name “geetaregmi” is moved to “elsebazaar”.



How do I make an existing Android Studio Project copy?

Please Share On:

So, you are new in android studio and you have successfully created your first android studio app. Now, you want to copy it and change the package name and make some changes and relaunch again as another app? Then, you are in the right place to read on.

Keep reading my blog. I am going to show you the easiest steps to copy your existing android studio project.

STEP 1:

Open the location where your existing Android Studio project folder is saved. Copy and paste your existing Android Studio. Let say the existing Android Studio Project name is “CitizenshipTest”. After copy and paste this “CitizenshipTest” in the same location. You will have another folder named “CitizenshipTest-Copy”.

STEP:2

Rename “CitizenshipTest-Copy” to your prefer name. I renamed as “USCitizenshipTest”.

STEP 3:

Open your existing project in Android Studio. And go the location where you saved your new folder.

File- >Open -> USCitizenshipTest -> OK

STEP 4:

Then the project will load in your Android Studio Screen. Now it’s a time to rename the package name. To rename your project package name, follow the following steps.

Select “com.domain_Name.Package_Name” under the Java Folder.

App -> Java -> com.example.CitizenshipTest

STEP 5:

Right Click on “com.geetaregmi.CitizenshipTest” ->Refactor -> Rename -> Rename Package. Change Name into “com.geetaregmi.usCitizenshipTest” then click refactor.

And Click Do Refactor.

STEP 6:

Now, you have to change the gradle file. Open Gradle Scripts ->build.grade(Module:app)

Change applicationID

applicationId "com.geetaregmi.citizenshipTest"

into

applicationId "com.geetaregmi.uscitizenshipTest"

Step 7:

Open your project manifests. App ->manifests -> AndroidManifest.xml and change your package name.

package="com.elsebazaar.aucitizenshipTest

into

package="com.elsebazaar.uscitizenshipTest

That’s it. You have successfully copied your existing project and changed package name into your new package name.



Copyright @2023. All Right Reserved.


Social media & sharing icons powered by UltimatelySocial