Reducing APK size

I’ve just compiled my game for Android; so I figured out that the size of the .apk Corona generated is too big (9MB) for such a simple game.

I decided, then, to extract this apk with apktool to see what files we have inside this apk. I found a lot of files I think is related to the engine itself. Besides these kind of files, which I guess we cannot simply remove, I also found some gui-related assets that are never used.

Given that, I thought: why not to remove these so that I can reduce this apk size?

Turns out that things are not that simple. It’s known that some engines, like Unity, don’t allow us to do things like that; they consider it as some kind of hacking. I know this because I saw it written somewhere on the internet. I’ve searched for this type of information about Corona, but I didn’t find anything. I could read the license, but I’m not the kind of guy who understands it  :huh:.

So, is it allowed to do so with Corona-generated apk? Or is it prohibited by Corona’s license?

Illegal is wrong term. But how much would you get out by removing all that? Looks like a lot of work for very little. 9MB apk size is so tiny that no one cares or no one should care. If you cut it in half it is only 4.5MB and thats really not anything.

I don’t think there is anything in the license that would prohibit what you are trying to do so. That being said, I agree with Pixec: 9mb and under is tiny. If your goal is to make the smallest apk possible then go for it (there are worst hobbies). If you are worried about people not downloading you app because it is 9mb, I wouldn’t. I would focus in making the best game/app possible (if that is your goal).

I agree with you guys. The real thing here, though, is: if I wanted to, might I? Because, although it’s indeed not a big deal, it’s still something. I kinda have OCD.

You probably could remove the widget files if you’re not using any widget.* APIs, But then you will have to resign the app and generally we do not encourage you to unpack and repack the APK. We certainly will not provide you any support if you choose to.

Most of the rest of the files are the Corona core and if you try to modify them, I would not expect your app to work.

Rob

So it is allowed.

I don’t think I going to do this, because, as said by Pixec, it’s a lot of work for very little. I really just wanted to know whether this was “against the rules” or not, just in case…

@Rob, could the widget library and graphics be somehow changed to only be included if widgets are used instead of being loaded every time? Like from the open source side of main Corona itself or is it a more difficult part with some build systems?

It’s probably something that the community could attack via opensource. The HTML5 builds has a box on it’s build screen to give people the option to include those assets. That could be used as a model for the other builds. I can’t 100% say that the build servers are not involved, but you certainly could look into it. While this is a popular request, it’s not on our radar to address anytime soon.

Rob