Sunny
Sunny

Reputation: 14808

How to get Size of the application

I am trying to get the application size

and i tried PackageStats

        mPackageStats = new PackageStats(package_name);

        app_apk_size = mPackageStats.codeSize;

        app_cache_size = mPackageStats.cacheSize;

        app_data_size = mPackageStats.dataSize;

But getting 0

What's wrong with the code or any other method?

Thanks!!!

Upvotes: 1

Views: 1138

Answers (1)

Lalit Poptani
Lalit Poptani

Reputation: 67286

Unfortunately there is currently no public api to retrieve size information about application packages. But you can check this blog how we can get the size of the Application using reflection.

Upvotes: 3

Related Questions