Android - Changing Package Name for App

One of the nice things I like about android is the use of the generated R.* stuff for the resources. This means you get some extra compile-time help to make sure you have properly defined strings, layouts, drawables, etc.

The problem with this is that it ties the package name of this generated class to the package name of the app, which itself is specified in the AndroidManifest.xml file. Since you'll have imports scattered around for the R class, changing the package name for the app will break all of these imports.

In eclipse, you can get these changes made automatically for you by going to Android Tools-->Rename Application package for the project.  This is certainly better than doing it manually, but still seems a bit of a kludgy mechanism to have to deal in general.  It certainly adds a little tedium to reusing code.

Here's a stackoverflow post with more nice info and screenshots:StackOverflow post on renaming package

Popular Posts