Sensor stream Rate String - Android Hardware

Android examples for Hardware:Sensor

Description

Sensor stream Rate String

Demo Code


//package com.java2s;

import android.hardware.SensorManager;

public class Main {
    /**/*from w  w w  .  j  a va  2s.  c om*/
     * @return A string representing what the current stream rate means in the Android framework
     */
    static public String streamRateString(int streamRate) {
        switch (streamRate) {
        case -1:
            return "Off";
        case SensorManager.SENSOR_DELAY_FASTEST:
            return "Fastest";
        case SensorManager.SENSOR_DELAY_GAME:
            return "Game";
        case SensorManager.SENSOR_DELAY_NORMAL:
            return "Normal";
        case SensorManager.SENSOR_DELAY_UI:
            return "UI";
        default:
            return String.valueOf(streamRate);
        }
    }
}

Related Tutorials