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 (40541)

Introduction

During this course, developers will learn to use a variety of techniques, from beginner to advanced, to develop cross-platform apps with Xamarin.Forms. Topics begin with the basics of mobile application development with C# and .NET and then advance to include data storage with SQLite, using REST-based services, designing a shared UI with XAML, displaying data, and using effects and renderers to create enterprise quality cross-platform applications.

Audience

This course is for developers with at least 3+ months of C# experience and 6-12 months of .NET experience. Familiarity with the paradigms of Android, iOS, and Windows are helpful.

Prerequisites

Before attending this course, participant should have basic knowledge of C# and six months of experience developing using .NET.

At course completion

After completing this course, participants will be able to:

  • Use a variety of techniques to lay out, style, store, access, and display data
  • Create and apply data bindings and use effects and renderers to build an Enterprise quality cross-platform Xamarin.Forms application

Exams

N/A

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: Setup your development environment

Module 2: Introduction to Xamarin.Forms (XAM120)

Maximize your ability to share code, during this module, you will create a new Xamarin.Forms application and define your shared UI in code. You will also see how to access platform-specific features such as the phone dialer that do not have a shared-programming model integrated into Xamarin.Forms.
 

  • Lesson 1: Create a single screen cross-platform application
  • Lesson 2: Cross Platform Applications with Xamarin
  • Lesson 3: Arrange the UI using Layouts
  • Lesson 4: Use platform-specific features in shared code

Module 3: Introduction to Cross-platform Development (XAM110)

In this module, we will explore ways to structure your shared code using Portable Class Libraries, .NET Standard libraries, and Shared Asset Projects. We will look at the pros and cons of each approach and see how to access platform-specific features in each model.
 

  • Lesson 1: Add shared components to your application
  • Lesson 2: Share code using Shared Projects
  • Lesson 3: Share code using Portable Class Libraries
  • Lesson 4: Share code using .NET Standard Libraries

Module 4: XAML in Xamarin.Forms (XAM130)

This module shows you how to define your UI in XAML. You will create pages and add controls, all in markup. You will also see how to access UI elements from code so you can subscribe to UI events and update UI properties as your data changes.
 

  • Lesson 1:  Examine XAML Syntax
  • Lesson 2:  Add behavior to XAML-based pages
  • Lesson 3: Explore XAML capabilities

Module 5: Layout in Xamarin.Forms (XAM135)

This module contains in-depth coverage of StackLayout and Grid, the two most popular layout containers in Xamarin.Forms. You will also learn how to add support for scrolling when your UI is too large for the available screen area.
 

  • Lesson 1: Specify the size of a view
  • Lesson 2: Arrange views with StackLayout
  • Lesson 3: Apply Attached Properties
  • Lesson 4: Arrange views with Grid
  • Lesson 5: Scroll a layout with ScrollView

Module 6: Resources and Styles (XAM140)

This module teaches you how to create a consistent and dynamic style for your application using Resources in XAML.
 

  • Lesson 1: Avoid duplicate XAML with Resources
  • Lesson 2: Create consistent UI with Styles
  • Lesson 3: Make your Resources and Styles available across your entire app
  • Lesson 4: Apply the user's Accessibility choices with built-in Styles

Module 7: Data Binding in Xamarin.Forms (XAM270)

Use Data Binding in Xamarin.Forms to connect your application's data to your UI.
 

  • Lesson 1: Use data binding to decouple code-behind from UI
  • Lesson 2: Use value converters to bind incompatible types

Module 8: Model-View-ViewModel (XAM320)

In this module you will learn how to design your applications using MVVM. You will create View Models and use data binding and commanding to connect them to your UI. You will also use the Xamarin.Forms MessagingCenter to communicate between View Models.
 

  • Lesson 1: Decide where to place code in Model-View-ViewModel
  • Lesson 2: Define Visual Behavior
  • Lesson 3: Use Commands
  • Lesson 4: Test MVVM based apps

Module 9: Patterns for Cross-Platform Development (XAM250)

Use the Factory pattern, the Service Locator pattern, and Dependency Injection to access platform-specific APIs from shared code in a loosely-coupled manner.
 

  • Lesson 1: Locate dependencies using the Factory Pattern
  • Lesson 2: Use a Service Locator to register and retrieve dependencies
  • Lesson 3: Use an IoC container to automatically inject dependencies

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

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
  • Lesson 4: Integrate with platform-specific network features

Module 11: SQLite and Mobile Data (XAM160)

During this module, you will learn how 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 2: Store data locally with SQLite
  • Lesson 3: Use SQLite asynchronously

Module 12: ListView in Xamarin.Forms (XAM280)

Use the Xamarin.Forms ListView control to display scrolling lists of interactive data.
 

  • Lesson 1: Display a collection with ListView
  • Lesson 2: Add and remove items dynamically
  • Lesson 3: Customize ListView rows

Module 13: Customizing ListViews (XAM312)

During this module you will learn how to use and customize the ListView in Xamarin.Forms. You will be able to define a row template, add headers/footers, and display grouped data. You will also survey several performance-tuning strategies including cell caching.
 

  • Lesson 1: Create custom cell definitions
  • Lesson 2:  Add headers and footers
  • Lesson 3: Separate your data into Groups
  • Lesson 4: Performance-tune your ListViews

Module 14: Xamarin.Forms Effects (XAM330)

This module teaches you how to use Effects to access and customize the native peer controls. This gives you the same power to modify the appearance of your UI as a native developer.
 

  • Lesson 1: Customize control appearance
  • Lesson 2: Apply effects to controls
  • Lesson 3: Create an effect

Module 15: Xamarin.Forms Renderers (XAM335)

In this module, you will see how to use a Renderer to implement the UI and behavior for a fully custom control. In addition, you will use a Renderer to modify the behavior of an existing control to meet your app’s specific needs.

Lesson 1: Embed native controls into Xamarin.Forms
Lesson 2: Customize a renderer for an existing control
Lesson 3: Create a renderer for a custom control
Lesson 4: Send notifications between renderer and element

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: Using Xamarin.Forms to build a single screen cross-platform application
 
  • Create your first Xamarin.Forms application (Group Exercise)
  • Create Xamarin.Forms Phoneword
  • Add support for dialing the phone

Lab 3: Share code across Windows, Android and iOS
 
  • Display content from a shared JSON file onto Windows, Android and iOS
  • Use a portable library to display content on Windows, Android and iOS
  • Demonstration: Create a .NET Standard library and use .NET Standard APIs
  • Demonstration: Upgrade from PCL to .NET Standard Libraries

Lab 4: Create a XAML-based calculator app with behaviour and tailor the UI to each platform
 
  • Create a XAML-based version of a calculator
  • Add behavior to the app
  • Cleanup the XAML code and tailor the UI to the platform

Lab 5: Build user interfaces using stack and grid layouts
 
  • Use StackLayout to build a UI
  • Use a Grid Layout to build a UI

Lab 6: Use resources to style an application
 
  • Group Exercise: Examine an app with repeated code
  • Use page-level resources
  • Dynamically update resources
  • Create an apply a style
  • Use style inheritance to refactor repeated code

Lab 7: Use Data Binding in Xamarin.Forms
 
  • Group Exercise: Use Data Binding in a Xamarin.Forms Application
  • Keep the UI and data in sync using Bindings
  • Use Value Converters

Lab 8: Create an application using MVVM
 
  • Define a ViewModel
  • Create ViewModel Collections
  • Drive behavior through properties
  • Demonstration: Add unit tests for View

Lab 9: Define, locate and use dependencies
 
  • Use the Factory Pattern to access a dependency from shared code
  • Group Exercise: Build a Service Locator
  • Use Dependency Injection

Lab 10: Use, consume and communicate with REST services
 
  • Determine the network connectivity
  • Communicate with a Book Service
  • Demonstration: Leverage the native platform network stack

Lab 11: 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 12: Use ListView in Xamarin.Forms
 
  • Display a list of items with a ListView
  • Select a row
  • Work with mutable lists
  • Add Pull to Refresh support

Lab 13: Customizing ListView in Xamarin.Forms
 
  • Provide a custom cell template for our ListView
  • Add a header and footer to the ListView
  • Group Exercise: Add Grouping support to our Character List
  • Add a quick index
  • Turn on recycle caching

Lab 14: Implement Effects in Xamarin.Forms
 
  • Use platform-specific themes
  • Add and use an existing effect
  • Create a RoutingEffect
  • Create a custom Effect
  • Add an attached property

Lab 15: Implementing Automation
 
  • Add a native control to a Xamarin.Forms layout
  • Create a hyperlink label renderer
  • Create a custom control
  • Create a renderer for a custom control
  • Interact with the renderer

Formations complémentaires

MS-20483: Programming C#
MS-40539: Build iOS Apps with C# and .NET using the Xamarin Tools for Visual Studio
MS-40540: Build Android 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