Там нет официального API, чтобы получить имя носимого устройства, которое отображается, когда часы первой загрузки, такие как G WATCH 1234 или MOTO 360 1234.
Это может измениться в будущем, но если вы хотите получить подобное имя прямо сейчас, вам нужно сделать что-то вроде этого:
BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();
String btAddress = "No Bluetooth";
if (btAdapter != null)
btAddress = btAdapter.getAddress();
// Reconstitute the pairing device name from the model and the last 4 digits of the bluetooth MAC
String wearName;
if ((btAddress != null) && (!btAddress.equals("No Bluetooth"))) {
wearName = android.os.Build.MODEL;
String[] tokens = btAddress.split(":");
wearName += " " + tokens[4] + tokens[5];
wearName = wearName.toUpperCase();
} else {
wearName = "No Bluetooth";
}
Взволнован, чтобы узнать, что будет результатом? если мы используем Android Wear Preview App! –