What this book covers
Chapter 1, Getting Started, will start off by quickly reviewing the basics of the Xamarin.Forms toolkit. We will then walk through building a simple app with Xamarin.Forms, called TripLog. The TripLog app will serve as the foundation that we build upon throughout the rest of the book by applying new techniques and concepts in each subsequent chapter.
Chapter 2, MVVM and Data Binding, will introduce the Model-View-ViewModel (MVVM) pattern and the benefits of using it in a mobile app architecture. We will then walk through updating the TripLog app with ViewModels that provide data for the app's pages through data binding.
Chapter 3, Navigation Service, will explain how navigation works in Xamarin.Forms, some of its shortcomings, and how to overcome them. We will build a custom navigation service for the TripLog app that extends the one provided by Xamarin.Forms to provide a navigation model that occurs solely at the ViewModel level, decoupled from the pages themselves.
Chapter 4, Platform Specific Services and Dependency Injection, will discuss the power of the dependency injection and Inversion of Control (IoC) patterns, specific to multi-platform mobile development. We will discuss how to use a third-party IoC library within the TripLog app, in the place of Xamarin.Forms's default DependencyService. We will then build a couple of services that are dependent on platform-specific APIs and use them within the TripLog app through dependency injection.
Chapter 5, User Interface, will explain how to tap into platform-specific APIs using custom renderers in Xamarin.Forms. We will also discuss the use of value converters to customize the appearance of data at the time of binding.
Chapter 6, API Data Access, will explain how to set up a new API using Microsoft Azure App Services. We will then walk through how to connect the TripLog app to the API to get its data and how to set up caching for offline use.
Chapter 7, Authentication, will explain how to set up authentication on the API created in the previous chapter, and then how to add sign in and authentication to the TripLog app.
Chapter 8, Testing, will discuss the importance of testing in mobile apps. We will walk through how to take advantage of the patterns introduced throughout the book to easily unit test the ViewModels within the TripLog app. We will also use Xamarin's UITest framework to build automated UI tests for the TripLog app that can be run on Xamarin Test Cloud.
Chapter 9, App Analytics, will explain the importance of crash reporting and collecting user data in mobile apps. We will then integrate Xamarin Insights into the TripLog app using the service dependency pattern implemented in Chapter 4, Platform Specific Services and Dependency Injection.
Because the focus of this book is on applying patterns and best practices to apps built with Xamarin.Forms and not on the actual specifics of Xamarin.Forms, the chapters will only use a single platform, iOS, for simplicity. However, the architectural concepts in the book will apply to all platforms and any platform-specific code, such as platform services or custom renderers, will be included for iOS, Android, and Windows within the example code that is available for download with the purchase of this book.