Xamarin apps are great, why and can they be smaller

I created the Hello World application using Xamarin and Android Studio. When I enter App Manager, the application built with Xamarin is 47 MB ​​in size, and the app with Android Studio is 12 MB in size. I know that the cross platform should be bigger, but why is it so big? Are there any export settings that can make it smaller?

+5
source share
1 answer

It is large because it contains a package that includes an application, libraries, Mono runtime, etc., such as BCL libraries (base class libraries). Below you can find out how the package size for the basic release package

enter image description here

For debugging this is a little different. First, when debugging on an Android device, you need to copy 2 large packages (common Runtime and Platform). The first contains BCL and mono runtime, and the other contains a certain level of the droid API that your application will target.

To reduce the size of the application during debugging, you can use the quick build option. This option allows you to directly install the packages you need on your test device. At the same time, the application package size is significantly reduced. To do this, find the option inside Xamarin Studio. Then you will find the “Build” section and click “Android Build”. Finally, click on the “Use Mono Sharing” and “Quick Assembly Deployment” checkboxes. Save the changes and create the application with the device connected, and you should be good to go :)

UPDATE 1

After talking about this for some time in the comments, I found that it would be better to have all the relevant information here rather than forcing the reader to go down in the comments section and find out more about what he / she came here to find. So I asked how you can reduce the size of an application in Release mode. In release mode, you will need to use the @ kent.green message regarding the link. Quick message view: Linking allows you to navigate from an application with sizes from 14.0 Mb to 4.4 Mb by using static analysis and removing assemblies that are not used by the application in any way possible. For people looking for something similar for iOS, take a look at post .

In addition, the OP was concerned about the debugging mode of its application. The OP wanted to know if assembly deployment was allowed quickly if you lost functionality such as resource monitoring or crash reports. I replied by saying that from a technical point of view, the fact remains that there are the same functionality. Instead of having an application package of size X, the size of the package is reduced with the help of your test device and puts "unnecessary" things to make the package smaller. I do not think that both common libraries apply to this.

+8
source

Source: https://habr.com/ru/post/1246905/


All Articles