How to change Package name of Android App?
Sometimes an Android project needs to be renamed. Maybe a file was copied manually into the project . Maybe the application name has changed during development, and it needs to be reflected in the filesystem tree. Automatic tools help with this and ensure cross-references are automatically updated. For example, in the Eclipse IDE, the different ways to rename portions of an application are
- Rename the Android project, as follows:
- Right-click the project and Refactor
Move to a new directory in the filesystem.
- Right-click the project and Refactor
Rename the project.
- Right-click the project and Refactor
- Rename an Android package, as follows:
- Right-click the package and Refactor
Rename the package.
- Edit the AndroidManifest.xml to ensure the new package name is reflected.
- Right-click the package and Refactor
- 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 ensure the android:name has the new component name.
- Right-click the .java file and Refactor
No comments:
Post a Comment