XamarinT2 Dark_1200x303

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:

Name Example to use
Contact name var name = contact.Name;
Type (Unknown, Personal, Work) var contactType = contact.ContactType;
Telephone numbers available var numbers = contact.Numbers;
Email 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 Click or LongPress feedback type. You can read more information here.

And Later?

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! πŸ’š

References:

https://devblogs.microsoft.com/xamarin/xamarin-essentials-1-6-preview/

https://docs.microsoft.com/en-us/xamarin/essentials/

https://docs.microsoft.com/en-us/xamarin/essentials/screenshot?context=xamarin/xamarin-forms

https://docs.microsoft.com/en-us/xamarin/essentials/haptic-feedback?context=xamarin%2Fxamarin-forms&tabs=android


LeomarisReyes
About the Author

Leomaris Reyes

Leomaris Reyes is a Software Engineer from the Dominican Republic, with more than 5 years of experience. A Xamarin Certified Mobile Developer, she is also the founder of  Stemelle, an entity that works with software developers, training and mentoring with a main goal of including women in Tech. Leomaris really loves learning new things! πŸ’šπŸ’• You can follow her: Twitter, LinkedIn , AskXammy and Medium.

Related Posts

Comments

Comments are disabled in preview mode.