get Local Bluetooth Name - Android android.bluetooth

Android examples for android.bluetooth:Bluetooth

Description

get Local Bluetooth Name

Demo Code

import android.bluetooth.BluetoothAdapter;
import android.util.Log;

public class Main{

    public static String getLocalBluetoothName() {
        BluetoothAdapter mBluetoothAdapter = BluetoothAdapter
                .getDefaultAdapter();//from www .j  a  v a 2  s. c  o m

        // if device does not support Bluetooth
        if (mBluetoothAdapter == null) {
            Log.d(BluetoothUtils.class.getCanonicalName(),
                    "device does not support bluetooth");
            return null;
        }

        return mBluetoothAdapter.getName();
    }

}

Related Tutorials