File size of apk file - over 17mb! Can I reduce this?

4 replies [Last post]
mediakitchen's picture
mediakitchen
User offline. Last seen 7 weeks 2 days ago. Offline
Joined: 27 Jul 2010

My android game is weighing in at approx 17mb so I wondered if it could be packaging unnecessary libraries such as openfeint etc?

I am sure I read that these libraries are only added if needed. What determines if openfeint is packaged - is it simply the addition of the following line of code?

1
local openfeint = require("openfeint")

I noticed a lot of the Android games are very small file sizes so wondered if a large file size may be putting people off downloading my game...

Replies

kam187's picture
kam187
User offline. Last seen 1 day 4 hours ago. Offline
Joined: 10 Sep 2010

What is the size of your project directory? Typically corona ads about 2 to 4 mb. You can take a look here to decompile your apk and remove libraries if you really think there are ones included you don't need:

http://www.base2solutions.com/walkabout/Corona%20Tips.html
(section 7)

Also this will compress the binary with better compression.

mediakitchen's picture
mediakitchen
User offline. Last seen 7 weeks 2 days ago. Offline
Joined: 27 Jul 2010

Thanks for the reply.

My project directory is 15.5 MB so with the additional 2-4 MB from Corona that would bring it up to at least 17 assuming no compression.

Just wanted to be sure it wasn't adding on the openfeint and physics libraries when these are not required.

I will have a look at the link you sent.

Thanks

Paul

stefan27's picture
stefan27
User offline. Last seen 17 hours 54 min ago. Offline
Joined: 15 Aug 2011

The files needed for doing the APK decompile mentioned in Section 7 of Corona Tips is no longer available on mediafire unfortunately.

kam187's picture
kam187
User offline. Last seen 1 day 4 hours ago. Offline
Joined: 10 Sep 2010

Oops! I deleted the mediafire link by mistake :P

The web hoster is doing some maintenance, but as soon as thats sorted i'll update the link. In the mean time here's a newer version that lets you sign and compile all on the PC.

http://www.mediafire.com/?davapp8lyqbz487

Usage is slightly different. To setup for signing:

- Rename your .keystore file to mykey.keystore and copy it into the 'other' directory
- Edit Script.bat in notepad and add your password to the second line (whithin the quotes)

Now to modify an apk:

- Place your apk in the directory 'place-apk-here-for-modding' and run script.bat
- Select option 22 and then your apk file
- Select option 9 to decompile
- Your decompiled apk is in the projects directory. Edit the manifest there. Be careful not to leave any .bak copies of your manifest (ultraedit for example will do this)
- Select option 14 to compile, sign and zipalign in one shot. Your final apk will be in the 'place-apk-here-for-modding' directory.

Note you must use JDK version 6. Version 7 causes an issue with apktool and new corona builds. You can get jdk 6 from here:

http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u25-download-346242.html

Viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.