デバイスの getBTMajorDeviceClass は何ですか? BluetoothClass.Device.Major.UNCATEGORIZED の場合は、独自の UUID を生成してみてください。
private UUID generateUuid() {
String android_id = Secure.getString(getApplicationContext()
.getContentResolver(), Secure.ANDROID_ID);
Log.i("System out", "android_id : " + android_id);
final TelephonyManager tm = (TelephonyManager) getBaseContext()
.getSystemService(Context.TELEPHONY_SERVICE);
final String tmDevice, tmSerial, androidId;
tmDevice = "" + tm.getDeviceId();
Log.i("System out", "tmDevice : " + tmDevice);
tmSerial = "" + tm.getSimSerialNumber();
Log.i("System out", "tmSerial : " + tmSerial);
androidId = ""
+ android.provider.Settings.Secure.getString(
getContentResolver(),
android.provider.Settings.Secure.ANDROID_ID);
UUID deviceUuid = new UUID(androidId.hashCode(),
((long) tmDevice.hashCode() << 32) | tmSerial.hashCode());
return deviceUuid;
}
ソケットの作成に使用しますcreateRfcommSocketToServiceRecord(generateUuid());
*READ_PHONE_STATE が必要です