Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.ArrayList;
import java.util.List;
import android.view.InputDevice;
import android.view.InputDevice.MotionRange;

import android.view.MotionEvent;

public class Main {
    public static List<String> getAxisNames(InputDevice device) {
        List<String> axisNames = new ArrayList<String>();
        if (device == null) {
            return axisNames;
        }

        List<MotionRange> motionRanges = device.getMotionRanges();
        for (MotionRange range : motionRanges) {
            axisNames.add(MotionEvent.axisToString(range.getAxis()));
        }

        return axisNames;
    }
}