進階概念與內部項目Advanced Concepts and Internals

本章節包含的主題說明了 Xamarin 的架構、API 設計和限制。此外,它還包含說明其垃圾收集執行以及在 Xamarin 中提供之元件的主題。因為 Xamarin 是開放原始碼,所以也可以藉由檢查其原始程式碼來瞭解 xamarin 的內部運作方式。This section contains topics that explain the architecture, API design, and limitations of Xamarin.Android. In addition, it includes topics that explain its garbage collection implementation and the assemblies that are available in Xamarin.Android. Because Xamarin.Android is open-source, it is also possible to understand the inner workings of Xamarin.Android by examining its source code.

Architecture (架構)Architecture

本文說明 Xamarin Android 應用程式背後的基礎架構。This article explains the underlying architecture behind a Xamarin.Android application. 其中說明 Xamarin Android 應用程式如何在 Mono 執行環境中和 Android 執行時間虛擬機器一起執行,並說明做為 Android 可呼叫包裝函式和受控可呼叫包裝函式的重要概念。It explains how Xamarin.Android applications run inside a Mono execution environment alongside with the Android runtime Virtual Machine and explains such key concepts as Android Callable Wrappers and Managed Callable Wrappers.

API 設計API Design

除了屬於 Mono 的核心基類庫,Xamarin 也隨附各種 Android Api 的系結,可讓開發人員使用 Mono 建立原生 Android 應用程式。In addition to the core Base Class Libraries that are part of Mono, Xamarin.Android ships with bindings for various Android APIs to allow developers to create native Android applications with Mono.

就 Xamarin 的核心而言,有一個 interop 引擎可將C#世界與 java 世界橋接,讓開發人員可以從C#或其他 .Net 語言存取 java api。At the core of Xamarin.Android there is an interop engine that bridges the C# world with the Java world and provides developers with access to the Java APIs from C# or other .NET languages.

組件Assemblies

Xamarin 隨附數個元件。Xamarin.Android ships with several assemblies. 就像 Silverlight 是桌面 .NET 元件的擴充子集,Xamarin 也是數個 Silverlight 和桌面 .NET 元件的擴充子集。Just as Silverlight is an extended subset of the desktop .NET assemblies, Xamarin.Android is also an extended subset of several Silverlight and desktop .NET assemblies.