views:

70

answers:

1

Is it possible to programmatially read the date when my Android apk was built? I could not find anything in the PackageInfo class.

I want to expire beta versions of my app and the easiest way would be to read out such a date and expire it after a fix preiode of days, so I don't have to update the code for that eavery time I build and deploy a beta version.

A: 

I suspect there is no way to get that information. However, there is nothing stopping you from embedding the date in your code, via a regex transform on some template file, automated via a custom Ant task. You could use a public static data member on a class, or have the date be your versionCode, or something.

CommonsWare