Code example for Sensor

Methods: getType

0
         * Gets sensor type. 
         * 
         * @return Sensor type as one of the Sensor.TYPE_XXX constants. 
         */ 
        private int getType() { 
            return mSensor.getType();
        } 
 
        /** 
         * Starts monitoring the sensor. NOTE: This method is called from 
         * outside of the UI thread. 
         */ 
        private void startListening() { 
            SensorManager sm = (SensorManager) getSystemService(SENSOR_SERVICE);
            sm.registerListener(this, mSensor, SensorManager.SENSOR_DELAY_UI);
        } 
 
        /** 
         * Stops monitoring the sensor. NOTE: This method is called from outside 
         * of the UI thread. 
         */