Modification of package name in Android project

Source: Internet
Author: User

It is common to modify the package name to cause r file errors, and sometimes there are multiple text clutter in the manifest file with an unknown reason.

As a result, the process of modifying package names that is currently considered the most concise and convenient is recorded as follows:

Assuming our current package name is Com.pepper.util, we are going to modify the package name to Com.pp.util

1. Click on the project right click-->android tools-->rename Application Package: Modify the Pack name--click ok--> click Finish:launch Configuration update--> Click Yes

2. If your package is named: Com.pepper.util, do not modify the package name of the main package first. You set up a few sub-packages under this package, such as: Com.pepper.util.print, now we first modify the package name of the child package is: Com.pp.util.print. Right-click the-->refactor-->rename of the child package and the following dialog box pops up:

After setting, click Preview--> Click OK.

3, the child package is modified, open the manifest file, the manifest in the original package name Com.pepper.util, all modified to Com.pp.util, modify the save.

4. Modify the package name of the main package according to the 2nd step method. The middle will be a step more than the 2nd step, click Continue.

5, now the package name has been modified, but there may still be some of the program can not be automatically modified in the package names may or com.pepper.util, so we have to search the whole project to see if there is still a place where the original package name. Now click on the entire project and press the shortcut key ctrl+h, the following screen will pop up:

Select the label above: File Search, in containing text: Enter your original package name or the original package name and now the package name is different from the section, we now search pepper, and then click Search. In the lower part of Eclipse there will be a form display with the Search tab, where the contents are the results of the searches, and if the original package name is still present in the project, it will be shown here, click on the specific location, and then modify it to the current package name. Save after modifying.

6. Now the package name of the whole project has been modified and completed.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.