Search code examples
xamarinxamarin.formsuwp-xamlhid

Human Interface Device (HID) in Xamarin/Xamarin.forms


I am attempting to develop a app to comunicate with bluetooth LE crossplataform. To do it, I'm trying to start with xamarin.forms and using 2 samples groups

  • A sample of android App by Microchips and Monkey.robotic
  • A sample of UWP project to connect by HID (I have a device to do it as a dongle service)

The sample of microsoft was: https://github.com/oldnewthing/Windows-universal-samples/tree/master/Samples/CustomHidDeviceAccess

I'll use a Conditional Compilation to do both situations, but when I try to use it into Xamarin there are troubles around some UWP references that didn't work , it is not compatible with xamarin and several await/async errors.

When I try to force by the other side (like .NET Standard 1.6) it didn't work either.

What is really compatible with (xamarin/xamarin.forms)2.+ ?

Is it possible to do, a HID connection using xamarin.forms design?

Thanks in advance.


Solution

  • I think HID project should be referenced by UWP project. In PCL(Xamarin.Forms) project, you should use DependencyService to use that https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/dependency-service/introduction/