DroidIn
Do your LinkedIn on Android
-
Android – deploy multiple versions of the same app
Posted on May 13th, 2009 2 commentsSo you have paid and free version of the same app and you want to deploy both to the Android Market (AM). There you’ll have a nasty surprise – AM wants to identify your app by its package and you will have to move one of the versions to the another package. I had to do it for my DroidIn app so here’s least painful way of doing it that I could come up with:
Let say you have your paid version in com.foo.widget and you want your free app to be in com.foo.widget.free
- Deploy your paid version to the AM
- Come back to your code and open Android manifest
- Change <manifest package=”com.foo.widget”/> to <manifest package=”com.foo.widget.free”/>
- Save it – and you will be horrified with all errors in your project at this point
- The most important thing from this point on – you will no longer be able to refer to your activities and services by a shortcut in the manifest file. The example of shortcut? Here – <activity android:name=”.HOME”/>
- You will have to refer to these by full package name so the element above will look like <activity android:name=”com.foo.widget.free.HOME”/>
- Save the manifest again. Now your R generated file will appear in the new package (ROOT/gen/com.foo.widget.free.R.java)
- Which means you will have to go to your activity(s) source file, or any file that refers to R.class and change import statement(s) to look at the new location. The more files you have, the more painful that will be, of course.
- When you no longer have compilation errors change @string/app_name to reflect free version and you ready to package and deploy
If you know of easier way of achiving the same result – please let me know, I would love to hear it


