I am developing an android application, i want to display the Version of the .apk
and date now i can able to display app version of the application using PackageInfo
and now i want to display the date when app is created or .apk
creation date.
Navigate to APPS and select the app u want by long press. And then hit the Info button on top right corner. Thats it , it will show u the modified or installed time.
Drag an APK or app bundle into the Editor window of Android Studio. Switch to the Project perspective in the Project window and then double-click the APK in the default build/output/apks/ directory. Select Build > Analyze APK in the menu bar and then select your APK or app bundle.
An APK (Android Package Kit) is the file format for applications used on the Android operating system. APK files are compiled with Android Studio, which is the official integrated development environment (IDE) for building Android software. An APK file includes all of the software program's code and assets.
For new readers:
public static String getAppTimeStamp(Context context) {
String timeStamp = "";
try {
ApplicationInfo appInfo = context.getPackageManager().getApplicationInfo(context.getPackageName(), 0);
String appFile = appInfo.sourceDir;
long time = new File(appFile).lastModified();
SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
timeStamp = formatter.format(time);
} catch (Exception e) {
}
return timeStamp;
}
https://stackoverflow.com/a/2832419/1968592
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With