- Xamarin.Forms Projects
- Daniel Hindrikes Johan Karlsson David Ortinau
- 532字
- 2021-06-18 18:35:22
Xamarin and Mono
Xamarin is a developer platform that is used to develop native applications for iOS (Xamarin.iOS), Android (Xamarin.Android), andmacOS (Xamarin.Mac). It is technically a binding layer on top of these platforms. Binding to platform APIs enables .NET developers to use C# (and F#) to develop native applications with the full capacity of each platform. The C# APIs we use when we develop apps with Xamarin are more or less identical to the platform APIs, but they are .NETified. For example, APIs are often customized to follow .NET naming conventions and the Android set and get methods are often replaced by properties. The reason for this is that APIs should be easier to use for .NET developers.
Mono (https://www.mono-project.com) is an open source implementation of the Microsoft .NET framework, which is based on the European Computer Manufacturers Association (ECMA) standards for C# and the Common Language Runtime (CLR). Mono was created to bring the .NET framework to platforms other than Windows. It is part of the .NET Foundation (http://www.dotnetfoundation.org), an independent organization that supports open development and collaboration involving the .NET ecosystem.
With a combination of the Xamarin platforms and Mono, we can use both the platform-specific APIs and the platform-independent parts of .NET, including namespaces, systems, System.Linq, System.IO, System.Net, and System.Threading.Tasks.
There are several reasons for using Xamarin for mobile app development, which we will cover in the following sections.
Code sharing
If we use one common programming language for multiple mobile platforms (and even server platforms), then we can share a lot of code between our target platforms, as illustrated in the following diagram. All code that isn't related to the target platform can be shared with other .NET platforms. Code that is typically shared in this way includes business logic, network calls, and data models:

There is also a large community based around the .NET platforms, as well as a wide range of third-party libraries and components that can be downloaded from NuGet (https://nuget.org) and used across the .NET platforms.
Code sharing across platforms leads to shorter development times. It also produces apps of a higher quality because, for example, we only need to write the code for business logic once. There is a lower risk of bugs and are also be able to guarantee that a calculation returns the same result, regardless of what platform our users use.
Using existing knowledge
For .NET developers who want to start building native mobile apps, it is easier to just learn the APIs for the new platforms than it is to learn programming languages and APIs for both old and new platforms.
Similarly, organizations that want to build native mobile apps can use existing developers with their knowledge of .NET to develop apps. Because there are more .NET developers than Objective-C and Swift developers, it's easier to find new developers for mobile app development projects.
- Linux運維之道(第3版)
- 樂學Windows操作系統
- Cybersecurity:Attack and Defense Strategies
- Implementing Cisco UCS Solutions
- Linux系統架構與運維實戰
- Getting Started with oVirt 3.3
- Alfresco 4 Enterprise Content Management Implementation
- Linux操作系統應用編程
- Linux網絡內核分析與開發
- Linux系統安全基礎:二進制代碼安全性分析基礎與實踐
- Linux使用和管理指南:從云原生到可觀測性
- 細說Linux基礎知識
- Hands-On UX Design for Developers
- Cassandra 3.x High Availability(Second Edition)
- 寫給架構師的Linux實踐:設計并實現基于Linux的IT解決方案