Howdy! I’m very excited that you, dear reader, are here. In this article, we will be answering a question most developers have had in mind ever since the news of .NET MAUI broke: What will happen to Xamarin Essentials?
Also, we will be talking about the future of applications that already use Xamarin Essentials, and we’ll take a small tour of some of the great APIs that we can continue using in .NET MAUI!
Introducing .NET MAUI Essentials
In .NET MAUI, we are going to continue working with the wonderful set of APIs provided by Xamarin Essentials, but it will be called .NET MAUI Essentials. Just like Xamarin Essentials, it is a set of cross-platform APIs that allow access to the amazing functionalities of different platforms such as Android, iOS, and UWP, which you can access from shared code in .NET MAUI. The Microsoft team has been actively working to make this a smooth transition to .NET MAUI.
When will .NET MAUI Essentials be available?
It’s available now! Preview 6 of .NET 6 and .NET MAUI gave us access to all the APIs that Xamarin Essentials provided to us in Xamarin, but for .NET MAUI.
For this reason, if you go into the .csproj file, you will see that the UseMaui tag is already present in a line similar to <UseMaui>true</UseMaui>.
You just have to add the namespace using Microsoft.Maui.Essentials; and you can continue working as before!
What if I want to upgrade my Xamarin.iOS and Xamarin.Android apps to .NET 6 without .NET MAUI?
Some developers want to migrate to .NET 6 without .NET MAUI, but still want access to the .NET MAUI Essentials set of APIs.
To do so, they just need to add <UsingMauiEssentials>true</UsingMauiEssentials> to their .NET 6 iOS and Android apps to incorporate all the latest APIs.
Let’s take a tour some of the most exciting APIs from Xamarin Essentials
Here are some of my favorite APIs available in Xamarin Essentials!
- SMS: Imagine you want to copy a message from your application and paste it in an SMS message. This could prove difficult depending on the device. As part of being a developer, it is our responsibility to provide a good user experience. In this case, we should strive to accomplish the task in fewer steps without altering the result. With the SMS API, you can open the device SMS sender with all the corresponding data already added—you just have to hit send! This is why I love it!
- Email: This API allows us to send email quickly and easily without affecting the performance of the application.
- Share: We want to share files all the time, sometimes to support some information we just shared, or to make information more clear. This is where the Share API comes in handy.
- Preferences: I love Preferences! This API helps us save information on the device to make certain functionalities easier. For example, we can use it to save an email address the end user uses to log in to an app so they don’t have to re-enter it every time.
- Map: The Map API gives us a simple, precise, and concise way to guide a user to a certain location from within our application.
- Contacts: The Contacts API helps us obtain information from the contacts saved to the device and interact with it directly.
- Flashlight: This is just one example of an API that helps us manage a specific hardware functionality from our app. Others include Accelerometer, Barometer, and Battery.
There are other super useful and impressive APIs that if you have not inspected them, I recommend you to take a look!
Note: To learn more about APIs, refer to Xamarin.Essentials documentation.
Important points to remember leading up to .NET MAUI:
- Microsoft will continue supporting Xamarin Essentials until November 2022 (same schedule as Xamarin.Forms). Requests for bug fixes and new versions of services will be released and will continue to be accepted until November 2022.
- Your experience with .NET MAUI Essentials in .NET MAUI Preview 6 is very important to its development. You can share your thoughts by interacting with the developers responsible by accessing the dotnet/maui GitHub repo.
- Also, take a look at the .NET MAUI product roadmap to see what else is on the way.
I hope you’re even more excited about .NET MAUI than you were before reading! .NET MAUI represents an enormous milestone for cross-platform development, and I, for one, cannot wait to see what the developer community is going to do with it.
The Syncfusion .NET MAUI suite offers more than 10 UI controls and libraries to build .NET MAUI applications. Try them out and share your feedback with us.
Thanks for reading!