第一頁 返回 繼續 最後一頁 概覽 圖形
Sensors(2)
Methods of SensorEventListener
public void onAccuracyChanged(Sensor sensor, int accuracy)
int mgValues=new int[3];
int acValues=new int[3];
public void onSensorChanged(SensorEvent event)
{
if (event.sensor.getType() == Sensor.TYPE_MAGNETIC_FIELD)
mgValues = event.values;
else if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER)
acValues = event.values;
else return;
}