Salivan
Salivan

Reputation: 1905

How to make android app lighter?

I wrote an app with like 8 classes (2 services, 4 broadcast receivers etc.) and its size is 0.94 MB in fact that I'm not using any images or graphics, just the code and some stock views in my layout. I know there's a way to make it lighter.

And please don't say "WHOAAA!" for the number of my app classes because I didn't know how to handle two different alarms using only one receiver or service.

Upvotes: 0

Views: 1265

Answers (3)

yoah
yoah

Reputation: 7230

Since your code is small, I think your size comes from jar files you are using, maybe google-support. If the jars are what takes the space, proguard will not help, you need to use less jars, or just live with the apk size.

Upvotes: 1

saiful103a
saiful103a

Reputation: 1129

Do a little study on obfuscation if you are not familiar. Not only it does reduce the size of your final apk, it also make the code unreadable incase someone tries to reverse engineer your apk. As @NitinSethi suggested, use proguard. Couple of link for further information.
Proguard

obfuscation

Upvotes: 1

Nitin Sethi
Nitin Sethi

Reputation: 1336

Try to use Pro-Guard. It detects and removes unused classes, fields, methods, and attributes.. http://proguard.sourceforge.net/

Upvotes: 2

Related Questions