FileDocCategorySizeDatePackage
SensorTest.javaAPI DocAndroid 1.5 API7010Wed May 06 22:41:08 BST 2009com.example.android.apis.graphics

SensorTest

public class SensorTest extends GraphicsActivity

Fields Summary
private android.hardware.SensorManager
mSensorManager
private SampleView
mView
private float[]
mValues
private final android.hardware.SensorListener
mListener
Constructors Summary
Methods Summary
protected voidonCreate(android.os.Bundle icicle)


    
        
        super.onCreate(icicle);
        mSensorManager = (SensorManager)getSystemService(Context.SENSOR_SERVICE);
        mView = new SampleView(this);
        setContentView(mView);
//        android.util.Log.d("skia", "create " + mSensorManager);
    
protected voidonResume()

        super.onResume();
        
        int mask = 0;
//        mask |= SensorManager.SENSOR_ORIENTATION;
        mask |= SensorManager.SENSOR_ACCELEROMETER;
        
        mSensorManager.registerListener(mListener, mask, SensorManager.SENSOR_DELAY_FASTEST);
//        android.util.Log.d("skia", "resume " + mSensorManager);
    
protected voidonStop()

        mSensorManager.unregisterListener(mListener);
        super.onStop();
//        android.util.Log.d("skia", "stop " + mSensorManager);