Harness the powerful features of .NET MAUI to create multi-platform app projects using location services, the weather API, machine learning, and much more Key Features Learn from real-world examples and develop multi-platform apps and games using AR and services of varying complexity Explore the essential features of .NET MAUI such as Shell, CollectionView, and CarouselView Get to grips with advanced concepts such as machine learning and cloud services for mobile development Purchase of the print or Kindle book includes a free PDF eBook Book Description This third edition of .NET MAUI Projects explores the features of .NET MAUI, a lightweight multi-platform development toolkit for building apps with a rich user interface. Updated to cover the latest features of .NET MAUI, including CollectionView and Shell, this book delves into concepts such as machine learning and cloud services. Starting with an overview of .NET Core and how it works, this book shares tips for choosing the right development environment for planning multi-platform apps. You'll then build your first .NET MAUI app and advance to learning how to use Shell to implement app architecture. Progressing in complexity, the projects guide you through creating apps, ranging from a location tracker and weather map to machine learning and multiplayer games. Further, the book will take you through modern mobile development frameworks such as SQLite, .NET Core, and ML.NET, empowering you to customize your apps for Windows, macOS, Android, and iOS platforms for native-like performance. Engaging examples are woven throughout the book so you can grasp essential concepts by writing code rather than extensive theory. By the end of this book, you'll be ready to develop your own native apps using .NET MAUI and associated technologies such as .NET Core, Visual Studio 2022, and C#. What you will learn Set up .NET MAUI to build native apps for multiple platforms using its single project capabilities Understand the core aspects of developing a mobile app, such as layout, UX, and rendering Use custom handlers for platform-specific access Discover how to create custom layouts for your apps with .NET MAUI Shell Implement serverless services in your .NET MAUI apps using Azure SignalR Create a .NET MAUI Blazor application leveraging the power of web technologies Build and train machine learning models using ML.NET and Azure Cognitive Services Who this book is for This book is for C# and .NET developers who want to learn .NET MAUI and get started with native .NET Core mobile application development from the ground up. Working knowledge of Visual Studio and C# will help you to get the most out of this book. Table of Contents Introduction to .NET MAUI Building Our First .NET MAUI App Converting a Xamarin.Forms App to .NET MAUI Building a News App Using .NET MAUI Shell Building a Matchmaking App with a Rich UX Using Animations Building a Photo Gallery App Using CollectionView and CarouselView Building a Location Tracking App Using GPS and Maps Building a Weather App for Multiple Form Factors Setting Up a Backend for Sticks and Squares Using Azure Services Building a Real-Time Game Building a Calculator Using .NET MAUI Blazor Hot Dog or Not Hot Dog Using Machine Learning Cover Title Page Copyright Dedication Foreword Contributors Table of Contents Preface Part 1: Introduction Chapter 1: Introduction to .NET MAUI Defining native applications .NET mobile Code sharing Use of existing knowledge .NET mobile platforms Exploring the .NET MAUI framework The architecture of .NET MAUI Defining a UI using XAML .NET MAUI versus traditional .NET mobile Setting up our development machine Setting up a Mac Setting up a Windows machine .NET mobile productivity tooling Xamarin Hot Restart Hot Reload Windows Subsystem for Android Summary Chapter 2: Building Our First .NET MAUI App Technical requirements Project overview Setting up the project Creating the new project Examining the files Updating the .NET MAUI packages Creating a repository and a TodoItem model Defining a to-do list item Creating a repository and its interface Connecting SQLite to persist data Using MVVM – creating views and ViewModels Defining a ViewModel base class Introducing the CommunityToolkit.Mvvm library’s ObservableObject and ObservableProperty Creating MainViewModel Creating TodoItemViewModel Creating the ItemViewModel class Creating the MainView view Creating the ItemView view Wiring up dependency injection Making the app run Adding data bindings Navigating from MainView to ItemView to add a new item Adding new items to the list Binding ListView in MainView Creating a ValueConverter object for the item’s status Navigating to an item using a command Marking an item as complete using a command Creating the filter toggle function using a command Laying out the contents Setting an application-wide background color Laying out the MainView and ListView items Summary Chapter 3: Converting a Xamarin.Forms App into .NET MAUI Technical requirements Project overview Migrating into a blank .NET MAUI template Creating a new Xamarin.Forms app Creating a new .NET MAUI app Migrating the MauiMigration app to MyMauiApp Manual migration overview Converting the Xamarin.Forms projects from .NET Framework into .NET SDK style Updating code from Xamarin.Forms to .NET MAUI Updating any incompatible NuGet packages Addressing any breaking API changes Custom renderers and effects Running the converted app and verifying its functionality Installing and running .NET Upgrade Assistant Installing .NET Upgrade Assistant Preparing to run .NET Upgrade Assistant Running .NET Upgrade Assistant Summary Part 2: Basic Projects Chapter 4: Building a News App Using .NET MAUI Shell Technical requirements Project overview Building the news app Setting up the project Creating the structure of the app Creating the news service Wiring up the NewsService class Handling navigation Summary Chapter 5: A Matchmaking App with a Rich UX Using Animations Technical requirements Project overview Creating the matchmaking app Setting up the project Creating the Swiper control Testing the control Wiring up the Swiper control Summary Chapter 6: Building a Photo Gallery App Using CollectionView and CarouselView Technical requirements Project overview Building the photo gallery app Creating the new project Importing photos Creating the gallery view Summary Chapter 7: Building a Location Tracking App Using GPS and Maps Technical requirements Project overview Building the MeTracker app Creating a repository to save the locations of the users Creating a service for location tracking Setting up the app logic Background location tracking on iOS and Mac Catalyst Background location tracking with Android Creating a heat map Creating a custom control for the map Refreshing the map when the app resumes Summary Chapter 8: Building a Weather App for Multiple Form Factors Technical requirements Project overview Building the weather app Creating models for the weather data Creating a service to fetch the weather data Configuring the application platforms so that they use location services Creating the ViewModel class Creating the view for tablets and desktop computers Creating the view for phones Adding services and ViewModels to dependency injection Navigating to different views based on the form factor Handling states with VisualStateManager Summary Part 3: Advanced Projects Chapter 9: Setting Up a Backend for a Game Using Azure Services Technical requirements Project overview An overview of the game Understanding the different Azure serverless services Azure SignalR Service Azure Functions Building the serverless backend Creating a SignalR service Using Azure Functions as an API Deploying the functions to Azure Summary Chapter 10: Building a Real-Time Game Technical requirements Project overview Getting started An overview of the game Building the game app Creating the game services Creating the Connect page Creating the Lobby page Creating the Match page Testing the completed project Summary Chapter 11: Building a Calculator Using .NET MAUI Blazor Technical requirements Project overview What is Blazor? Creating the calculator app Setting up the project Creating the Keypad view Creating the Compute service Adding memory functions Resizing the main window Summary Chapter 12: Hot Dog or Not Hot Dog Using Machine Learning Technical requirements Machine learning Azure Cognitive Services – Custom Vision Core ML TensorFlow ML.Net The project overview Getting started Building the Hot Dog or Not Hot Dog application using machine learning Training a model Building the app Summary Index About PACKT Other Books You May Enjoy Harness the powerful features of.NET MAUI, the evolution of Xamarin.Forms, to create multi-platform app projects using location services, the weather API, machine learning, and much moreKey FeaturesLeverage.NET MAUI through real-world projects, from weather apps to real-time multiplayer games with SignalR and Azure FunctionsExplore the essential features of.NET MAUI such as Shell, CollectionView, and CarouselViewGo beyond the basics with advanced topics like machine learning using TensorFlow and ML.NETPurchase of the print or Kindle book includes a free PDF eBookBook DescriptionThis third edition of.NET MAUI Projects explores the features of.NET MAUI, a lightweight multi-platform development toolkit for building apps with a rich user interface. Updated to cover the latest features of.NET MAUI, including CollectionView and Shell, this book delves into concepts such as machine learning and cloud services. Starting with an overview of.NET Core and how it works, this book shares tips for choosing the right development environment for planning multi-platform apps. You'll then build your first.NET MAUI app and advance to learning how to use Shell to implement app architecture. Progressing in complexity, the projects guide you through creating apps, ranging from a location tracker and weather map to machine learning and multiplayer games. Further, the book will take you through modern mobile development frameworks such as SQLite,.NET Core, and ML.NET, empowering you to customize your apps for Windows, macOS, Android, and iOS platforms for native-like performance. Engaging examples are woven throughout the book so you can grasp essential concepts by writing code rather than extensive theory. By the end of this book, you'll be ready to develop your own native apps using.NET MAUI and associated technologies such as.NET Core, Visual Studio 2022, and C#.What you will learnSet up.NET MAUI to build native apps for multiple platforms using its single project capabilitiesUnderstand the core aspects of developing a mobile app, such as layout, UX, and renderingUse custom handlers for platform-specific accessDiscover how to create custom layouts for your apps with.NET MAUI ShellImplement serverless services in your.NET MAUI apps using Azure SignalRCreate a.NET MAUI Blazor application leveraging the power of web technologiesBuild and train machine learning models using ML.NET and Azure Cognitive ServicesWho this book is forThis book is for C# and.NET developers who want to learn.NET MAUI and get started with native.NET Core mobile application development from the ground up. Working knowledge of Visual Studio and C# will help you to get the most out of this book.