public static boolean isWatchConnected ( final Context context ) { Cursor c = null ; try { c = queryProvider ( context ) ; if ( c == null || ! c . moveToNext ( ) ) { return false ; } return c . getInt ( KIT_STATE_COLUMN_CONNECTED ) == 1 ; } finally { if ( c != null ) { c . close ( ) ; } } }
Synchronously query the Pebble application to see if an active Bluetooth connection to a watch currently exists .