Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
.NET MAUI Projects - Third Edition

You're reading from  .NET MAUI Projects - Third Edition

Product type Book
Published in Feb 2024
Publisher Packt
ISBN-13 9781837634910
Pages 630 pages
Edition 3rd Edition
Languages
Authors (3):
Michael Cummings Michael Cummings
Profile icon Michael Cummings
Daniel Hindrikes Daniel Hindrikes
Profile icon Daniel Hindrikes
Johan Karlsson Johan Karlsson
Profile icon Johan Karlsson
View More author details

Table of Contents (18) Chapters

Preface 1. Part 1: Introduction
2. Chapter 1: Introduction to .NET MAUI 3. Chapter 2: Building Our First .NET MAUI App 4. Chapter 3: Converting a Xamarin.Forms App into .NET MAUI 5. Part 2: Basic Projects
6. Chapter 4: Building a News App Using .NET MAUI Shell 7. Chapter 5: A Matchmaking App with a Rich UX Using Animations 8. Chapter 6: Building a Photo Gallery App Using CollectionView and CarouselView 9. Chapter 7: Building a Location Tracking App Using GPS and Maps 10. Chapter 8: Building a Weather App for Multiple Form Factors 11. Part 3: Advanced Projects
12. Chapter 9: Setting Up a Backend for a Game Using Azure Services 13. Chapter 10: Building a Real-Time Game 14. Chapter 11: Building a Calculator Using .NET MAUI Blazor 15. Chapter 12: Hot Dog or Not Hot Dog Using Machine Learning 16. Index 17. Other Books You May Enjoy

.NET mobile productivity tooling

Xamarin Hot Restart and Hot Reload are two tools that increase productivity for .NET MAUI developers. To get even better performance from your Android emulators, you can use the Windows Subsystem for Android (WSA).

Xamarin Hot Restart

Hot Restart is a Visual Studio feature 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:

  • Visual Studio 2019 version 16.5
  • iTunes (Microsoft Store or 64-bit versions)
  • An Apple Developer account and paid Apple Developer Program (https://developer.apple.com/programs/) enrollment

Hot Restart can currently only be used with .NET for iOS apps.

Read more about the current state of Hot Restart at https://docs.microsoft.com/en-us/xamarin/xamarin-forms/deploy-test/hot-restart.

Hot Reload

Hot Reload is a runtime technology that allows us to update our running app with the changes we are making in the IDE. There are two major flavors of Hot Reload today: XAML Hot Reload and C# Hot Reload.

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 supported by all .NET MAUI platforms.

C# Hot Reload allows us to make changes to our code without having to redeploy our app. C# Hot Reload is like Edit & Continue; however, you do not have to be in break mode in order to apply the changes to the app. Once you have made changes to your code, you can click the Hot Reload button in the toolbar of Visual Studio and Hot Reload will update the running app. If, for some reason, the changes cannot be applied, Hot Reload will display a dialog either asking you to fix any compilation errors or, in some cases, requiring you to restart the app.

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

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

C# Hot Reload is only available in Visual Studio for Windows; to enable it, go to Tools | Options | Debugger | .NET / C++ Hot Reload.

Windows Subsystem for Android

If you are using Windows 11 in a supported region, you can use WSA as your debugging target instead of the Android emulators. To learn more about WSA and how to set up your machine to use it, visit https://learn.microsoft.com/en-us/windows/android/wsa/.

If you want to use WSA to debug your .NET MAUI apps, it will help if you install the WSA Barista Visual Studio extension (https://marketplace.visualstudio.com/items?itemName=Redth.WindowsSubsystemForAndroidVisualStudioExtension). This will add the Windows Subsystem for Android menu item under Tools, which will prompt you to install WSA from the Windows Store, and then automatically configure WSA and set up Visual Studio to use WSA as a device.

You have been reading a chapter from
.NET MAUI Projects - Third Edition
Published in: Feb 2024 Publisher: Packt ISBN-13: 9781837634910
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}