UserAccelerometer sensor returns 0 values on some phones #45980
Labels
e: device-specific
Only manifests on certain devices
p: sensors
Plugin to read from sensors
package
flutter/packages repository. See also p: labels.
platform-android
Android applications specifically
Target Platform: Android
Target OS version/browser: Android 9
Devices: Huawei Mate 9 Pro
I'm currently working on an application detecting phone shakes using UserAccelerometer TYPE_LINEAR_ACCELERATION on Android), but some phones can only produce events with x:0,y:0,z:0 while accelerometer and gyroscope works. (my testing tool)
After investigating the android native code I'm fairly certain that the issues comes from the OS/device itself rather than the Flutter plugin.
I tried to bypass this issue by using the basic accelerometer with gravity, but it turns out that there's more to it than some basic math (like combining multiple sensor inputs in a specific way).
The text was updated successfully, but these errors were encountered: