.NET developers everywhere can easily add native mobile developer to their resume with Xamarin for Visual Studio. Join Judy McNeil, Xamarin University mobile expert, to learn how to build your first Android app — completely in C# — with Xamarin.Android and Visual Studio.
Watch webinar recording at aka.ms/XamUAndroidApp
Explore Xamarin University at xamarin.com/university
7. 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
15. 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
16. 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
20. 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
21. 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 XML
protected 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