I\'m working on an Open-source project. As it is intended that anyone can download the source and build it themselves, I do not want to hard-code the package name anywhe
Easiest way might be replace the package name as late as possible. This way, you don't even have to touch your code. There is a nice article named Renaming the Android Manifest package(http://www.piwai.info/renaming-android-manifest-package/). Summary:
You can use aapt --rename-manifest-package to modify the package name
Alternatively, if you want package name replacement to be a part of the ant build process, you can override the -package-resources target:
-package-resources target from SDK's build.xmlmanifestpackage parameter