Take a look with me at some of the exciting features previewed for Xamarin Essentials 1.6, including integrated APIs and official macOS support!
Howdy!! 🙋♀️ I hope you are doing well! This time, I come with an amazing topic about the Preview from Xamarin Essentials 1.6. As you know, Xamarin Essentials is a superhero 🦸 that came to us to make our lives easier, giving us the advantage of having a set of useful APIs in the same Nuget package, thus improving our application development days. 🤓
⚠ Attention: If you started reading this article and you have never heard of Xamarin Essentials, I recommend you to read this article before continuing.
Let’s Start! 😍
In this version, we have a lot of good news! To explore it all, let’s start by breaking down the topics below:
- Official support for macOS
- Exploring the new integrated APIs
- And later?
Official Support for macOS
I really love how from the beginning the brilliant developers who have worked on the growth of Xamarin Essentials, such as the Microsoft team and the community, have focused on making this contribution grow more and more, integrating the support of new platforms. In this case, we welcome macOS.
It’s very exciting to know that, as of this version, most APIs are compatible with macOS Sierra (10.12.6). 💃 You can see more information about this topic here.
🕵️♀️ And Now, Let’s Explore the New Integrated APIs
📷 Screenshots: As its name says, it will allow us to integrate the power to take screenshots into our applications! I love this functionality. Let’s see an example of use.🧐 We have a flight application that, when the user confirms his flight, he needs to immediately send a screenshot of the action. ✈
You can get the image of the screenshot with the following example:
async Task CaptureScreenshot()
var screenshot = await Screenshot.CaptureAsync();
var stream = await screenshot.OpenReadAsync();
Image = ImageSource.FromStream(() => stream);
🧰 AppActions: Definitely one of my favorites! It allows us to make direct access to our app!! 😍
In this case, we can include simplified actions in our app that will be available only when the user accesses the shortcuts. As developers, we have total control of the creations and response of the user when tapping on each of the desired actions. No need to use a third-party resource! You can read more information about these topics here.
👩💻 Contact information
With a single line of code you can access the contacts on your mobile device! Isn’t this wonderful? Of course!! 🤩
All that with a line like this:
var contact = await Contacts.PickContactAsync();
You can obtain information such as the following:
||Example to use
var name = contact.Name;
|Type (Unknown, Personal, Work)
var contactType = contact.ContactType;
|Telephone numbers available
var numbers = contact.Numbers;
var emails = contact.Emails;
🌄 MediaPicker and FilePicker:
These features save us a lot of time! We can now quickly access the functions of our device. 🤓 We can choose photos or video files or take them from the camera!!! You can read more information in the following links: MediaPicker & FilePicker.
👩💻 Haptic Feedback: This class lets you control haptic feedback on device. This feedback can be performed with a
LongPress feedback type. You can read more information here.
And that’s not all. In addition to all the explained above, when the team completes the last 1.6 update, you will see amazing other things like the following!
📒 Adjustments and optimizations to existing APIs
📗 Correction of existing errors
📒 Permissions API expansion
I hope this article encourages you to implement these wonderful features! See you next time!
Thanks for reading! 💚