Connecting to a USB HID Device

Nathan Sokalski 4,121 Reputation points
2022-09-06T22:54:52.67+00:00

I have an external USB device to which I want my app to connect by plugging it into the USB port. This is my first time doing anything involving external hardware. I have found the UsbManager class, but I am having trouble finding any good tutorials and/or examples. Any suggestions?

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,297 questions
0 comments No comments
{count} votes

Accepted answer
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 26,626 Reputation points Microsoft Vendor
    2022-09-08T08:08:48.78+00:00

    Hello @Nathan Sokalski ,

    There is no such official tutorials and examples, you could check the doc of native Android : UsbManager  |  Android Developers and USB host overview  |  Android Developers. It's in Java, you could try to implement this in C#.

    Please pay attention to the ACTION_USB_PERMISSION permission. For more details, you can refer to
    Xamarin - USB Host - Android - Request Permission to connect to device (Crash) - Microsoft Q&A
    Permissions In Xamarin.Android - Xamarin | Microsoft Learn

    Best Regards,
    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful