Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does my app size on device differ than the APK or Play store size

Tags:

android

apk

size

I have a quite valid question from a user which I'm unable to get to the bottom of trying to understand why the size reported on Google Play store is different than the size reported on the device. My signed release APK size on my PC comes in at 3.8MB. Uploading to Google Play shows a similiar size. Looking at the app manager on the device however shows the following stats:

Total: 6.62MB
App:   6.51MB
Data:   112KB

This is not to do with Google Play enabled copy protection (as other similar questions sugget) as I get the same stats installing the signed APK or development APK.

The APK on the phone under /data/app is again 3.8MB and the files under /data/data/com.my.app come to another 100KB or so (presumably the 'Data' row above).

What is causing the discrepancy in stats?

EDIT: Researching this further, this is a common feature across many applications on my devices. Google Play reports one size and the device reports something generally in the magnitude 2 times greater. So good to know its probably not something I'm doing, but still curious what the reasoning here is as its frustrating to be accused by users of 'doctoring' the install size to appear smaller!

like image 835
Chris Knight Avatar asked Jan 18 '13 23:01

Chris Knight


1 Answers

When installing an APK in android system, what's installed is the DEX file. Which contains your code, resources etc compiled as binaries. Your dex is generally the same size of your apk, unless you have resources not compiled in assets.

Well, we all know that. What's not widelly spread is that android SAVES your original apk too. Perhaps for reinstalling in case of errors or for some other reasons.

That's why the amount of memory of our apps is the double in system. It's the sum of the size of the original apk and the installed dex.

like image 102
PFROLIM Avatar answered Sep 28 '22 01:09

PFROLIM