Does size matter? We may never find the answer to this eternal question but when it comes to APKs I believe it does.
Project structure and contents.
My Xamarin Forms project is fairly small, simple and straightforward. One solution, with two projects: the .NET standard library and the application for Android. No iOS, No UWP. I am using Visual Studio 2019 Professional (version 16.2.2).
Both the projects reference
Xamarin.Forms (22.214.171.1245677) and
The standard library project contains the Application class and two XAML content pages. The first is the splash page which shows a PNG (11.5KB) saved as a drawable resource in the Android project. The second is just a WebView which displays a site from the internet. There is also the application icon PNG (3.09KB) saved as a drawable resource in the Android project. The Android project contains one activity class. No layouts, no assets and no other drawables except for the two mentioned above.
Android manifest and options.
The minimum android version is 4.1 (API 16) and target is 9.0. I've set ProGuard as the Code shrinker and linking the Sdk and User Assemblies (I've also tried with Sdk Assemblies Only with no difference). No Shared Runtime, no One package per ABI (I am supporting only armeabi-v7a), no incremental packaging and no multi-dex. The selected configuration is the Release configuration.
The size of the APK.
The generated APK is 22.170KB in size. When signed it grows to 22.232KB. When I zip the APK it shrinks straight down to 10.778KB. The APK generated by Android Studio for the exact same project written in Java is 1.800KB in size.
This is quite a big APK given the project structure and contents described above, isn't it?
Is there anything I can do to produce a smaller APK?