Java tutorial
//package com.java2s; import android.hardware.Sensor; public class Main { public static String getSenserNameByType(final int type) { switch (type) { case Sensor.TYPE_LINEAR_ACCELERATION: return "Linear Acceleration Senser"; case Sensor.TYPE_GYROSCOPE: return "Gyroscope Senser"; case Sensor.TYPE_ACCELEROMETER: return "Accelerometer Senser"; case Sensor.TYPE_MAGNETIC_FIELD: return "Magnetic Field Senser"; default: return "Unknown Senser"; } } }