Book Image

Xamarin.Forms Projects - Second Edition

By : Daniel Hindrikes, Johan Karlsson
Book Image

Xamarin.Forms Projects - Second Edition

By: Daniel Hindrikes, Johan Karlsson

Overview of this book

Xamarin.Forms is a lightweight cross-platform development toolkit for building apps with a rich user interface. Improved and updated to cover the latest features of Xamarin.Forms, this second edition covers CollectionView and Shell, along with interesting concepts such as augmented reality (AR) and machine learning. Starting with an introduction to Xamarin and how it works, this book shares tips for choosing the type of development environment you should strive for when planning cross-platform mobile apps. You’ll build your first Xamarin.Forms app and learn how to use Shell to implement the app architecture. The book gradually increases the level of complexity of the projects, guiding you through creating apps ranging from a location tracker and weather map to an AR game and face recognition. As you advance, the book will take you through modern mobile development frameworks such as SQLite, .NET Core Mono, ARKit, and ARCore. You’ll be able to customize your apps for both Android and iOS platforms to achieve native-like performance and speed. The book is filled with engaging examples, so you can grasp essential concepts by writing code instead of reading through endless theory. By the end of this book, you’ll be ready to develop your own native apps with Xamarin.Forms and its associated technologies, such as .NET Core, Visual Studio 2019, and C#.
Table of Contents (13 chapters)


You should now feel a bit more comfortable about what Xamarin is and how Xamarin.Forms relates to Xamarin itself.

In this chapter, we established a definition of what a native app is and saw how it has a native UI, native performance, and native API access. We talked about how Xamarin is based on Mono, which is an open source implementation of the .NET framework, and discussed how, at its core, Xamarin is a set of bindings to platform-specific APIs. We then looked at how Xamarin.iOS and Xamarin.Android work under the hood.

After that, we began to touch on the core topic of this book, which is Xamarin.Forms. We started off with an overview of how platform-agnostic controls are rendered to platform-specific controls and how to use XAML to define a hierarchy of controls to assemble a page. We then spent some time looking at the difference between a Xamarin.Forms app and a traditional Xamarin app.

A traditional Xamarin app uses platform-specific APIs directly, without any abstraction, other than what .NET adds as a platform. Xamarin.Forms is an API that is built on top of the traditional Xamarin APIs and allows us to define platform-agnostic GUIs in XAML or in code that is rendered to platform-specific controls. There's more to Xamarin.Forms than this, but this is what it does at its core.

In the last part of this chapter, we discussed how to set up a development machine on Windows or macOS.

Now, it's time to put our newly acquired knowledge to use! We will start off by creating a to-do app from the ground up in the next chapter. We will look at concepts such as Model–View–ViewModel (MVVM) for a clean separation between business logic and the UI, and SQLite.NET to persist data to a local database on our device. We will do this for three platforms at the same time—so, read on!