System.DllNotFoundException: phidget22

Supporting Visual Studio on Windows
Post Reply
zain alvi
Fresh meat
Posts: 1
Joined: Sat Jun 09, 2018 6:04 am
Contact:

System.DllNotFoundException: phidget22

Post 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.
JonasPR
Fresh meat
Posts: 2
Joined: Thu Feb 27, 2020 11:04 am
Contact:

Re: System.DllNotFoundException: phidget22

Post 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.
User avatar
Patrick
Lead Developer
Posts: 634
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: System.DllNotFoundException: phidget22

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest