Android get app size

I am looking for a way to calculate the size of an installed Android application / package. I cannot find this information either in ApplicationInfo objects or in PackageInfo objects. From ApplicationInfo I can get the path to the data and the application itself. The data is a directory structure, but when I try to read it recursively, I get a null pointer. Is there a better way to do this? Any sample code?

+3
android
source share
1 answer

If you look at ManageApplications.java , you will see that they use the hidden method getPackageSizeInfo PackageManager. This is not part of the public API, so you should not use it.

Here is an example of how you should not use it!

+4
source share

All Articles