Introduction to Xamarin.Android (AND101)
The first step in becoming a Xamarin.Android developer is getting an app up and running. This course takes you through the entire development process. You will create a new project in Visual Studio, code the user interface and behavior for an Activity, build the project, and test it on an Android emulator. You'll also see how to keep your development environment up-to-date as new Android versions are released.
Upon completion you will be able to:
- Create a Xamarin.Android project
- Decompose an app into Activities
- Build an Activity's UI
- Write an Activity's behavior
- Update your Android SDK
Course exercise download
Exercise materials are available from GitHub. The code can be cloned through a desktop Git client or downloaded directly as a ZIP file.
Lecture
Here are the lecture slides.
Exercises
-
Exercise 1: Create a Xamarin.Android project
This exercise walks you through creating a new Xamarin.Android project. There is no code to write here; however, the instructions will point out a few key parts of the project after you have created it.
-
Exercise 2: Add views to a layout file manually and with the Designer tool
This exercise has two goals: you will build part of your UI manually in XML and part of it using the Xamarin Android Designer. Both are useful skills. Understanding the raw XML can help you arrange your UI in exactly the way you want. Knowing how to use the Designer tool helps you build a UI more quickly than coding XML by hand.
-
Exercise 3: Implement an Activity's behavior and run your app in an emulator
The goal of this exercise is to write C# code to access and manipulate the UI of an Activity. Your code will need to read/write the properties on several text controls and subscribe to an event on a button. To do this, you will need to assign IDs to some of the views in the XML and lookup the views by ID in the code.
-
Exercise 4: Update tools and SDK platform
The goal of this exercise is to use the Android SDK Manager to install the latest version of the Android SDK on your development machine.
Additional resources
Useful links
Download Visual Studio for Windows or Mac and get answers to the most commonly asked questions.
Exploring On Your Own
We have Getting Started guides and documentation available on our developer portal.