W I Z A R D W I Z A R D - 3 months ago 18
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.


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){