public void getAppSize(ArrayList<ApplicationInfo> data) {
for (int m = 0; m < data.size(); m++) {
packageManager = getPackageManager();
Method getPackageSizeInfo;
try {
getPackageSizeInfo = packageManager.getClass().getMethod("getPackageSizeInfo", String.class, IPackagestatsObserver.class);
if (getPackageSizeInfo != null) {
try {
getPackageSizeInfo.invoke(packageManager, data.get(m).packageName, new cachePackState());
} catch (IllegalAccessException | InvocationTargetException e) {
e.printStackTrace();
}
}
} catch (NoSuchMethodException e) {
e.printStackTrace();
}
}
}
Asked
Active
Viewed 50 times
0

Joshi Tushar
- 116
- 9
-
ans is [here](http://stackoverflow.com/questions/21037564/how-to-get-the-size-of-installed-application) – Navas pk Jan 17 '17 at 06:59
-
yes i get the size of apk but size is not correct.it display wrong size. – Joshi Tushar Jan 17 '17 at 09:01
-
Okk.. sorry sorry .finally its works .Thnx – Joshi Tushar Jan 17 '17 at 09:07