我一直在开发一款依赖于陀螺仪的Android应用程序。当我使用具有最新版本的android(API 26)的模拟器时,该设备在传感器列表中没有陀螺仪。
我使用带有API 24的nexus 5设备创建了一个模拟器,其中包含以下传感器
Sensor: {Sensor name="Goldfish 3-axis Accelerometer", vendor="The Android Open Source Project", version=1, type=1, maxRange=2.8, resolution=2.480159E-4, power=3.0, minDelay=10000}
Sensor: {Sensor name="Goldfish 3-axis Gyroscope", vendor="The Android Open Source Project", version=1, type=4, maxRange=11.111111, resolution=0.001, power=3.0, minDelay=10000}
Sensor: {Sensor name="Goldfish 3-axis Magnetic field sensor", vendor="The Android Open Source Project", version=1, type=2, maxRange=2000.0, resolution=1.0, power=6.7, minDelay=10000}
Sensor: {Sensor name="Goldfish Orientation sensor", vendor="The Android Open Source Project", version=1, type=3, maxRange=360.0, resolution=1.0, power=9.7, minDelay=10000}
Sensor: {Sensor name="Goldfish Temperature sensor", vendor="The Android Open Source Project", version=1, type=13, maxRange=80.0, resolution=1.0, power=0.0, minDelay=10000}
Sensor: {Sensor name="Goldfish Proximity sensor", vendor="The Android Open Source Project", version=1, type=8, maxRange=1.0, resolution=1.0, power=20.0, minDelay=10000}
Sensor: {Sensor name="Goldfish Light sensor", vendor="The Android Open Source Project", version=1, type=5, maxRange=40000.0, resolution=1.0, power=20.0, minDelay=10000}
Sensor: {Sensor name="Goldfish Pressure sensor", vendor="The Android Open Source Project", version=1, type=6, maxRange=800.0, resolution=1.0, power=20.0, minDelay=10000}
Sensor: {Sensor name="Goldfish Humidity sensor", vendor="The Android Open Source Project", version=1, type=12, maxRange=100.0, resolution=1.0, power=20.0, minDelay=10000}
Sensor: {Sensor name="Goldfish 3-axis Magnetic field sensor (uncalibrated)", vendor="The Android Open Source Project", version=1, type=14, maxRange=2000.0, resolution=1.0, power=6.7, minDelay=10000}
Sensor: {Sensor name="Goldfish 3-axis Gyroscope (uncalibrated)", vendor="The Android Open Source Project", version=1, type=16, maxRange=11.111111, resolution=0.001, power=3.0, minDelay=10000}
Sensor: {Sensor name="Game Rotation Vector Sensor", vendor="AOSP", version=3, type=15, maxRange=1.0, resolution=5.9604645E-8, power=12.7, minDelay=10000}
Sensor: {Sensor name="GeoMag Rotation Vector Sensor", vendor="AOSP", version=3, type=20, maxRange=1.0, resolution=5.9604645E-8, power=12.7, minDelay=10000}
Sensor: {Sensor name="Gravity Sensor", vendor="AOSP", version=3, type=9, maxRange=19.6133, resolution=2.480159E-4, power=12.7, minDelay=10000}
Sensor: {Sensor name="Linear Acceleration Sensor", vendor="AOSP", version=3, type=10, maxRange=19.6133, resolution=2.480159E-4, power=12.7, minDelay=10000}
Sensor: {Sensor name="Rotation Vector Sensor", vendor="AOSP", version=3, type=11, maxRange=1.0, resolution=5.9604645E-8, power=12.7, minDelay=10000}
Sensor: {Sensor name="Orientation Sensor", vendor="AOSP", version=1, type=3, maxRange=360.0, resolution=0.00390625, power=12.7, minDelay=10000}
当我使用带有API 26的nexus 5设备创建模拟器时,我得到以下设备列表:
Sensor: {Sensor name="Goldfish 3-axis Accelerometer", vendor="The Android Open Source Project", version=1, type=1, maxRange=2.8, resolution=2.480159E-4, power=3.0, minDelay=10000}
Sensor: {Sensor name="Goldfish 3-axis Magnetic field sensor", vendor="The Android Open Source Project", version=1, type=2, maxRange=2000.0, resolution=1.0, power=6.7, minDelay=10000}
Sensor: {Sensor name="Goldfish Orientation sensor", vendor="The Android Open Source Project", version=1, type=3, maxRange=360.0, resolution=1.0, power=9.7, minDelay=10000}
Sensor: {Sensor name="Goldfish Temperature sensor", vendor="The Android Open Source Project", version=1, type=13, maxRange=80.0, resolution=1.0, power=0.001, minDelay=10000}
Sensor: {Sensor name="Goldfish Proximity sensor", vendor="The Android Open Source Project", version=1, type=8, maxRange=1.0, resolution=1.0, power=20.0, minDelay=10000}
Sensor: {Sensor name="Goldfish Light sensor", vendor="The Android Open Source Project", version=1, type=5, maxRange=40000.0, resolution=1.0, power=20.0, minDelay=10000}
Sensor: {Sensor name="Goldfish Pressure sensor", vendor="The Android Open Source Project", version=1, type=6, maxRange=800.0, resolution=1.0, power=20.0, minDelay=10000}
Sensor: {Sensor name="Goldfish Humidity sensor", vendor="The Android Open Source Project", version=1, type=12, maxRange=100.0, resolution=1.0, power=20.0, minDelay=10000}
Sensor: {Sensor name="GeoMag Rotation Vector Sensor", vendor="AOSP", version=3, type=20, maxRange=1.0, resolution=5.9604645E-8, power=9.7, minDelay=10000}
我是否需要做一些事情才能让陀螺仪构建模拟器?
干杯