I am using below code to obtain the installation time of my app
PackageManager p = this.getPackageManager();
ApplicationInfo apinf = null;
apinf = p.getApplicationInfo(this.getPackageName(), 0);
String apkFile = apinf.sourceDir;
installTime = new File(apkFile).lastModified();
If I reinstall apk after making some source code changes - via android studio - the installTime
is not updated. If however, I manually uninstall app from my device. the new installTime is correctly shown next time.
How do I write code to detect installation time of apk file that is reinstalled by android studio?