Get active Applications Size in Android
<p>I want to show the size of active application in android . How can I do this ?</p>

<p>I have seen the following code but it shows error .</p>

<pre><code> PackageManager pm = getPackageManager();

Method getPackageSizeInfo = pm.getClass().getMethod(
    "getPackageSizeInfo", String.class, IPackageStatsObserver.class);

getPackageSizeInfo.invoke(pm, "com.android.mms",
    new IPackageStatsObserver.Stub() {

        @Override
        public void onGetStatsCompleted(PackageStats pStats, boolean succeeded)
            throws RemoteException {

            Log.i(TAG, "codeSize: " + pStats.codeSize);
        }
    });
</code></pre>

<p>Guys , plz help me in finding the size of installed apps .</p>
