Bug report best practices: Submitting Issues
The Accelerometer sensor runs on Android7.0(RedMi Note 4X) OK.
However, when it runs on Android8.1(Smartisan Pro2s), it gets error :specified method is not supported. I truely know my phone has accelerometer sensor, but the code doesn't work on Android8.1.
Accelerometer.Start(SensorSpeed.Normal)
Nomally start accelerometer sensor
Get error: specified method is not supported
Visual Studio 2019 16.4.5
And how can I use LinearAcceleration sensor?
I can only find Accelerometor...
We use a check for the Accelerometer. If it is returning null then it means there isn't a sensor. It could be that these devices don't supply an Accelerometer on them.
Platform.SensorManager?.GetDefaultSensor(SensorType.Accelerometer) != null;
The difference being that Linear Acceleration sensor excludes gravity. We could do a feature improvement that checks to see if the Accelerometer doesn't exist then try to use linear acceleration sensor.
I find it strange that the devices dont' report back an accelerometer, but it is android so who knows :)
Hi, James!
Thank you for receive your mail~
I meant that my device truely have an accelerometer sensor but I can't trigger that sensor before I sent you the issue.
However, there is a surprise!!! When I try thousands of ways such as use Android.Hardware to instead of Xamarin,( although I can't use Android.Hardware properly at that time) . When I failed again and prepare to go to bed, I tried Xamarin again, you can't believe that sensor began to work!!!
Yes, now I can use Xamarin to trigger accelerometer, But I was trying to return the issue situation such as power low or FlightMode, however, it can‘t’ go back to that issue situation. So I don't know WHAT ACTION I DID make the sensor began working...
Now I am happy to see sensor working, but a little depressing in I can't find the root cause of the issue.
Could you find some cause from these cue I said? And now I prepare to find more android phone to test to find the cause and then feedback you.
Last, I am very appreciate what you said "but it is android so who knows" :) haha
Thanks for the update and will close out. Yeah perhaps the sensor was just turned off for the time being :(
Most helpful comment
Hi, James!
Thank you for receive your mail~
I meant that my device truely have an accelerometer sensor but I can't trigger that sensor before I sent you the issue.
However, there is a surprise!!! When I try thousands of ways such as use Android.Hardware to instead of Xamarin,( although I can't use Android.Hardware properly at that time) . When I failed again and prepare to go to bed, I tried Xamarin again, you can't believe that sensor began to work!!!
Yes, now I can use Xamarin to trigger accelerometer, But I was trying to return the issue situation such as power low or FlightMode, however, it can‘t’ go back to that issue situation. So I don't know WHAT ACTION I DID make the sensor began working...
Now I am happy to see sensor working, but a little depressing in I can't find the root cause of the issue.
Could you find some cause from these cue I said? And now I prepare to find more android phone to test to find the cause and then feedback you.
Last, I am very appreciate what you said "but it is android so who knows" :) haha