rdelrosario / xamarin-plugins

Cross platform Xamarin & Windows plugins for PCLs
MIT License
179 stars 161 forks source link

For DeviceMotion.Plugin, no UWP implementation #64

Open ericleigh007 opened 8 years ago

ericleigh007 commented 8 years ago

Hi,

I noticed that the DeviceMotion Plugin has no implementation for UWP. I'm hoping this is in the works, as I see that the dir has been created.

-thanks -e

Geeksltd commented 7 years ago

Hi guys.

Great plugin!

I also need it for UWP. Any plans to implement it?

Paymon

dimitrijevic commented 7 years ago

The current version 1.1.2 nuget has UWP support, but there is a problem on my demo project stemming from oxyplot xamarin and not device motion plugin which may work for you even when compiling it in release mode (those usually arise due to reflection or serialization metadata that's being written out by the .NET native compiler), and which I may be able to solve using runtime directive soon...it's just that build and runtime output of that project doesn't give much away (at least not for me) in terms of what type or namespace should I add to RD.xml...the error seems to induce some Microsoft's V2 device sensor DLL errors (for build 10586 at least) so maybe it's even Microsoft that has problems with it's own .NET native compiler that's going to be fixed in 14393/Microsoft.NETCore.UWP nuget or later at which point I'll publish the demo.

dimitrijevic commented 7 years ago

I've published a UWP app, open link on Windows, and you'll see, 1.1.2 works, definitely. Also, if you'd like, test this, it's been somewhat updated, to support Inclinometer fusion sensor (on Windows capable devices with accelerometer and gyroscopes). It's available as MotionSensorType.Fusion, X is pitch degrees, Y is roll, Z yaw, respectfully...

EmilAlipiev commented 7 years ago

@dimitrijevic android api provides function to check if device has specific sensor, i cant figure it out how to do it with the plugin. how does it actually behave if device doesnt have the sensor hardware?

dimitrijevic commented 7 years ago

@EmilAlipiev The current 1.1.2 works only with Accelerometer sensor which is most common one thus if you're using it on a mobile phone it should work (although if you're trying to make some pitch/roll/yaw calculations then you're going to get lagged results - depending on your CPU), but in case you're going to use it on a custom hardware that may lack Accelerometer all together then it's going to fail. It should fail gracefully though, just not returning anything else than what's been initialized. Hope that helps.