Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//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";
        }
    }
}