Categories
Bluetooth Xamarin

Wrapping up 2020

I haven’t posted as much as I would have liked this year, because “reasons” but I thought I would put together a short post to wrap up some of the things that have been going on behind the scenes.

32feet

Back in January I announced a re-write of 32feet.NET. The library for Bluetooth Classic has been reworked for the NuGet/.NET Standard age. The intention was removing legacy code and take advantage of newer language features to make it easier to support more platforms and concentrate on getting the core functionality across as many .NET platforms as possible. It’ll also make it easier to support .NET 5/6 ahead. I’ve invested a lot of time into the macOS IOBluetooth and IOBluetoothUI bindings too and will be integrating macOS into the 32feet library in 2021.

I started to work on integrating some code I had written for iOS using the External Accessory API. This allows access to a subset of Bluetooth devices if they implement Apple’s proprietary MFi standard. This will allow devices such as mobile printers to be used with shared code across multiple platforms.

I would like to start work on Linux support (via BlueZ) too which will be another major platform ticked off.

This year I also revived original parts of 32feet.NET in separate packages so IrDA and Object Exchange functionality are available separately. IrDA is end-of-life so I won’t be investing in this area but I wanted to ensure it was made available for desktop Windows in a modern package if required. OBEX has the basic ObexWebRequest with a few minor improvements but it’s something I intend to revisit with a more powerful API soon.

Bluetooth Low Energy

Alongside the Bluetooth Classic updates I also created a new library for Bluetooth Low Energy. This currently supports Windows 10 (.NET Framework, .NET Core and UWP), Android, iOS, tvOS, watchOS, macOS. It would be nice to add Linux and possibly Tizen to this list!

The API follows the existing WebBluetooth standard closely with some additional features relevant to apps. For example not only can you display a picker to the user to choose a device but you can also programmatically discover to generate your own UI. There are some platform specific additions too such as the ability to request a particular physical layer (PHY) which facilitates longer range communication (Currently Android only). Work has also gone into round-tripping support for service UUIDs – the ability to specify by name or short and long UUIDs.

MediaElement

The Xamarin Forms MediaElement now has a new home in the Xamarin Community Toolkit. It’s already received a number of fixes and improvements. In October I added support for databinding to the Position property. Rather than having to write your own timer and query the position you can just bind your UI to the property which gets regularly updated as the media plays.

Happy New Year

I hope you have a happy holiday season and wish you the best for 2021.

By Peter Freeman Foot

Microsoft Windows Development MVP