Android, get app size
I'm looking for a way to calculate the size of an installed Android application/package. I can't find this information in neither ApplicationInfo nor PackageInfo objects. From the Applica开发者_StackOverflow社区tionInfo I can get the path for the data and the app itself. Data is a directory structure, but when attempting to read it recursivly I get a nullpointer. Is there any better way of doing it? Any sample code?
If you look at ManageApplications.java, you'll see that they use the hidden getPackageSizeInfo method of the PackageManager. This isn't part of the public API, so you shouldn't really use it.
Here's an example of how you shouldn't use it!
精彩评论