android tips and tricksFirst you understand what is Java package nomenclature?

Sometimes your android project needs to be renamed Because a file was copied manually into the project or Google play Market have already that package name Application.the application name has changed during development, and it needs to be reflected within the filesystem tree. Automatic tools help with this and ensure cross-references are automatically updated. as an example, within the Eclipse IDE, the different ways that to rename parts of an application are

Rename/Change the android project, as follows:

1. Right-click the project and Refactor ➪ Move to a new directory in the filesystem.
2. Right-click the project and Refactor ➪ Rename the project.

android project rename3. Pop up  open in eclipse (Rename Java Project) ….Edit name then click OK.

Project name changed now change java package name

Rename an android package, as follows:

1. Right-click the package and Refactor ➪ Rename the package.

java package rename

2. popup open in eclipse (Rename Package)…. Edit package name and Check Update References ….Click Ok

Android Rename Package
3. Edit the AndroidManifest.xml to make sure the new package name is reflected.

  • Open AndroidMainfest.xml ➪ Mainfest (Tab)

android rename packege

  • click Browse ➪ new  window open select new package click ok

java rename package

Then save project …Package name changed

 Rename an android class (such as the major components Activity, Service, BroadcastReceiver, ContentProvider), as follows:

Right-click the .java file and Refactor  Rename the class.

Edit the AndroidManifest.xml to make sure the android:name has the new component name.

Leave a Reply