I have implemented an Android application using Xamarin:
The size of the .apk is 13.6MB with:
Here is the overview of sizes of the main components taken from the compiled .apk:
(these are the uncompressed sizes, I unarchived the .apk to a directory and looked to the files in Windows Explorer):
all System.xxx.dll (2.56 MB)
My app assemblies (the Droid app + one PCL) (204 KB)
PCL Microsoft HTTP Client libraries (System.Net.Http.dll) (110KB)
'res' folder (Size: 451KB Size on disk: 816KB) - because some files are 1KB they produce fragmentation, so Actual size vs Size on disk is significantly different
What can I do in order to reduce the size of the compiled .apk?
I find it pretty big.
Use linking: Sdk + User Assemblies, and go through the difficult process of marking classes with the Preserve attribute (see http://docs.xamarin.com/guides/ios/advanced_topics/linker/). You can check which class is missing when your app crashes in the android log. It should be only the classes used dynamically by reflection or using an IoC.
You can also create 2 separate packages, one with armeabi only (for very old devices), one with armeabiv7a, and one with x86 (currently your app will just crash on x86 android devices). Google play supports having 3 separate packages with different capabilities (don"t forget to change the capabilities in your manifest file for each package)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With