Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
lawrence_shaun_introducing_net_maui_build_and_deploy_crosspl.pdf
Скачиваний:
46
Добавлен:
26.06.2023
Размер:
5.15 Mб
Скачать

CHAPTER 11

Getting Specific

In this chapter, you will be learning about .NET MAUI Essentials and how it enables you to access platform-specific APIs without having to worry about any of the platform-specific complexities. Two concrete examples of are requesting permissions on each platform and accessing the device’s geolocation information. You will explore what is required if you really do need to interact with platform-specific APIs that have not been abstracted for you. Finally, you will cover multiple techniques, concepts, and architectures that enable you to tweak the UI and behavior of your applications based on the platforms they are running on.

.NET MAUI Essentials

In the previous chapter, you created a Weather widget. You did not finish the job, though, as it currently only loads the weather for Maui, Hawaii. I don’t know about you, but I am not lucky enough to live there! In this section, you will discover what the current device’s location is in terms of longitude and latitude, and you will then send that information up to the Open Weather API for a much more accurate weather summary of the user’s current location.

In order to achieve this, you need an understanding of two key concepts: the permissions system of each operating system, and how to access the APIs specific to GPS coordinates. Thankfully .NET MAUI has

© Shaun Lawrence 2023

335

S. Lawrence, Introducing .NET MAUI, https://doi.org/10.1007/978-1-4842-9234-1_11