Eek! Massive .apk files!

Monkey Targets Forums/Android/Eek! Massive .apk files!

silentshark(Posted 2012) [#1]
One thing I've noticed building Android apps is that it's easy to accidentally create a huge .apk file. Seems like all the resources in the ".data" folder are folded into the .apk file regardless of if they are required by the program.

In my example, I was experimenting with a little game. In the ".data" folder in Monkey, I stored a variety of sound files, some in .wav format, some in .ogg, some .mp3. I was doing this to play round with the idea of one source file which would compile and run under html5, flash, windows, GLFW and Android.

When I built the Android app, I noticed the .apk file was about 25Mb - pretty big for a really simple POC game! On deeper examination, it looks like unnecessary stuff like the .wav files are being taken and built into the .apk file. Just thought it worth pointing out, in case anyone else is needlessly creating massive .apk files.

Silentshark


pantson(Posted 2012) [#2]
in latest version of Monkey there is a config.txt file in each build dir.
Edit this so that the required extensions are placed into the data folder in Android builds (also html4 and ios)


silentshark(Posted 2012) [#3]
Ah, thanks, I will give that a whirl. Sounds like exactly what I need!


pantson(Posted 2012) [#4]
html4?!?!!? what was I thinking? lol


Zurrr(Posted 2013) [#5]
hmmm...

I convert all my wav to mp3 and my apk become so small. From 15mb to 2mb. Then when I upload to google play, my apk cannot be accepted by google. I wonder why? The I have to go back to wav and make mono to save space. Any one have the same problem?


Volker(Posted 2013) [#6]
Use .ogg for Android.
http://www.monkeycoder.co.nz/Community/posts.php?topic=337