Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Application Installed Date on Android

Is there are way to find out the "Date when an application was installed" on an Android Device.

Have searched extensively, but unable to find relevant answer.

Was unable to find anything regarding Date when Application was Installed through PackageManager documentation/Code.

like image 559
mahim Avatar asked Mar 15 '11 12:03

mahim


2 Answers

or this one (API Level 9 upwards!):

long installed = context     .getPackageManager()     .getPackageInfo(context.getPackag‌​eName(), 0)     .firstInstallTime ; 
like image 119
Martin Matysiak Avatar answered Nov 05 '22 23:11

Martin Matysiak


Use this code:

PackageManager pm = context.getPackageManager(); ApplicationInfo appInfo = pm.getApplicationInfo("app.package.name", 0); String appFile = appInfo.sourceDir; long installed = new File(appFile).lastModified(); 
like image 30
Sunil Pandey Avatar answered Nov 06 '22 01:11

Sunil Pandey