Back to project page MuseLogger.
The source code is released under:
MIT License
If you think the Android project MuseLogger listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.chrisplus.muselogger; //from ww w . j a v a 2 s . c o m import java.io.IOException; import java.io.OutputStream; import java.nio.charset.StandardCharsets; import java.util.Set; import java.util.UUID; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothSocket; public class BluetoothUtils { public static Set<BluetoothDevice> findPaired() { BluetoothAdapter bluetoothAdapter = BluetoothAdapter .getDefaultAdapter(); Set<BluetoothDevice> devices = bluetoothAdapter.getBondedDevices(); if (devices == null || devices.isEmpty()) { return null; } else { return devices; } } public static boolean checkMusePaired() { Set<BluetoothDevice> devices = findPaired(); if (devices == null || devices.isEmpty()) { return false; } for (BluetoothDevice device : devices) { if (device.getName().equalsIgnoreCase("muse")) { return true; } } return false; } }