Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android, Get Installed App Size and Date

Tags:

android

In Android, How I can get app installed date and how I can get installed app size.

I am using below code to get app size but it is not correct

List packs = getPackageManager().getInstalledPackages(0);

for(i=0;i<packs.size();i++) {
    PackageInfo p = packs.get(i);
    ApplicationInfo appInfo =p.applicationInfo;
    long fileSize = new FileInputStream(appInfo.sourceDir).getChannel().size();
}

Please help me.. Thanks,

like image 959
Ajay Singh Avatar asked Mar 15 '11 17:03

Ajay Singh


People also ask

How can I tell what date an Android app was installed?

Go to App section and from 3 dot menu click view and select Medium detail. Now it will show App details like version number, size and date of installation.

How do you see how long ago an app was installed?

You can view the app download history in Google Play Store from the Installed or Library sections of the Store. The Installed section shows you all the apps currently installed on your Android device.


1 Answers

Ajay,

To get the installation date you will want to use the PackageManager class. More specifically the getPackageInfo() method. This will return to you a PackageInfo object which contains firstInstallTime value.

There does not currently exist a public API to get an application's size as PackageManager.getpackageSizeInfo() was removed from the API from SDK 0.9 to SDK 1.0. See HERE

Good luck!

like image 143
Will Tate Avatar answered Oct 25 '22 20:10

Will Tate