I am creating an android wear app that extends push notifications. My app downloads approximately 10 images from a server when a push notification comes in and displays the
You can check that the user has a watch paired with his device while it doesn't has to be connected at the time. This is better as this way the watch does not have to be connected at the time to be detected.
BluetoothAdapter mBtAdapter = BluetoothAdapter.getDefaultAdapter();
Set pairedDevices = mBtAdapter.getBondedDevices();
if (pairedDevices.size() > 0) {
for (BluetoothDevice device : pairedDevices) {
if(device.getDeviceClass()==BluetoothClass.Device.WEARABLE_WRIST_WATCH){
Log.d("Found", "Paired wearable: "+ device.getName() + ", with address: " + device.getAddress());
{
{
} else {
Toast.makeText(this, "No paired wearables found", Toast.LENGTH_SHORT).show();
}
Note that this code requires bluetooth permissions in your manifest.