Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.bluetooth.BluetoothAdapter;

public class Main {
    public static String getStateString(int state) {
        switch (state) {
        case BluetoothAdapter.STATE_CONNECTED:
            return "Connected";
        case BluetoothAdapter.STATE_CONNECTING:
            return "Connecting";
        case BluetoothAdapter.STATE_DISCONNECTED:
            return "Disconnected";
        case BluetoothAdapter.STATE_DISCONNECTING:
            return "Disconnecting";
        case BluetoothAdapter.STATE_OFF:
            return "Off";
        case BluetoothAdapter.STATE_ON:
            return "On";
        case BluetoothAdapter.STATE_TURNING_OFF:
            return "Turning Off";
        case BluetoothAdapter.STATE_TURNING_ON:
            return "Turning On";
        default:
            return "Unknown";
        }
    }
}