Category: macOS

  • IOBluetooth for .NET Refreshed

    Some time ago, I embarked on a binding library for the macOS IOBluetooth framework. This provides functionality for classic Bluetooth, Hands-free and Object Exchange functionality. It was built for Xamarin Mac and needed a big overhaul to support newer .NET versions.

    Today I’ve release a pre-release package for version 1.2. This is build with .NET 9.0 and 10.0. It has gone through a number of changes, to improve the API and its documentation. It is not complete, and there may be further renaming required which is why I’ve marked this release as a preview. At the moment the hands-free and Obex functionality are largely untested.

    Generally all elements are renamed to follow .NET conventions. Like the in-box .NET framework wrappers the class names have the IOBluetooth prefix stripped and all sit in the IOBluetooth namespace. The only exception is IOBluetoothDevice is called BluetoothDevice because Device seemed a bit too generic.

    I’ve now completed a definition of the IOReturn enumeration which represents all the possible return values from various low-level API calls. IOBluetooth uses these on a number of methods and delegates so this makes it easier to identify meaningful error codes rather than the raw numbers.

    There is also the IOBluetoothUI companion library for a UI device picker etc.

    I’m always open to suggestions so please get involved in the GitHub project if you have feedback/suggestions/issues.

  • Xamarin Forms MediaElement now available for macOS

    As the Pull Request to Xamarin Forms continues in its holding pattern I thought about what else I can do with it. I had neglected the original codebase for a while but I’ve spent some more time with it recently providing some much needed updates. The latest which was added to NuGet today adds a whole new platform – macOS.

    The functionality is almost exactly the same as that available on iOS with the exception of the KeepScreenOn property as I haven’t found the equivalent macOS APIs to implement this. The sample app code has been updated to include a macOS version demonstrating the basic functionality including toggling different Aspect settings.

    Other recent updates include moving the dependencies to a more recent Xamarin Forms version and implementing fast renderers for iOS and Android.

    I’ve begun back-porting the WPF renderer too and hope to add this soon. This will increase the platform coverage to Android, iOS, UWP, macOS and WPF. I haven’t really worked with Xamarin Forms on Tizen but this is another possibility for the future.

    https://www.nuget.org/packages/InTheHand.Forms/