[Android] Installation size vs package size question

Hi

I am finishing a simple Android game, the assets are limited to absoulte minimum. So far before some texture optimizations I was geting a 53MB .obb file (+20MB .apk), for the development build. After installing this app on the phone it was taking 103MB of disk space.
After I did some optimizations to the texture sizes and formats the .obb went down to 40MB (no changes for the.apk), but the installation space on the phone is still the same: 103MB.
I did clean the old folders manually before pushing the new, smaller version, to make sure there will be no left overs, but the size of he game, on the device is still the same, despite the package being smaller.
Does anyone know what is going on? :slight_smile:

What did you clean on the device? With .obb, the raw .obb is just copied over, so the only reason for 103MB would old data somewhere. It’s possible that the game has been writing out to /sdcard/YourProject although I am not sure if how you are accounting for size on disk would show that.

Have you used adb shell or similar to look around what’s on the device?

Josh

Hi Josh

I have uninstalled the app and than I have located the /ProjectFolder and deleted it.

In both cases I was pushing the game to the phone from the editor, and despite the difference in the .obb size of my packaged build that I was also making, the install size on the phone stays the same.

I have also checked how my internal memory looks after unistalling the pushed game. The folder that is left over after the uninstall is 80MB and contains over 1300 files. That is a lot :slight_smile:

But as I keep on testing I have also installed the game from the package (using the .bat file) just now. And now it is 84MB, which is 20MB more than the .obb and .apk together. So this must be something with the way that the app is pushed from the editor. And after installing from the package it unistalls pretty nice with less than 200kB of leftovers.

We really do need some documentation and options in this area… but I guess that you already know that :wink:

When you launch on from the editor, it pushes the files to the ProjectFolder as a bunch of loose files. When you package it, it makes the .obb, and the batch file installs the .obb file to a different spot (you can see where by looking in the batch file).

IIRC, the batch file will delete the files the editor would have installed, so it should just be taking .apk + .obb size.

How are you measuring the size on disk?
Josh

Well… not sure what we can do about it. My only guess is that it unzips the .apk when it installs? But I didn’t think it did that.

Does it say 84MB before running and after uninstalling?

Also, if you wipe everything, then install just the .apk and not the .obb, what does it say?

Josh

I am simply checking what the Androids’s Applications menu is showing, just like an average user will when deciding what to uninstall. That’s basically how the app will be judged.
So I have 61MB of .obb + .apk in a Windows folder, that Android is identifying as an 84MB app after install.

Hi Josh,

I will do the testing tomorrow (can’t do it right now) and report back to you. Maybe there is a chance to reduce the install size with this one if we figure it out where does this difference come from…

Hi Josh,

Sorry for the delay. I did check two things that you were asking for:

  1. I have installed the game, did not run it, chcecked the size that Android apps manager is showing and it is 84MB, just like before
  2. now the funny thing: I did remove the obb referrence from the .bat file, I did remove the .obb file from the package folder, I did install the game, it did not run, it crashed with .ueproject file missing but the size is still 84MB

And now something even more funny… I did install Tappy Chicken, 25MB of download? guess what my Android is showing as the game size… yes, you are right: 84MB! :slight_smile:

It looks like the the app size indicated by Android clearly is not equal to the actuall files sizes. Find where does this value come from and you will slash the size of every UE4 Android game with a single cut… I am using Sony Xperia M, Android 4.3.

PS
After installing Tappy Chicken I can not find it on my phone neither using my file manager nor Windows explorer. Searching for words ‘tappy’ or ‘chicken’ returns no results. Under what file names does it install?

The joke is that I have installed the Tappy Chicken from the Google Play store… :slight_smile:
I have been building the Tappy Chicken for testing long time ago (the last time I think around v4.4), but that would also mean some problems with installing/unistalling and recognizing the apps size anyway.

And when it comes to the .zip trick. My .apk is 20MB, the unzipped folder is 64MB. So 44MB of difference. But the phone indicates 20MB of difference between the install and the package. The unzipped .apk size plus the .obb size equals to the szie of the install pushed from the editor, so that would probably be right.

Oh, and reagrding your last question, I’m running the development builds so far. Still didn’t go through all the Google Play store stuff with keys, etc.
However the debugging should also be in the package, right? So why would install size be different from the package size? They should be both bigger than the shipping build, but shouldn’t the install size always be equal the size of the package used?

Maybe try installing the store version of Tappy Chicken to see what it shows… I will check out on a device here, and let’s compare :slight_smile:

Can you try:

  • Rename your .apk to .zip
  • Unzip the .zip file
  • Get properties on the folder to see the uncompressed size

Are you running Development or Shipping builds? Development will have debugging into in the executable, which could be the entire problem.

You can do shipping without needing to do Distribution, so you don’t need keys set up. Shipping will just strip out the debug info, so the size on disk will reflect what you would get form the store.

Sorry, I did not notice that I have switched to Shipping before. So to sum up:

  • these sizes that I was writting about were with Shipping active, For Distribution disabled;
  • after building the Development version again the .apk size changed to 25MB instead of 20MB;

Hi Josh

I have asked a friend to install Tappy Chicken on his Nexus 7. He got it from Google Play. Installation size: 86,75 MB.

Did you try installing it from Google Play on any “clear” devices?

So, I did manage to go down to single 42MB file (ETC1) with Shipping, for Distribution and packing everything into the .apk. I had to delete the Slate/Fonts folder before deploying, and I did exclude mobile resources in the config file.

However… the 41MB, single .apk installed on my phone gives a 119MB app… Either these are some leftovers from previous installs, either… I have no idea. The problem is can not find any leftovers after uninstalling the game in the first place…

I have uploaded the alpha version to the Google Play Store, will check the installation size from that one (however the Tappy Chicken from Google Play was oversized).

Josh, if you wish, I can add you to the alpha testing group, so that you can verify the installation size by yourself, just let me know what is your Google account (you can PM at the forums, I am using the same nick over there)

And yet another update… I did check the installed app size with ES File Explorer. It’s own app manager shows the correct app size both for Penguin in Panic and for Tappy Chicken.

So it looks lke it’s down to identification of the app size by the anrdoid app manager, the size of the app itself on the phone storage seems fine. The android app manager seems to calcuclate some fictional app sizes.