3

I am tring to connect google glass to my mobile app via bluetooth and figure out how to find out which paired device is google glass.

How can I distinguish google glass from other paired devices ?

jellyfication
  • 1,595
  • 1
  • 16
  • 37

3 Answers3

0

In my case the glass gets listed as the name of my gmail account i used to login to glass. So if your gmail account name is xyz, it should be listed as xyz's glass.

Chirag
  • 335
  • 2
  • 3
  • 13
0

A side solution might be (I'm far from being an expert) you to know your Google Glass MAC address, so at the time you are searching for your glasses you might pay attention to the address and not really the name.

This would only work with your own glasses though.

Let me know if this helps!

gkapellmann
  • 313
  • 3
  • 19
0

Once you have a BluetoothDevice, you can get a list of UUIDs (http://developer.android.com/reference/android/bluetooth/BluetoothDevice.html#getUuids()). Once you have the list of UUIDs, you can see if one of the known Glass UUIDs is present such as f96647cf-7f25-4277-843d-f407b4192f8b.

For instance:

public static boolean isGlass(BluetoothDevice device) {
  ParcelUuid[] uuids = device.getUuids();
  for (ParcelUuid id : uuids) {
    if (id.equals(ParcelUuid.fromString("f96647cf-7f25-4277-843d-f407b4192f8b"))) {
      return true;
    }
  }
  return false;
}
Brandon Wuest
  • 206
  • 1
  • 2