Get App Installed Date on Android

March 17, 2011
zemna@zemna.net
Category:

API Level 9 이전 버전

[code lang="java"]
PackageManager pm = context.getPackageManager();
ApplicationInfo appInfo = pm.getApplicationInfo("app.package.name", 0);
String appFile = appInfo.sourceDir;
long installed = new File(appFile).lastModified();
[/code]

API Level 9 이상

[code lang="java"]
long installed = context.getPackageManager().getPackageInfo("package.name", 0).firstInstallTime;
[/code]

Reference

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram