Get App Installed Date on Android

Author: zemna
Date: April 17, 2021
Share this:

API Level 9 이전 버전

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

API Level 9 이상

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


Share this:

Leave a Reply

Your email address will not be published. Required fields are marked *

Let's connect and create
something awesome together!
2023 - Copyright, All Rights Reserved, Made by ZEMNA.NET with ❤️
crossmenu linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram