Build Android Apps with C# & .NET using the Xamarin Tools for Visual Studio

Introduction

This course takes experienced C# .NET developers through the entire Xamarin.Android mobile development process, using the Xamarin tools for Visual Studio. Topics range from the basics such as Android activities, intents, and fragments and then move to more advanced topics such as consuming REST-based services, ListViews, data storage with SQLite and publishing to the Google Play store.

Audience

This course is intended for developers with at least basic C# knowledge with 6-12 months of .NET experience. Students should own and/or have used an Android device and be familiar with the paradigms of the platform.

Prerequisites

Before attending this course, participants should have basic C# knowledge with 6-12 months of .NET experience.

At course completion

After completing this course, participants will be able to:

  • Build iOS applications with C# .NET using the Xamarin tools for Visual Studio
  • Design multiscreen applications using the Storyboard designer and choose the appropriate navigation for larger applications
  • Load and visualize data including accessing REST services and local SQLite databases
  • Customize the visual presentation for collections of data using the ListView

 

Exams

 Xamarin Certified Mobile Professional
 Xamarin Certified Mobile Developer

Course outline

Module 1: Getting Started with Xamarin (XAM101)

By the end of this module, you will be able to choose the Xamarin approach that is right for you. You will also set up your development machine and run an app on Windows, the iOS simulator, and an Android emulator.

  • Lesson 1: Define the state of mobile technology today
  • Lesson 2: Discuss mobile app trends
  • Lesson 3: Identify approaches to development
  • Lesson 4: Discover the Xamarin Approach
  • Lesson 5: Set up your development environment

Module 2: Introduction to Xamarin.Android (AND101)

During this module 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.

Lesson 1: Create a Xamarin.Android project
Lesson 2: Decompose an app into Activities
Lesson 3: Build an Activity's UI
Lesson 4: Write an Activity's behavior
Lesson 5: Update your Android SDK

Module 3: Activities and Intents (AND102)

In this module you will code the core patterns that make Activities work together. You will see how to start Activities, pass arguments, and retrieve results. You will also see how to launch standard Android Activities such as the camera or the web browser.

  • Lesson 1: Start an Activity in your .apk
  • Lesson 2: Finish an Activity
  • Lesson 3: Pass arguments to an Activity
  • Lesson 4: Get Activity results
  • Lesson 5: Start a system Activity

Module 4: List Views and Adapters in Android (AND110)

In this module you will code an Adapter to populate the ListView and handle item-selection events to implement a simple master-detail pattern. You will also see two advanced tasks: layout recycling with view holders to boost performance and fast scrolling with section indexers to help the user navigate large data sets.

  • Lesson 1: Handle list-item click events
  • Lesson 2: Implement a custom adapter
  • Lesson 3: Use layout recycling and the view-holder pattern

Module 5: RecyclerView and CardView (AND115)

User RecyclerView to display a data collection and CardView to host the visualization of each element.

  • Lesson 1: Display a collection using RecyclerView
  • Lesson 2: Update the UI after a data change
  • Lesson 3: Respond to user actions
  • Lesson 4: Show data in a CardView

Module 6: Consuming REST-based Web Services (XAM150)

In this module, you will learn to consume REST-based web services with HttpClient using both the managed networking stack and the platform-specific handlers that boost performance. You will also learn some common strategies for dealing with the unique challenges that mobile devices face when communicating over the network.

  • Lesson 1: Obtain the device’s network capabilities
  • Lesson 2: Introduce REST
  • Lesson 3: Consume REST services with Xamarin

Module 7: Working with SQLite and Mobile Data (XAM160)

During this module you will learn to identify the proper location for your database file and how to insert, update, retrieve, and delete data efficiently using asynchronous I/O calls..

  • Lesson 1: Choose a data storage strategy
  • Lesson 1: Store data locally with SQLite
  • Lesson 1: SQLite asynchronously

Module 8: Toolbar and App Bar (AND180)

In this module you will learn to create a Toolbar, populate it from an XML menu file, and respond to item-click events. You will also learn how to integrate a Toolbar into your Activity by setting it as the Activity's app bar.

  • Lesson 1: Add a Toolbar to an Activity
  • Lesson 2: Populate Toolbar Actions from an XML menu file
  • Lesson 3: Use a Toolbar as an Activity's app bar
  • Lesson 4: Set a navigation icon on an app bar

Module 9: Android Navigation (AND205)

This module teaches you how to code three common navigation patterns: tab, gestural, and drawer. It also includes guidelines to help you decide which pattern is appropriate for your app as well as teaches you to use fragments and FrameLayout.

  • Lesson 1: Use Fragment and FrameLayout to swap views
  • Lesson 2: Implement tab navigation with TabLayout
  • Lesson 3: Implement gestural navigation with ViewPager
  • Lesson 4: Combine gestural and tab navigation
  • Lesson 5: Implement drawer navigation with DrawerLayout

Module 10: Android Services (AND210)

This module teaches you to define a Service, use start/stop methods to explicitly control its lifecycle, and use bind/unbind methods to automatically destroy the instance when the last client has unbound.rform long-running operations using Android services.

  • Lesson 1: Handle list-item click events
  • Lesson 2: Implement a custom adapter
  • Lesson 3: Use layout recycling and the view-holder pattern

Module 11: Google Maps (AND230)

During this module will learn how to use the Google Play Services APIs to add a map to your app. You will perform the entire setup process: register your app in the Google APIs Console, create an API key, and add your API key to your app's manifest. You will then use MapView and MapFragment to visualize map data in your app's UI. Finally, you will write code to add markers to the maps and adjust the viewpoint position and map perspective.

  • Lesson 1: Choose a map display strategy
  • Lesson 2: Configure an application to use Google Maps
  • Lesson 3: Display a map in your application
  • Lesson 4:  Add markers to a Google Map
  • Lesson 5: Adjust the map position and perspective

Module 12: Touch in Android (AND205)

This module teaches you how to code three common navigation patterns: tab, gestural, and drawer. It also includes guidelines to help you identify which pattern is most appropriate for your app..

  • Lesson 1: Use Fragment and FrameLayout to swap views
  • Lesson 2: Implement tab navigation with TabLayout
  • Lesson 3: Implement gestural navigation with ViewPager
  • Lesson 4: Combine gestural and tab navigation
  • Lesson 5: Implement drawer navigation with DrawerLayout

Module 13: Gestures (AND231)

In this module you use Android's gesture recognizers to respond to user gestures. You will learn the full list of standard Android gestures and see how to write your own recognizer to support a custom rotation gesture..

  • Lesson 1: Determine the current location
  • Lesson 2: Search for points of interest around the device

Module 14: Performance Tuning (XAM370)
During this module you will learn how memory leaks happen in managed memory even with a sophisticated garbage collector and how to discover and fix them. You will then learn several memory issues that are specific to Xamarin.iOS and Xamarin.Android.

  • Lesson 1: Identify and fix memory leaks in your code
  • Lesson 2: Recognize and fix Xamarin.iOS specific memory problems
  • Lesson 3: Recognize and fix Xamarin.Android specific memory problems

Module 15: Preparing for Publishing (XAM220)

Prepare your app for release through the App Store, Google Play, an Windows Marketplace.

  • Lesson 1: Getting ready to publish your app
  • Lesson 2: Understanding publishing styles
  • Lesson 3: Publishing to a store

Module 16: Android Publishing (AND220)

Build an app package and submit it to the Google Play Store and Amazon App Store.

  • Lesson 1: Configure your app for publishing
  • Lesson 2: Create a Google Play developer account
  • Lesson 3: Create an app package
  • Lesson 4: Submit your application for publishing

Documentation

Microsoft Official Courseware

Cursus de certification

N/A

Lab

Lab 1: Building Cross Platform Applications with Xamarin

  • Demonstration - Cross Platform Applications with Xamarin
  • Demonstration – View a Xamarin.Forms Project
  • Setup Validation – Validate your development environment ready

Lab 2: Create a Xamarin.Android application with Views, layouts and behavior

  • Create a Xamarin.Android Project
  • Add views to a layout file manually and with the Designer
  • Implement an Activity’s behavior and run your app in an emulator
  • Update the Tools and SDK Platform

Lab 3: Create an app with collaborating Activities

  • Explore the completed lab exercise
  • Start an Activity in your .spk
  • Programmatically end an Activity
  • Pass arguments to an Activity
  • Get Activity Results
  • Launch a system Activity

Lab 4: Use an Adapter to populate a ListView and then customize it to boost efficiency

  • Populate a ListView using an ArrayAdapter
  • Handle list-item click events
  • Implement a custom adapter
  • Use layout recycling and the view-holder pattern
  • Enable fast scrolling and a code a section indexer

Lab 5: Implementing web apps

  • Group Exercise: Create a RecyclerView
  • Group Exercise: Set a layout manager
  • Group Exercise: Code an item-layout file
  • Group Exercise: Code a view holder
  • Group Exercise: Code an adapter
  • Add an item-click event
  • Group Exercise: Show data in a CardView

Lab 6: Use, consume and communicate with REST services

  • Determine the network connectivity
  • Communicate with a Book Service
  • Demonstration: Leverage the native platform network stack

Lab 7: Utilize SQLite to store and access data

  • Determine your database file path
  • Add SQLite.Net to your projects
  • Access a SQLite database with SQLite.Net
  • Access a SQLite database using asynchronous methods

Lab 8: Create and populate a Toolbar and set it as the Activity's AppBar

  • Add a Toolbar to an Activity
  • Populate Toolbar Actions from an XML menu file
  • Add a checkable submenu
  • Use a Toolbar as an Activity’s app bar
  • Set a navigation icon on an app bar

Lab 9: Build three common navigation patterns in Xamarin.Android

  • Use Fragment and FrameLayout to swap views
  • Implement tab navigation with TabLayout
  • Implement gestural navigation with ViewPager
  • Combine gestural and tab navigation
  • Implement drawer navigation with DrawerLayout

Lab 10: Use an Adapter to populate a ListView and then customize it to boost efficiency

  • Populate a ListView using an ArrayAdapter
  • Handle list-item click events
  • Implement a custom adapter
  • Use layout recycling and the view-holder pattern
  • Enable fast scrolling and a code a section indexer

Lab 11: Create an app that shows a Google Map with markers and viewpoints

  • Group Exercise: Locate your keystore and SHA1 fingerprint
  • Group Exercise: Obtain a Google API key for Google Maps V2
  • Add support for Google Maps
  • Add markers to your map
  • Change your map viewpoint

Lab 12: Build three common navigation patterns in Xamarin.Android

  • Use Fragment and FrameLayout to swap views
  • Implement tab navigation with TabLayout
  • Implement gestural navigation with ViewPager
  • Combine gestural and tab navigation
  • Implement drawer navigation with DrawerLayout

Lab 13: Implementing and managing Azure AD synchronization

  • Group Exercise: Setup the Google Maps API key
  • Working with the Location Manager
  • Identifying a provider based on criteria
  • Group Exercise: Adding support for LocationServices
  • Using Geocoder to perform reverse geocoding
  • Using Geocoder to find specific POI

Lab 14: Track down and correct memory leaks in your Xamarin.Forms app

  • Using the Xamarin Profiler to monitor allocations
  • Finding and fixing delegate reference leaks
  • Identifying and breaking strong reference cycles
  • Watch out for peer promotions
  • Show ListView memory and performance with a custom adapter

Lab 15: Implementing and managing Azure AD synchronization

  • Update your app for publishing
  • Choose a distribution strategy
  • Publish to a store

Lab 16: Implementing and managing Azure AD synchronization

  • Configuring directory synchronization
  • Synchronization directories

Formations complémentaires

MS-20483: Programming C#
MS-40539: Build iOS Apps with C# and .NET using the Xamarin Tools for Visual Studio
MS-40541: Build Native Cross-Platform Mobile Applications with a Shared C# Business Logic for iOS, Android, and UWP in C# .NET with Xamarin and Visual Studio
MS-40542: Build Native Cross-Platform Mobile Applications with a Shared UI for iOS, Android, and UWP in C# .NET with Xamarin.Forms