For work I maintain an internal ‘market’ where new app releases can be uploaded and downloaded. I also maintain a launcher that can select from our many apps and launch them (some are the same app ‘branded’ differently). I can currently populate this list with the package name and the version code, but I would also like to add in the SVN branch.
I was thinking about having a script that would add the branch info as XML either to the manifest as a custom attribute or as a separate XML file. Ideally, this could be accessible publicly by the PackageManager. Is this possible?
Alternatively, can I programmatically change the APK name? Then I could use “$name – $branch” as the new name.
You have add a
<meta-data>element to a component’s element (e.g.,<activity>) and access the metadata XML content viaPackageManager:The component would access the metadata through code like this:
Your custom build process could then adjust the XML resource pointed to by
<meta-data>to contain whatever you want.You can name the APK file whatever you want on your hard drive, but I would not count on that name remaining intact through the installation process.