获取Android设备的方向 ,使用加速度重力传感器

带有g-sensor的Android设备上可通过API获取到设备的运动加速度,应用程序通过一些假设和运算,可以从加速度计算出设备的方向 获取设备运动加速度的基本代码是: SensorManager sm = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE); sm.registerLis
相关文章
相关标签/搜索