I\'m looking to optimize generating of slightly different APKs of the same Android app, the only difference being the http API server it\'s using (dev/staging/prod).
Move all you code to a library project see http://developer.android.com/guide/developing/projects/projects-eclipse.html#SettingUpLibraryProject
Then create separate projects in eclipse for test and production each with a unique package name. You can then use the package name to distinguish between versions.
Something like:
public static boolean isProductionVersion(){
return context.getPackageName().toLowerCase().contains("production");
}
This may seem like overkill for managing different http end points but it will make the code more manageable. You can also do useful things like:
This can all be done in eclipse without using and third party tools.