Many Android Developers want to design an APK for management.Program, To obtain the APK File Installation date many netizens do not quite understand. In earlier versions, android123 used the getinstalledapplications method of the packagemanager class to return an applicationinfo array. In the applicationinfo class, sourcedir can obtain the file path of the APK, in this way, the last modification time of the file class to read the file is used. However, this may cause:
1. The original creation time cannot be obtained. It may have been created very early and replaced later.
2. if this APK is in a private location, such as the app-Private directory, the app purchased with the market payment is in this location. If the root Android phone is not available, the Retrieval time also fails.
In the Android 2.3 API level of 9, The firstinstalltime and lastupdatetime fields added to the applicationinfo class can be directly obtained from the APK creation or last modification time, even paid software can be normally obtained.