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)

Xamarin productivity tooling

Xamarin Hot Restart and Xamarin Hot Reload are two tools that increase productivity for Xamarin developers.

Xamarin Hot Restart

Hot Restart is a Visual Studio feature, which is currently in preview, to make developers more productive. It also gives us a way of running and debugging iOS apps on an iPhone without having to use a Mac connected to Visual Studio. Microsoft describes Hot Restart as follows:

"Xamarin Hot Restart enables you to quickly test changes to your app during development, including multi-file code edits, resources, and references. It pushes the new changes to the existing app bundle on the debug target which results in a much faster build and deploy cycle."

To use Hot Restart, you need the following:

Hot Restart can currently only be used with Xamarin.Forms apps.

To activate Hot Restart, go to Tools | Options | Environment | Preview Features | Enable Xamarin Hot Restart.

Read more about the current state of Hot Restart at

Xamarin XAML Hot Reload

Xamarin XAML Hot Reload allows us to make changes to our XAML without having to redeploy our app. When we have carried out changes to the XAML, we just save the file and it updates the page on the simulator/emulator or on a device. XAML Hot Reload is currently only supported by iOS and Android.

To enable XAML Hot Reload for Visual Studio on Windows, go to Visual Studio | Preferences | Tools for Xamarin | XAML Hot Reload.

To enable XAML Hot Reload for Visual Studio on Mac, go to Tools | Options | Xamarin | Hot Reload.

To use XAML Hot Reload, we have to use Xamarin.Forms 4.1+ with Visual Studio 2019 16.4+ (or Visual Studio for Mac 8.4+).