Ahmad Sattout
Ahmad Sattout

Reputation: 2476

Xamarin android application size

Why are android applications created by Xamarin so much bigger? Like my app took 40 MB of my SD card, and when I deleted that 40 MB the app didn't work, I had to reinstall the app. Even without the 40 MB there were still 7 MB of the app, while in java, the same simple app took only 3 MB, am I missing something or doing something wrong that my apps are deployed huge?

Upvotes: 0

Views: 179

Answers (2)

Nikola Irinchev
Nikola Irinchev

Reputation: 2186

In order to build and deploy your application faster, Xamarin are packaging the mono runtime and storing it on the SD Card. This can be turned on or off from Project options -> Android Build -> Use Shared Mono Runtime. Additionally, when you build for release, the linker will strip unused code and will trim the size down.

Nevertheless, despite all the optimizations, there is an inevitable 2-3 MB overhead due to the Mono runtime and BCL packages. Still, once your application gets sufficiently complex, this overhead becomes negligible compared to the total application size.

Upvotes: 0

Jason
Jason

Reputation: 89082

Xamarin apps have to package the .NET runtime with each individual app. Debug versions of the app are by default bigger; release versions should be smaller, and there are techniques you can use to minimize their size further.

This is discussed in detail here.

Upvotes: 1

Related Questions