Page 1 of 1

System.DllNotFoundException: phidget22

Posted: Sat Jun 09, 2018 6:16 am
by zain alvi
Hello,
I'm trying to use "PhidgetSpatial Precision 3/3/3 High Resolution" with an Android application developed in C# using Xamarin in Visual Studio.

At the start of program, I've referred to Phidget22.NET.dll, then I've initialized Magnetometer like this:

Code: Select all

 Magnetometer mag = null;
 mag = new Magnetometer();
it gives me an error
System.DllNotFoundException: phidget22
Can you please guide me on this?

Regards.

Re: System.DllNotFoundException: phidget22

Posted: Thu Feb 27, 2020 11:10 am
by JonasPR
Hi Zain,

did you ever figure this out? I just hit it today.

Even though the Phidget22_Net_dll" and "Phidget22_Net_dll_mdb" are in the androids _override_ directory along with all of the other dlls, it doesnt look like it gets loaded.

Re: System.DllNotFoundException: phidget22

Posted: Thu Feb 27, 2020 12:21 pm
by Patrick
This is not a configuration that's been tested by Phidgets.

What's missing is the Android native C library phidget22.

You will need to download the Android library package: https://www.phidgets.com/downloads/phid ... ndroid.zip

This contains the Android Java library, as well as the native library for all architectures: libphidget22java.so. You will need to rename this to libphidet22.so and put it in a path where the Xamarin application will find it - You will need to find documentation for loading native libraries from Xamarin.

This should work fine for network-attached Phidgets, but you won't be able to use USB-attached Phidgets because they are supported by a supplemental Java jar - I'm not sure if you can load jars in Xamarin?

-Patrick