Building Cross-platform Apps with Xamarin Forms

Paths

Building Cross-platform Apps with Xamarin Forms

Authors: Jeff Hopper, Jim Wilson, Gill Cleeren, Jared Rhodes, Christopher Miller , David Broadfoot, Douglas Starnes, Thomas Claudius Huber, John Kuefler, James Millar

At its simplest, Xamarin.Forms is a mobile application framework for building user interfaces.

What You Will Learn

  • How to use the Xamarin Essentials library to bring access to native features into Xamarin.Forms applications
  • The process of deploying Xamarin.Forms applications to a device or store
  • The different options to extend Xamarin.Forms UI
  • The different navigation types in Xamarin.Forms
  • How to integrate maps in a Xamarin.Forms application
  • The architecture for enterprise-grade Xamarin.Forms apps
  • The Xamarin.Forms framework
  • How to develop a data-bound interface in Xamarin.Forms
  • How to design a UI in Xamarin.Forms using XAML
  • How to create a Xamarin.Forms solution and project structure
  • How to create a responsive layout for Xamarin.Forms applications
  • How to create list-based screens in Xamarin.Forms applications
  • How to create applications using the Xamarin.Forms Shell
  • How to arrange your Xamarin.Forms projects to promote code reuse
  • How to apply the MVVM pattern in Xamarin.Forms
  • How to apply testing techniques to Xamarin.Forms applications
  • How to apply localization in a Xamarin.Forms application
  • How to apply data access from a REST service in a Xamarin.Forms application
  • How to apply automation to the build and deployment process for Xamarin.Forms apps
  • How to apply XAML code to create Xamarin.Forms applications
  • How to apply UI code reuse with Styles in Xamarin.Forms
  • How to access data from a local database in a Xamarin.Forms application
  • How to access native platform features in Xamarin.Forms applications

Pre-requisites

  • Xamarin
  • .NET, .NET Standard
  • Visual Studio

Beginner

Learn the use case for Xamarin.Forms and get started with your first app.

Xamarin.Forms: The Big Picture

by Jeff Hopper

Dec 24, 2019 / 58m

58m

Start Course
Description

Xamarin.Forms helps .NET developers quickly create user interfaces by extending the Xamarin framework with a shared abstraction of the common UI objects of each platform. In this course, Xamarin.Forms: The Big Picture, you'll learn foundational knowledge of Xamarin.Forms to help make an informed decision of whether Xamarin.Forms can help with your cross-platform development efforts. First, you'll learn where Xamarin.Forms fits within the Xamarin ecosystem. Next, you'll discover the core components that make up the Xamarin.Forms framework. Finally, you'll explore how you can quickly get up and running developing cross-platform applications using Xamarin.Forms. When you're finished with this course, you'll have the skills and knowledge of Xamarin.Forms needed to make an informed decision of whether Xamarin.Forms is a good fit for your particular project.

Table of contents
  1. Course Overview
  2. What Is Xamarin.Forms?
  3. Xamarin.Forms Core Concepts
  4. The Development Environment
  5. When to Use Xamarin.Forms

Introduction to Xamarin.Forms

by Jim Wilson

May 13, 2019 / 3h 37m

3h 37m

Start Course
Description

The key to success in developing cross-platform mobile apps is efficiency and that’s what Xamarin.Forms provides: coding efficiency.

With Xamarin.Forms, you’re able to create apps that run natively across iOS, Android, and Universal Windows Platform (UWP) from a single C# code base.

In this course, Introduction to Xamarin.Forms, you’ll learn everything you need to build your first cross-platform app using Xamarin.Forms.

In this Xamarin.Forms tutorial you will learn:

  • First, how to create a new Xamarin.Forms app that targets and successfully runs on iOS, Android, and UWP.
  • After that, you’ll explore how to use Xamarin.Forms views and layouts to create user experiences that leverage the native features of each platform and automatically adapt to the display differences of each.
  • Next, you’ll see how to incorporate logic, features, and functionality into your app, and leverage data binding to simplify displaying data to and receiving data from your app’s users.
  • Additionally, you’ll delve into how to utilize a Model-View-ViewModel (MVVM) architecture to maintain appropriate separation between your app’s data model and display features.
  • Finally, you’ll be shown how to create a rich multi-page app experience that supports communicating between the app pages while maintaining proper separation between the layers of your MVVM architecture.
By the end of the course, you'll have the skills and knowledge necessary to start creating cross-platform apps with Xamarin.Forms.

Table of contents
  1. Course Overview
  2. Building Your First App
  3. Working with Views and Layouts
  4. Adding Functionality and Interactivity
  5. Connecting UI and Data with Data Binding
  6. Managing Data Presentation with Model-View-ViewModel
  7. Creating a Multi-page App Experience

Building Xamarin.Forms Applications with XAML

by Gill Cleeren

Jan 15, 2019 / 3h 43m

3h 43m

Start Course
Description

Xamarin.Forms, a technology from Microsoft, allows us to build cross-platform mobile applications that run on Android, iOS, and Windows where we write the code once, including the UI code. Writing these UIs is done using XAML. In this course, Building Xamarin.Forms Applications with XAML, you'll see how you can apply XAML to build mobile applications with Xamarin.Forms for the major mobile platforms. First, you'll learn the XAML language and its syntax. Next, you'll discover how you can build application UIs using pages, layouts, views and lists. Finally, you'll explore how to apply styles to simplify UI development. When you're finished with this course, you'll have the skills and knowledge of building UIs with XAML for real-world Xamarin.Forms applications.

Table of contents
  1. Course Overview
  2. Course Introduction
  3. Learning the XAML Syntax
  4. Building Pages and Layouts
  5. Using the Built-in Views in Xamarin.Forms
  6. Creating a List Screen
  7. Adding Styles to Your Application

Data Binding in Xamarin.Forms

by Gill Cleeren

May 3, 2019 / 2h 28m

2h 28m

Start Course
Description

Writing data-driven Xamarin.Forms mobile applications using a traditional code-behind approach can be tedious and error-prone. On top of that, this approach is hard to test and maintain. In this course, you will learn all there is to know about data binding in Xamarin.Forms, which allows us to link data in the view with data in the model. First, you will delve into data binding, its syntax, the BindingContext and binding modes. Next, you will discover how to use data binding in several real-life application screens. Finally, you will explore how to use data binding for list screens. When you are finished with this course, you will have the skills and knowledge of data binding needed to data-driven Xamarin.Forms applications. After watching this course, you’ll be on your way to create much cleaner code for your mobile line-of-business applications.

Table of contents
  1. Course Overview
  2. Course Introduction
  3. Overview of Data Binding in Xamarin.Forms
  4. Binding to a Single Object
  5. Binding to a Collection
  6. Advanced Data Binding Concepts
  7. Data Binding and MVVM

Intermediate

Take a deeper dive into Xamarin.Forms while you learn about data binding, responsive layouts, deployment and more advanced techniques.

Architecting Xamarin.Forms Applications for Code Reuse

by Jared Rhodes

Jan 29, 2020 / 1h 2m

1h 2m

Start Course
Description

As business requirements change, so do solution assumptions. In this course, Architecting Xamarin.Forms Applications for Code Reuse, you’ll learn different architectural patterns in Xamarin.Forms. First, you’ll explore project structure and organization. Next, you’ll discover patterns and standards to promote code sharing. Finally, you’ll learn how to utilize dependency injection in Xamarin.Forms. When you’re finished with this course, you’ll have the skills and knowledge of architecting Xamarin.Forms projects needed to optimally promote code reuse.

Table of contents
  1. Course Overview
  2. Solution Structure
  3. Common Code

Creating Responsive Layouts in Xamarin.Forms

by Jared Rhodes

May 19, 2020 / 1h 12m

1h 12m

Start Course
Description

Phones and Tablets come in all different shapes in sizes and there are more variations as time goes on. In this course, Creating Responsive Layouts in Xamarin.Forms, you’ll learn to create responsive applications that work on all the different types of interface sizes. First, you’ll explore different device types and form factors supported by Xamarin.Forms, and how the Xamarin.Forms API exposes that information. Next, you’ll discover the different types of layouts in Xamarin.Forms and when to use which ones in which scenarios. Finally, you’ll learn how to create responsive layouts in XAML with the previously mentioned layouts. When you’re finished with this course, you’ll have the skills and knowledge of layouts in Xamarin.Forms needed to create responsive apps.

Table of contents
  1. Course Overview
  2. Device Application Sizing
  3. Responsive Layouts in Xamarin.Forms
  4. XAML Sizing Rules

Navigation in Xamarin.Forms Applications

by Jared Rhodes

Apr 15, 2020 / 1h 5m

1h 5m

Start Course
Description

Xamarin.Forms provides multiple ways to set up navigation in your application. In this course, Navigation in Xamarin.Forms Applications, you’ll learn to create easy-to-navigate Xamarin.Forms applications. First, you’ll explore mobile application navigation patterns. Next, you’ll discover stack-based navigation in Xamarin.Forms. Finally, you’ll learn how to utilize the other navigation patterns provided by Xamarin.Forms. When you’re finished with this course, you’ll have the skills and knowledge of navigation in Xamarin.Forms needed to create easy-to-use applications.

Table of contents
  1. Course Overview
  2. Mobile App Navigation
  3. Stack-based Navigation
  4. Navigation Containers

Working with Native Features in Xamarin.Forms Applications

by Christopher Miller

Aug 7, 2020 / 1h 38m

1h 38m

Start Course
Description

When working in Xamarin.Form there are multiple ways to access native features. In this course, Working with Native Features in Xamarin.Forms Applications, you'll learn how to be able to access features specific to a platform from your Xamarin code. First, you will explore how to use Xamarin.Essentials to access settings and components that are common to multiple platforms. Next, you will see how to use the Device class to access device physical characteristics and make threadsafe UI calls from background threads. Then, you will delve into how to use the DependencyService class to access native features and extend existing functionality at the platform level. Finally, you will discover how to use Dependency Injection with the Microsoft.Extensions.DependencyInjection library as another way to access platform specific features. When you have finished the course, you will have the skills needed to access native features for your applications.

Table of contents
  1. Course Overview
  2. Course Introduction
  3. Using Xamarin.Essentials
  4. The Device Class
  5. Using the DependencyService Class
  6. Accessing Native Features through Dependency Injection

Getting Started with Xamarin.Essentials in Xamarin.Forms

by David Broadfoot

Oct 1, 2019 / 2h 22m

2h 22m

Start Course
Description

At the core of mobile app development is a thorough knowledge of native functionality offered on each platform. In this course, Getting Started with Xamarin.Essentials in Xamarin.Forms, you will gain an understanding of how to leverage these unique operating system and platform services through one common C# API. First, you will learn how to use device services such as geolocation, geocoding and text-to-speech. Next, you will explore device sensors such as the accelerometer, gyroscope, and compass. Finally, you will discover how to integrate with other apps including maps, phone and email. In total, you'll learn 33 native feature that Xamarin.Essentials unlocks on Android, iOS, and UWP devices. When you are finished with this course, you will be able to apply the different components of Xamarin.Essentials to bring native features into your own Xamarin.Forms project

Table of contents
  1. Course Overview
  2. Getting Started
  3. Using Device Services & Status
  4. Using Device Sensors
  5. Integrating with Other Apps
  6. Using Storage, System Info, and Other Helpers
  7. Keeping Code Testable

Creating List-based Screens in Xamarin.Forms

by Douglas Starnes

Feb 19, 2020 / 1h 46m

1h 46m

Start Course
Description

Take a look at popular mobile applications such as Twitter, Facebook, and YouTube. They all have one thing in common. The focus of the UI is a list of data items, but they all have customized styles and layouts. In this course, Creating List-based Screens in Xamarin.Forms, you’ll learn how to build data-driven mobile UIs with flexible and aesthetic layouts. First, you’ll explore the three types of list-based controls, the ListView, CollectionView, and TableView. Then, you'll discover how to craft the UI and how to respond to user touches. Next, you’ll delve into styling, resources, and techniques to easily create a consistent look across your application. Finally, you’ll learn how to harness the power of data binding with value converters and Model-View-ViewModel (MVVM). When you’re finished with this course, you’ll have the skills and knowledge of list-based screens in Xamarin.Forms needed to quickly develop data-driven applications with only one codebase.

Table of contents
  1. Course Overview
  2. List Views in Xamarin.Forms
  3. Collection Views in Xamarin.Forms
  4. Table Views in Xamarin.Forms
  5. Templates and Appearance
  6. Data Binding

Working with Styles in Xamarin.Forms Applications

by Thomas Claudius Huber

Jul 15, 2020 / 1h 47m

1h 47m

Start Course
Description

To avoid UI code duplication in your Xamarin.Forms apps is a thorough knowledge of reusing UI code with styles. In this course, Working with Styles in Xamarin.Forms Applications, you’ll learn how to use styles in your Xamarin.Forms apps to reuse UI code. First, you’ll explore what a style is and you will create your first implict, explicit, and global styles in XAML. Next, you’ll discover how to reuse UI code with advanced style features, like style inheritance, style classes and dynamic styles. Finally, you’ll learn how to style your Xamarin.Forms apps with Cascading Style Sheets (CSS). When you’re finished with this course, you’ll have the skills and knowledge of XAML Styles and CSS in Xamarin.Forms that is needed to create reusable and maintainable UI code in your applications.

Table of contents
  1. Course Overview
  2. Getting Started with Styles
  3. Reusing UI Code with Advanced Style Features
  4. Styling with Cascading Style Sheets (CSS)

Applying MVVM in Xamarin.Forms Applications

by Gill Cleeren

Apr 22, 2020 / 3h 54m

3h 54m

Start Course
Description

Xamarin.Forms allows developers to build Android and iOS mobile applications with a shared code-base. Because Xamarin.Forms allows sharing the UI code as well, a high level of code reuse is possible to create a more testable application, and that’s something that most enterprises look for when building mobile apps. In this course, Applying MVVM in Xamarin.Forms Applications, you’ll learn about building applications using MVVM. First, you’ll explore the pattern and the different building blocks. Then, you'll refactor a simple application to use MVVM. Next, you’ll see how to introduce common tasks into the application including navigation and showing dialogs. Finally, you’ll learn how you can make use of the MVVM pattern to allow for easier unit testing, proving the fact that MVVM-based applications are easily testable. After watching this course, you’ll have a good understanding of the concepts of MVVM as used to build testable Xamarin.Forms apps.

Table of contents
  1. Course Overview
  2. What You'll Learn in This Course
  3. Understanding the MVVM Pattern
  4. Applying the View Model Pattern
  5. Adding Commands for Interaction
  6. Working with Services and Navigation
  7. Testing an MVVM Architecture

Using the Xamarin.Forms Shell

by Christopher Miller

Dec 5, 2019 / 1h 31m

1h 31m

Start Course
Description

Creating apps take time, and in the world of technology creating applications at speed is crucial. In this course, Using the Xamarin.Forms Shell, you will learn foundational knowledge of Shell and the ability to create a Xamarin.Forms app. First, you will learn how Shell compares to the master/detail template. Next, you will dive into the Shell navigation types. Finally, you will explore how to use an icon font for scalable images on the flyout menu. When you’re finished with this course, you will know the basics of how to use Shell to quickly create a new app with Xamarin.Forms Shell.

Table of contents
  1. Course Overview
  2. Course Introduction
  3. Introduction to Xamarin.Forms Shell
  4. Understanding the Navigation Types
  5. Working with URI Navigation
  6. Using the Search Handler
  7. Styling the Shell

Working with Remote Data in Xamarin.Forms Applications

by Gill Cleeren

May 29, 2020 / 2h 9m

2h 9m

Start Course
Description

Using Xamarin.Forms, .NET developers have the ability to create mobile applications with ease. Nearly every application will need to communicate with a backend for data. In this course, Working with Remote Data in Xamarin.Forms Applications, you will learn how you can access remote data over services from your Xamarin.Forms applications. First, you will see the different supported service types, since Xamarin.Forms can’t communicate with just any service type. Next, you will discover how to communicate with SOAP and WCF services first. Then, you will explore a REST API and see how this can be accessed from Xamarin.Forms. Finally, you will understand how to make the service communication in Xamarin.Forms applications more resilient using retry and error handling. After finishing this course, you will have a good understanding of how your Xamarin.Forms applications can connect with services to access up-to-date data.

Table of contents
  1. Course Overview
  2. Understanding the Concepts of Working with Remote Data in Xamarin.Forms
  3. Working with Traditional Service Types from Xamarin.Forms
  4. Accessing Data behind a REST Service
  5. Advanced Concepts around Working with REST Services

Working with Local Data in Xamarin.Forms

by John Kuefler

Oct 15, 2019 / 1h 45m

1h 45m

Start Course
Description

Mobile apps that don't leverage local data storage for caching and offline access often present a less polished experience to the end user. In this course, Working with Local Data in Xamarin.Forms, you’ll learn how to use a variety of local data storage options to enhance your app’s performance and flexibility. First, you’ll explore the different storage options that are available, so you can make the best decision about which type of local storage to use. Next, you’ll discover how to create SQLite databases, the most robust option available. Then, you’ll learn how to create a model to map the database, with a code first/ORM style experience. Finally, you’ll get a better understanding on how to set up and access data in the SQLite database using the models you’ve created, enabling things like caching and offline access. When you’re finished with this course, you’ll have a foundational knowledge of local data storage in Xamarin.Forms that will help you as you move forward to high quality Xamarin.Forms app development.

Table of contents
  1. Course Overview
  2. Introduction
  3. Local Storage Options in Xamarin.Forms
  4. Setting up SQLite Databases
  5. Accessing Data in SQLite Databases

Extending Xamarin.Forms

by Jared Rhodes

Apr 15, 2020 / 1h 13m

1h 13m

Start Course
Description

Xamarin.Forms promises the ability to maximize code sharing while maintaining access to the native platforms. In this course, Extending Xamarin.Forms, you’ll learn to expose native platform functionality to Xamarin.Forms. First, you’ll explore extending control functionality by creating custom Renderers. Next, you’ll discover how to use Effects to expose functionality without as much ceremony as Renderers. Finally, you’ll learn how to utilize native views to expose functionality to Xamarin.Forms with even less ceremony by embedding them directly in a control. When you’re finished with this course, you’ll have the skills and knowledge of Effects, Renderers, and Native Views needed to extend Xamarin.Forms.

Table of contents
  1. Course Overview
  2. Native Functionality
  3. Using Effects
  4. Native Xamarin.Forms

Deploying and Distributing Xamarin.Forms Applications

by David Broadfoot

Jul 28, 2020 / 1h 55m

1h 55m

Start Course
Description

So you’ve finished developing your amazing Xamarin.Forms app, but how do you go from running it on your own phone to running on thousands - or even millions - of other devices? In this course, Deploying and Distributing Xamarin.Forms Applications, you’ll learn how to get your app out of Visual Studio and in to the hands of your future users. First, you'll discover how to prepare your application for release and how to sign the app on on iOS and Android. Then, you'll learn how to send ad hoc releases straight to tester's devices. Then you'll touch on using Apple's TestFlight and Google Play Tracks. Finally, you'll publish worldwide on the Google Play Store and Apple App Store, while also learning how to use App Center to automatically build and distribute the app. When you’re finished with this course, you’ll have the skills and knowledge needed to release a Xamarin.Forms app to users on iOS and Android.

Table of contents
  1. Course Overview
  2. Distributing Applications to Users
  3. Preparing the iOS App for Distribution
  4. Distributing through the Apple App Store
  5. Automating the iOS Deployment with App Center
  6. Preparing the Android App for Distribution
  7. Distributing through the Google Play Store
  8. Automating the Android Deployment with App Center

Testing Xamarin.Forms Applications

by James Millar

May 19, 2020 / 1h 15m

1h 15m

Start Course
Description

Improve the quality of your code and increase user satisfaction by adopting an effective testing strategy. In this course, Testing Xamarin.Forms Applications, you’ll learn to write effective unit tests and meaningful UI tests. First, you’ll explore the different types of testing available and what to test when. Then, you'll look at how to mock your dependencies and how to write effective unit tests. Finally, you’ll learn how to create UI tests to validate your user interface. When you’re finished with this course, you’ll have the skills and knowledge of testing needed to create higher quality Xamarin.Forms applications.

Table of contents
  1. Course Overview
  2. Understanding Xamarin.Forms Testing
  3. Unit Testing a Xamarin.Forms App
  4. UI Testing Using UITest

Xamarin.Forms: Localization

by Christopher Miller

Mar 19, 2019 / 1h 10m

1h 10m

Start Course
Description

How do you write an mobile app that supports multiple languages and cultures? What issues will you need to resolve? In this course, Xamarin.Forms: Localization, you will delve into the basics of localization and how to implement it with Xamarin.Forms. First, you will learn what localization is and why your app should be localized. Next, you will see how to implement localization with your app and how to use machine translation tools to provide a stepping stone to using professional translation services. Finally, you will explore how to test your app with multiple languages and regions. When you have completed this course, you will skills and knowledge of how localize your app so that it can be sold through the app stores through out the world.

Table of contents
  1. Course Overview
  2. What Is Localization and Why You Should Be Using It
  3. Preparing Your App for Localization
  4. Getting Your Resources Translated
  5. Building an App and Translating It
  6. Testing the App

Advanced

Continue learning about Xamarin with these courses which will cover advanced topics such as incorporating Google Maps, localization, and Enterprise Xamarin.

Integrating Google Maps into Xamarin.Forms Apps

by John Kuefler

Jan 28, 2019 / 1h 17m

1h 17m

Start Course
Description

Implementing customized maps into Xamarin.Forms apps isn't the most straightforward process. In this course, Integrating Google Maps into Xamarin.Forms Apps, you’ll learn foundational knowledge and gain the ability to integrate Google Maps into Xamarin Forms apps. First, you’ll explore when to use the built-in maps options, and when to look to Google Maps. Next, you’ll discover how to set up the API keys you need to make Google Maps work in Xamarin.Forms. Finally, you’ll learn how to set up and customize a Xamarin.Forms Google Map. When you’re finished with this course, you’ll have the skills and knowledge of Google Maps needed in Xamarin.Forms to integrate rich, interactive maps within your apps.

Table of contents
  1. Course Overview
  2. Introduction
  3. Obtaining a Google Maps API Key
  4. Implementing the Map
  5. Map Customization

Building an Enterprise Mobile Application with Xamarin.Forms

by Gill Cleeren

Jun 25, 2018 / 3h 38s

3h 38s

Start Course
Description

Xamarin.Forms is the preferred way for Microsoft developers to build applications that run on Android, iOS, and Windows. To use Xamarin.Forms for real applications that meet today’s requirements for flexibility and testability, you need to structure code according to industry-standard architecture guidelines. In this course, Building an Enterprise Mobile Application with Xamarin.Forms, you will learn how a real-life application is built with Xamarin.Forms. First, you will see a proposed architecture that promotes code-reuse as well as testability and maintainability. Next, you will learn how MVVM can be used in Xamarin.Forms. Then, you will create loose-coupling through messaging patterns and dependency injection, which are integrated in the proposed architecture. By the end of this course, you will have a good understanding of a real-life application architecture for Xamarin.Forms applications.

Table of contents
  1. Course Overview
  2. Introduction
  3. Creating a Layered Architecture
  4. Applying the MVVM Pattern
  5. Creating Loose Coupling Through Dependency Injection
  6. Communicating Components Through Messaging
  7. Setting up Navigation and Dialogs Within the Application
  8. Accessing Native Device Features and Controls
  9. Testing the Setup with Unit Tests