Basit
Basit

Reputation: 1840

Factors affecting .apk file size

This may sound like a silly question but I faced an anomaly while developing an Android application and I'd like to discuss it with more experienced and knowledgeable Android developers.

I'm developing an Android application. I have a private repo at place on which I push code as I make changes. The anomaly is, the Android Packaged File (apk) differs a little less than 50% in size on two different computers. On computer 1, the .apk file size is 1,037 KB and on computer 2, it is 541 KB. I use the same version of Eclipse on both computers and the exactly same code as I did on computer 1. So,

Your help would be appreciated.

Update: As suggested by @CommonsWare, I extracted the contents of these two apk files via WinRar. I'm now listing the number of files and specific directory/file size in both apk's. Let's call the apk file with size 1,037 KB as Bigger_APK.apk and the apk file with size 541 KB as Smaller_APK.apk.

Bigger_APK.apk

META-INF (directory). 3 files. Total size: 84.8 KB

res (directory). 413 files, 12 folders. Total size: 435 KB

AndroidManifest.xml (file). Total size: 2.61 KB

classes.dex (file). Total size: 1.48 MB

resources.arsc (file). Total size: 116 KB

Smaller_APK.apk

META-INF (directory). 3 files. Total size: 16 KB

res* (directory). 82 files, 8 folders. Total size: 230 KB

AndroidManifest.xml (file). Total size: 2.61 KB

classes.dex (file). Total size: 851 KB

resources.arsc (file). Total size: 14 KB

Points to ponder after this comparison:

Upvotes: 0

Views: 631

Answers (1)

Marco Altran
Marco Altran

Reputation: 366

Without much details, I'm going to play a guess game. So far I have come up with 2 possible answers:

1-) You are using proguard or some other obfuscator and the obfuscator configuration is different between computers. If you are using proguard, the config file is located in project.properties, usually pointing to ${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

2-) You are pointing to similar, but different dependencies.

Either way, I can only imagine the problem lies outside of your version control. Those 2 answers were the things I could think of. There should be more.

Upvotes: 1

Related Questions