News

Xamarin.Essentials Cross-Platform Mobile APIs Get Updates

Microsoft's mobile dev team continues to update Xamarin.Essentials, which provide cross-platform APIs for a variety of device-specific features and functionality in iOS and Android apps.

Introduced at the company's Build conference in May, the open source Xamarin.Essentials provides cross-platform APIs that works with any iOS, Android or Universal Windows Platform (UWP) application that can be accessed from shared C# code no matter how the UI is created. That frees developers from the hassle of learning three different APIs to access specific iOS, Android and UWP functionality.

Some 30 APIs are provided for common tasks like file access, device info, hardware features and more, with specific APIs ranging from Accelerometer to Geolocation to Vibrate.

The recent Visual Studio 2017 15.8 Preview 3 included the addition of Xamarin.Essentials APIs to VS 2017 Xamarin templates.

The Xamarin.Essentials project was also showcased in a recent Visual Studio Live! conference keynote by Microsoft's James Montemagno, principal program manager, Mobile Developer Tools. Noting that the Xamarin.Essentials library of APIs is provided in a single NuGet package, he said, "You can access it from any Android, iOS, Windows, or Xamarin.Forms application, so you have one API to learn to do geolocation, key store access, sensor support, phone dialer, or device display information -- one API that can be shared natively. That's the future of where we are going."

Shortly after that conference, Montemagno announced more APIs in a blog post. One is an Orientation sensor API that lets developers subscribe to reading changes reported back as a Quaternion, describing rotation of the Earth’s coordinate system relative to the device’s coordinate system, useful for creating applications that need access to 3D space.

Another is the MainThread API, helping developers detect when an app is currently on the main thread and also begin a UI update on the main thread. Simplified Android dependencies were also provided based on developer feedback, building the project against Android 8.1 (API 27), with the updated dependencies of two Android Support libraries, CustomTabs and Core.Utils.

While those were provided in the second Xamarin.Essentials preview release, 0.7.0-preview, even more updates were added a few days ago, according to the project's release notes. These, in the 0.8.0-preview, include a new "Open Settings on AppInfo" API, the addition of Altitude to the Geolocation API and more.

For more information on Xamarin.Essentials see the full documentation and an introductory video.

About the Author

David Ramel is the editor of Visual Studio Magazine.

comments powered by Disqus
Most   Popular
Upcoming Events

.NET Insight

Sign up for our newsletter.

Terms and Privacy Policy consent

I agree to this site's Privacy Policy.