private void initSingletons() { try { // Call to initialize the OBTSDK OBTSDK.initialize(this); Log.e("main", "OBT SDK initialized"); OBTSDK.authorizeSdk(new MyOBTSdkAuthListener()); } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } }
@Override public void onNearbyBrushesFoundOrUpdated(List<OBTBrush> nearbyBrushes) { Log.e("found brush", "" + nearbyBrushes.size()); if (!nearbyBrushes.isEmpty()) // Connect to first Oral-B Toothbrush OBTSDK.connectToothbrush(nearbyBrushes.get(0), true); }
@Override public void onSdkAuthorizationSuccess() { Log.e("MyOBTSdkAuthListener", "success"); try { OBTSDK.startScanning(); } catch (Exception e) { e.printStackTrace(); } }