building your first android app with xamarin
TRANSCRIPT
iOS
Xamarin’s unique approach
Shared C# codebase • 100% native API access • High performance
Windows C# UI
Mono and ART VMs run side-by-side to execute a Xamarin.Android app
Xamarin.Android execution
Android
Runtime (ART)
Mono
Runtime
Linux Kernel
android.*
libraries
java.*
libraries
.NET
libraries
Your
IL code
Xamarin.Android – 100% API coverage
Text-to-speech Toolbar Printing Framework Renderscript NFC
System.Data System.Collections System.Numerics System.Core System.ServiceModel
System.Net System System.IO System.Linq System.Xml
C#
Xamarin Platform support
Broad support for Android devices, including
phones, tablets, Android Wear and Amazon Fire TV
Develop on Mac or Windows
Microsoft Visual Studio
on Windows
Visual Studio for Mac
on macOS (preview)
Activities: a collection of collaborating parts that
comprise Android apps
App structure
Activity 1
UI
Code
Activity 2
UI
Code
Activity 3
UI
Code
Data files,
images, etc.
MyApp
Activity definition
<LinearLayout ... ><TextView ... ><EditText ... ><Button ... ><TextView ... >
</LinearLayout>
Pi.axml
[Activity]public class PiActivity : Activity{...SetContentView(Resource.Layout.Pi);
}
PiActivity.cs
An XML layout file
that defines the UI
The related C# class
provides the behavior
You can use JNI or a Bindings Library to incorporate Java libraries into your
Xamarin.Android app
Integrating Java Libraries
PayPal TritonPlayerArcGIS ...
Mapping Finance Music
Set the ID of a View in XML using the id attribute and the syntax @+id/
Access UI from code
<EditText android:id="@+id/digitsInput" ... />Set an id
in the XMLprotected override void OnCreate(Bundle bundle){
base.OnCreate(bundle);SetContentView(Resource.Layout.Pi);
var et = FindViewById<EditText>(Resource.Id.digitsInput);et.TextChanged += OnTextChanged;
}
Lookup
in code
Xamarin.Android UI is
built from Google’s
controls and layout
panels, wrapped in C#
by Xamarin
Android UI