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)

What this book covers

Chapter 1, Introduction to Xamarin, explains the basic concepts of Xamarin and Xamarin.Forms. It helps you understand the building blocks of how to create a true cross-platform app. It's the only theoretical chapter of the book and will help you get started and set up your development environment.

Chapter 2, Building Our First Xamarin.Forms App, guides you through the concepts of Model-View-ViewModel and explains how to use the Inversion of Control pattern to simplify the creation of Views and ViewModels. We will create a to-do app that supports navigation, filtering, and the adding of to-do items to a list, and will also render a user interface that takes advantage of the powerful data-binding mechanisms in Xamarin.Forms.

Chapter 3, Building a News App Using Xamarin.Forms Shell, explores one of the biggest pieces of news in Xamarin.Forms 4 –Shell, a new way to define the structure of Xamarin.Forms apps. There is also a new navigation system. In this chapter, you will learn all you have to know to use Shell in a Xamarin.Forms app.

Chapter 4, A Matchmaking App with a Rich UX Using Animations, lets you dive deeper into how to define a richer user interface with animations and content placement. It also covers the concept of custom controls to encapsulate the user interface into components that are self-contained.

Chapter 5, Building a Photo Gallery App Using CollectionView and CarouselView, details how Xamarin.Forms 4 introduces CollectionView and CarouselView. In this chapter, we will use them to build a photo gallery app to learn how to master the controls.

Chapter 6, Building a Location Tracking App Using GPS and Maps, taps into the use of geolocation data from the device's GPS and how to plot this data on a layer on a map. It also explains how to use background services to keep tracking the location over a long period of time to create a heat map of where you spend your time.

Chapter 7, Building a Weather App for Multiple Form Factors, is all about consuming a third-party REST interface and displaying the data in a user-friendly way. We will hook up to a weather service to get the forecast for the current location you are in and display the results in a list.

Chapter 8, Setting Up a Backend for a Chat App Using Azure Services, is the first of a two-part chapter in which we'll set up a chat app. This chapter explains how to use Azure Services to create a backend that exposes functionality through SignalR to set up a real-time communication channel between apps.

Chapter 9, Building a Real-Time Chat Application, follows on from the previous chapter and covers the frontend of the app, in this case, a Xamarin.Forms app that connects to the backend and that relays messages between users. The chapter focuses on setting up SignalR on the client side and explains how to create a service model that abstracts this communication through messages and events.

Chapter 10, Creating an Augmented Reality Game, ties the two different AR APIs into a single UrhoSharp solution. Android uses ARCore to handle augmented reality, and iOS uses ARKit to do the same. We will drop down into platform-specific APIs through custom renderers and expose the result as a common API for the Xamarin.Forms app to consume.

Chapter 11, Hot Dog or Not Hot Dog Using Machine Learning, covers the creation of an app that uses machine learning to identify whether an image contains a hot dog or not.