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 an editor and writer for Converge360.

comments powered by Disqus

Featured

  • Full Stack Hands-On Development with .NET

    In the fast-paced realm of modern software development, proficiency across a full stack of technologies is not just beneficial, it's essential. Microsoft has an entire stack of open source development components in its .NET platform (formerly known as .NET Core) that can be used to build an end-to-end set of applications.

  • .NET-Centric Uno Platform Debuts 'Single Project' for 9 Targets

    "We've reduced the complexity of project files and eliminated the need for explicit NuGet package references, separate project libraries, or 'shared' projects."

  • Creating Reactive Applications in .NET

    In modern applications, data is being retrieved in asynchronous, real-time streams, as traditional pull requests where the clients asks for data from the server are becoming a thing of the past.

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

Subscribe on YouTube