easy process of Change Package Name in Android (Motodev / Eclipse)

rjainbwr Post time 2020-12-19 20:25:03 | Show all posts [Copy link]
2 1510
View: 1510|Reply: 2

easy process of Change Package Name in Android (Motodev / Eclipse)

[Copy link]

62

threads

155

posts

4731

credits

New Member

Rank: 1

credits
4731

UMIDIGIerDie-Hard UMIDIGI Fans

Post time 2015-11-15 13:02:40 | Show all posts |Read mode


Changing your project package in Motodev Studio or Eclipse is always tricky and takes time to master. We’ll continue with our previous example of Re-ordering a list and modify its package name. The package name we used in this project was “com.movivation.reorderingdemo”. Let’s start Motodev Studio for Android 3.1 and begin this journey.
Now, we’ll be changing it to look like “com.movivationlabs.reorderingdemo”.
To change the name of your package, right click on package name, then select “Refactor” -> “Rename” as shown in the above image. After clicking “Rename”, you’ll see a window that resembles like this :
After changing the package, this window will look like :
On clicking the “OK” button on this dialog, Motodev Studio for Android processes your requirement to change the package name. The process takes a minute second to complete and you can see the changes here :
The first step of changing the package name is now completed. The next step is to change the package name using Android Tools found in the IDE. Right-click the “Project Name” in Project Explorer window, then click on “Android Tools” and at last click on “Rename Application Package”.
On clicking that menu item, opens another dialog asking for new package name:
The same dialog after changing the package name, the dialog looks like:
On affirming the changes, the IDE shows a very informative, line-by-line view of all the files that will be changed, and asks for final confirmation:
Clicking the “Finish” button starts the making the changes in all the mentioned files and finally the IDE asks for us to update the launch configuration:
This concludes the second step in changing the package. Now, all the files such as java source codes and Android manifest will be containing the newly proposed package. Look at the manifest file:
Our Re-ordering demo project was very small project with only one activity and a layout and that layout too, didn’t have any custom controls or UI controls that we extend in our project. The problem with Motodev and, in turn, Eclipse is that if we were to extend a UI control object, then the respective IDE won’t be able to modify the package name in the extended UI control object.
Below is the extended ImageView control named “TouchImageView”:
This control is not used in our project, I’ve shown this control only to make you understand that we need to modify package names for any custom control we use. This is the final step in changing the package name of an Android project.
In summary,
  • Refactor-rename the android package name.
  • Rename the package name using Android Tools.
  • Manually change the package in Android manifest or any other custom controls, styles, themes you’ve used in your project, if not changed otherwise.
That concludes the tutorial for today. Hope it is useful to all the Android-ers!

0

threads

6

posts

24

credits

New Member

Rank: 1

credits
24
Post time 2020-12-15 19:33:36 | Show all posts
URL:-

Thanks for sharing this informative article with us. I would also like to offer you an article written by me, you can check it Click here.

0

threads

2

posts

6

credits

New Member

Rank: 1

credits
6
Post time 2020-12-19 20:25:03 | Show all posts
Hello! I read your article frequently and it's awesome and helpful. You provided great knowledgeable information. Such a great site. It's my Blog You can Visit Here.
You have to log in before you can reply Login | WELCOME TO UMIDIGI COMMUNITY

Points Rules

Quick Reply Top Back to list