W I Z A R D W I Z A R D - 1 year ago 73
Android Question

Display the Android application.apk creation date in Application

I am developing an android application, i want to display the Version of the

and date now i can able to display app version of the application using
and now i want to display the date when app is created or
creation date.

Answer Source

Method which checks date of last modification of classes.dex, this means last time when your app's code was built:

 ApplicationInfo ai = getPackageManager().getApplicationInfo(getPackageName(), 0);
 ZipFile zf = new ZipFile(ai.sourceDir);
 ZipEntry ze = zf.getEntry("classes.dex");
 long time = ze.getTime();
 String s = SimpleDateFormat.getInstance().format(new java.util.Date(time));

 }catch(Exception e){
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download