Change package name to existing Phonegap projects
It would be better if instead of Renaming the .java file and the class name, you just make your changes in:
- AndroidManifest.xml
- config.xml
Then remove android support with cordova platform remove android
And then re-add the android support cordova platform add android
This will generate the .java file again with the correct name.
Ref: http://intown.biz/2014/03/07/renaming-a-cordova-application/
As a command above, just 3 steps:
Remove platform
cordova platform remove android
Edit config.xml (main folder) find & replace widget id
<widget id="com.foobar.mynewname" version="1.0.0" android-versionCode="1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
- Add platform again
cordova platform add android
Yes, basically just change the android:package attribute in your manifest, and then refactor your src/ folders to follow that same package name.
As an alternative you can use the rename option in Eclipse, but it will have to modify all of the R.class imports in any of your java files that use resources. This will look a little intimidating, but should work fine.