FTDI Community

General Category => Discussion - Drivers => Topic started by: diego.barile on April 02, 2021, 09:17:51 AM

Title: Android D2xx driver in Xamarin
Post by: diego.barile on April 02, 2021, 09:17:51 AM
Hello.

I would like to communicate with one FT232 chip via my Android 8.1 smartphone.
I've created a new Xamarin.Android/Xamarin.Form project with Visual Studio 2019 Community Edition.
Then I've import and successfully build the D2xx.jar.
But once I got the wrapper assembly I'm unable to run it because is not clear how to instantiate the right class with proper parameters.

To begin I believe I must instantiate the following class:

Code: [Select]
public unsafe FT_Device (global::Android.Content.Context parentContext, global::Android.Hardware.Usb.UsbManager usbManager, global::Android.Hardware.Usb.UsbDevice dev, global::Android.Hardware.Usb.UsbInterface itf)
But I don’t know how to get “parentContext”, “usbManager” and so on.
My question is: where I can found a clear and simple code sample, written in C#, for Xamarin.Android/Xamarin.Form?

Thanks a lot in advance.

Diego B.