Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display the Android application.apk creation date in Application

Tags:

date

android

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.

like image 618
W I Z A R D Avatar asked Apr 10 '14 06:04

W I Z A R D


People also ask

How do I find out when an app was installed for the first time?

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.

How do I inspect an APK file?

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.

What is the APK format in mobile application development?

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.


1 Answers

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

like image 154
NBApps Avatar answered Oct 09 '22 13:10

NBApps