Java tutorial
//package com.java2s; import android.bluetooth.BluetoothAdapter; public class Main { static private final String UNKNOWN = "UNKNOWN"; static public String scanMode2String(int scanMode) { final String NONE = "SCAN_MODE_NONE"; final String CONNECTABLE = "SCAN_MODE_CONNECTABLE"; final String CONNECTABLE_DISCOVERABLE = "SCAN_MODE_CONNECTABLE_DISCOVERABLE"; switch (scanMode) { case BluetoothAdapter.SCAN_MODE_NONE: return NONE; case BluetoothAdapter.SCAN_MODE_CONNECTABLE: return CONNECTABLE; case BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE: return CONNECTABLE_DISCOVERABLE; default: return UNKNOWN; } } }