ORAL-B DEVELOPER PROGRAM
Will be shut down on 15th April 2018


OVERVIEW

Base URL - https://api.developer.oralb.com

The Cloud API is a REST-based service communicating via HTTPS and JSON. All requests to the API must be via HTTPS (SSL). The SDK will verify the identity of the endpoint's certificate on every request.

Authentication and Authorization

Before an app may read or write session data, it must be authorized by the resource owner (the user) to do so. Two pieces of information required to make a request to the API:

  • An X-User-Token Header – a GUID representing the authorization of the application by the user.
  • A bearer token – a token signifying that the client can access the system.

The bearer token must be included in the “Authorization” header. The authorization header should look something like this:

Authorization: Bearer bwz1eZyomsbHggmrJyUY-0qw38Alc-qRuBVESzwoRLojuhZV-9IuHKjm3-QIxIFZASwkoDhCnto7own_VSULWur_bhdx7ejThozKJ-Bumcwuw8LkrFZCOiKRF-aG0qZd2hNcVL53dZGc8yhFkXQGqYW1i3cn6cHpDbXPxSmMn4Ba9fdxAB6b-L-OPuyrTlw0sTKbz5fYUTwrhkpIqKmylnkqK79K3af6t1oDDEpNDA9cUScbXiYhwN7AfkmSinGUrg6roMNt0NUY8YpyguLfay0VAgPWV-uXY-IsUpF1_VsINSwg3d1yqKixYKznvJwRve3DiCDOlyOtqfo6gMyb5Pbxp-mccZNEQf4xJdW7z8e3IXe1PuDgNPuL8yPWFRmUZiTM8DE-Hh5qHCYanjWdAZ7DRK9qJvCHd0mCedG_Z5ABmmlvu1j5xyxSlAoihctoRltg_orGeb_FVZmwLZfFKUCnbxMVZyfpca72osgz92A

BEARERTOKEN {APP ID}

Retrieves the oath token for an application.

Endpoint URL

/v1/bearertoken/{app id}?key={Key}

Parameters

Key

App secret key

Response body

A JSON object containing the following fields:

bearer_token

The bearer token

Response example

{"bearerToken":"nvdq6gIhJawJsheWKRqprDiSX_InNxscpFuVNC80LoeKNkkNhpPJSk………"}

Invalid request example

{"error":"invalid_clientid","error_description":"Client is not registered in the system."}

Authorize

Returns the URL for user authorization. Redirect the user to this URL to allow the user to sign in (or sign up) and authorize your app.

Endpoint URL

/v1/authorize

Query string

None

X-User-Token

Not Required

Request example

N/A

Response body

url

The URL where the user can authorize your app.

Response example

{"url": "https://…"}

Authorization

Before an app may read or write session data, it must be authorized by the resource owner (the user) to do so. Two pieces of information required to make a request to the API:

  • An Authorization Header containing the bearer token – a token signifying that the client can access the system.
  • An X-User-Token Header – a GUID representing the authorization of the application by the user.

Authorization: Bearer Token

An app must include a bearer token as part of the Authorization header in every request to the Oral-B API.

An app can obtain a bearer token calling the GET /v1/bearertoken/{app id}?key={app key} endpoint; the app id would be passed in the Uri and app key would be passed in the query string. The bearer token is included in the Authorization header and would look like the following:

Authorization: Bearer bwz1eZyomsbHggmrJyUY-0qw38Alc-qRuBVESzwoRLojuhZV-9IuHKjm3-QIxIFZASwkoDhCnto7own_VSULWur_bhdx7ejThozKJ-Bumcwuw8LkrFZCOiKRF-aG0qZd2hNcVL53dZGc8yhFkXQGqYW1i3cn6cHpDbXPxSmMn4Ba9fdxAB6b-L-OPuyrTlw0sTKbz5fYUTwrhkpIqKmylnkqK79K3af6t1oDDEpNDA9cUScbXiYhwN7AfkmSinGUrg6roMNt0NUY8YpyguLfay0VAgPWV-uXY-IsUpF1_VsINSwg3d1yqKixYKznvJwRve3DiCDOlyOtqfo6gMyb5Pbxp-mccZNEQf4xJdW7z8e3IXe1PuDgNPuL8yPWFRmUZiTM8DE-Hh5qHCYanjWdAZ7DRK9qJvCHd0mCedG_Z5ABmmlvu1j5xyxSlAoihctoRltg_orGeb_FVZmwLZfFKUCnbxMVZyfpca72osgz92A.



User Authorization

The next step is for the resource owner (user) to authorize the app to access the Oral-B system.

Authorization Landing Page

The app can retrieve the authorization landing page by calling the GET /v1/authorize endpoint; subsequently, the app should redirect the user to the authorization landing page to approve the app.

If the user is not logged in, they would first be prompted to enter their username and password.

Upon consent the user will be redirected to the app callback Uri with the userToken included as a query string parameter.

The application can now call the API by passing the user's token in the request header X-User-Token and by also including the bearer token in the request header Authorization.

X-User-Token: nk2NMXrQyS-Ksp_olKGY-EZHv-xS17D4VRv7poZ5dEI73BoWZP2Jo8Ub3yGk1B_Wp4tYJU3gdACrlNuNBx_KIZsG4pRIsB6Hx-QCobWoy38gxz6evu5ZshkxTZlKlOanz5kfxO4C8eq8ttEnqcZAnT8OgKBGQjHry-YTTkCCIRjYr237woXnsdjpzaAH1K72VKmr97SbylUz0H3sog7cPbGnAfX9vMVbOo73mK6vIz_GJXZAhW8TdhhLj094vh0ds6llgvFF7JO1k23Qiq3F_HzdCXlN8VaxhGbjdapj4-COb0O365_BuFgtkivBlbATT2CjfQIEXnYriQ-JFTgoYBLEeFfFGV1XtsCC7RzF3pL4UDWLzzQM3COIf_KQ8XNSevz0luqBDXHDWpzh3Do1ig


Authorization: Bearer bwz1eZyomsbHggmrJyUY-0qw38Alc-qRuBVESzwoRLojuhZV-9IuHKjm3-QIxIFZASwkoDhCnto7own_VSULWur_bhdx7ejThozKJ-Bumcwuw8LkrFZCOiKRF-aG0qZd2hNcVL53dZGc8yhFkXQGqYW1i3cn6cHpDbXPxSmMn4Ba9fdxAB6b-L-OPuyrTlw0sTKbz5fYUTwrhkpIqKmylnkqK79K3af6t1oDDEpNDA9cUScbXiYhwN7AfkmSinGUrg6roMNt0NUY8YpyguLfay0VAgPWV-uXY-IsUpF1_VsINSwg3d1yqKixYKznvJwRve3DiCDOlyOtqfo6gMyb5Pbxp-mccZNEQf4xJdW7z8e3IXe1PuDgNPuL8yPWFRmUZiTM8DE-Hh5qHCYanjWdAZ7DRK9qJvCHd0mCedG_Z5ABmmlvu1j5xyxSlAoihctoRltg_orGeb_FVZmwLZfFKUCnbxMVZyfpca72osgz92A

If a call is made without supplying app credentials or by supplying incorrect app credentials, the call will return with an error 401 (Not Authorized). Similarly, an invalid or missing user token when required will result in the same response. A 500-range code indicates a temporary outage and should be reported.

PING

Verifies connectivity with the cloud service and validates that the app credentials and user token are acceptable. This call performs no operation. Clients can check the HTTP status code. A code of 200 indicates success.

Endpoint URL

/v1/ping

Query string

None

Request body

None

Request example

N/A

Response body

None

Response example

HTTP 200: OK

SESSIONS

Retrieves historical session data for the user. Previously-logged sessions are available via this call.

Endpoint URL

/v1/sessions

X-User-Token

Required

Query string

from

The start time of the earliest session that should be returned. If this parameter is specified without the to parameter, then all sessions from this time until now are returned.

to

The optional time of the latest session to return. Specifying this will return a range of sessions between from and to.

Request body

None

Request example

https://api.developer.oralb.com/v1/sessions?from=2015-02-20T12:40:45.327-07:00&to=

Response body

A JSON array of objects containing the following fields:

id

The session ID

handleId

Unique identifier for the brushing handle used in the session.

handleSessionId

The session ID provided by the handle.

timeStart

The session start time.

timeEnd

The session end time.

pressureTime

The amount of time during the session where pressure was detected, in seconds.

pressureCount

The number of pressure events that occurred during the session.

preferredBrushMode

The brush mode used most during the session.

createDate

The time the session was recorded with the cloud API.

brushingDuration

The amount of time brushing occurred.

Request example

[{
     “id”: “12”,
     “handleId”: “123”,
     “handleSessionId”: 1234567890,
     “timeStart”:”2015-02-20T12:40:45.327-07:00”,
     “timeEnd”:” 2015-02-20T12:40:45.327-07:00”,
     “pressureTime”: 120,
     “brushingDuration”: 120,
     “pressureCount”: 12,
     “preferredBrushMode”: 0,
     “createDate”:”2015-02-20T12:40:45.327-07:00”,
},
…]

Invalid request example

{
     "message": "Error validating the request.",
     "errors": [
          "from is required"
     ]
}]

Oral-B iOS SDK

Abstract

The OBTSDK provides registered developers with interfaces to:

  • discover Bluetooth enabled Oral-B toothbrushes (SmartSeries 6000 and higher) via Bluetooth Low Energy (BLE)
  • connect to Oral-B toothbrushes
  • receive updates on state changes of the connected toothbrush, such as brushing time, device state, ...
  • receive brush sessions from a user's Oral-B Cloud account

Moreover the SDK will automatically synchronize brush sessions recorded with a connected toothbrush with the Oral-B Cloud service.

Given that a user granted access, you can pull all brush sessions of a user.

The Oral-B toothbrush is modeled into OBTBrush. Brush sessions are encapsulated in the OBTBrushSession model.

Authentication

The Oral-B SDK differentiates between two tiers auf authentication: Developer authentication and User authentication.

If you just want to interact with the toothbrush, the Developer authentication is sufficient. However, if you want to access a users brush sessions you have to ask for permissions first.

Please note

If you are building an app which is used to regularly record the users sessions the user would expect that you allow him to connect your app to the Cloud. Otherwise the sessions recorded while using your app might not be synced to the users cloud account.

Developer Authentication

To use this SDK you will have to obtain an APP ID and APP KEY. Register an developer account on developer.oralb.com and create an application with the current Bundle ID.

Invoke the SDK's +setupWithAppID:appKey: method with your personal AppID and Key.

[OBTSDK setupWithAppID:<YourAppID> appKey:<YourAppKey>];

Please note: There is a known bug in the setup flow which creates a misleading Log print telling you the AppID or App Key is wrong. Please ignore this first log. If it occurs more than once, your AppID or App Key could really be wrong.

User Authentication

To allow a user to (automatically) sync sessions recorded with your app to their Oral-B Cloud account and to be able to fetch all sessions recorded by a user, you have to ask the user to grant permissions to your application. This is handled by the SDK (via Modal View Controller).

Quick Start

Installation

Manually

Download the OBTSDK for iOS and add the OBTSDK.framework to your Xcode project. Make sure it's added both to Embedded Libraries and Linked Frameworks and Libraries of your app (open your project settings, select app target, these settings will be listed under General tab). Import the framework's header where needed: #import <OBTSDK/OBTSDK.h>.

Connect a toothbrush & retrieve data

To connect to a toothbrush, you have to follow these steps:

  1. Init the SDK with your APP ID and APP KEY.
  2. Add yourself as a delegate to the OBTSDK
  3. Listen to -nearbyToothbrushesDidChange: and connect to a brush using +connectToothbrush:
  4. Listen to any of the relevant callbacks of the OBTSDKDelegate, e.g. -toothbrush:didUpdateBrushingDuration: in case you want to display the brush time

Example

// 1. Authorize yourself as a third party app; you might as well subscribe to authorization change notifications
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(developerAuthChanged:) name:OBTDeveloperAuthenticationStatusChangedNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(userAuthChanged:) name:OBTUserAuthenticationStatusChangedNotification object:nil];
[OBTSDK setupWithAppID:@"{APP_APPID}" appKey:@"{APP_APPKEY}"];

/* ... */

// 2. Add yourself as a delegate
[OBTSDK addDelegate:self];

/* ... */

// 3. Check for nearby brushes and connect
- (void)nearbyToothbrushesDidChange:(NSArray *)nearbyToothbrushes
{
dispatch_async(dispatch_get_main_queue(), ^{
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:TableViewSectionToothbrushes] withRowAnimation:UITableViewRowAnimationAutomatic];
});
}

/* ... */

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
/* ... */
OBTBrush *brush = nearbyBrushes[indexPath.row];
[OBTSDK connectToothbrush:brush];
/* ... */
}

// 4. Implement callbacks from OBTSDKDelegate protocol
- (void)toothbrush:(OBTBrush *)toothbrush didUpdateBrushingDuration:(NSTimeInterval)brushingDuration
{
NSLog(@"brushing duration changed to: %.2f s", brushingDuration);
}

Fetch a user's brush sessions

To retrieve brush sessions from a user, you have to follow these steps:

  1. Init the SDK with your APP ID and APP KEY.
  2. Ask the user to authorize your application using +presentUserAuthorizationFromViewController:completion: (user will be redirected to grant permissions)
  3. On successful authorization you can invoke +loadSessionsFromDate:toDate:completionBlock:errorBlock:

Example

// 1. Authorize yourself as a third party app; you might as well subscribe to authorization change notifications
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(developerAuthChanged:) name:OBTDeveloperAuthenticationStatusChangedNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(userAuthChanged:) name:OBTUserAuthenticationStatusChangedNotification object:nil];
[OBTSDK setupWithAppID:@"{APP_APPID}" appKey:@"{APP_APPKEY}"];

// 2. Ask for user authentication
[OBTSDK presentUserAuthorizationFromViewController:self completion:^(BOOL success, NSError *error) {
if(success) {
[self loadSessions];
} else {
// handle error
}
}];

// 3. Load sessions
[OBTSDK loadSessionsFromDate:startDate toDate:todayDate completionBlock:^(NSArray *sessions)
{
// handle sessions

} errorBlock:^(NSError *error) {

// handle error
}];

Core Models

OBTBrush

The OBTBrush class models an Oral-B toothbrush. To obtain such an object you have to listen to -nearbyToothbrushesDidChange:. Please note that some information is only available after you are connected to a brush.

name type description
Device State OBTDeviceState State of the device, indicating if it’s brushing, charging, idle, ...
Pressure BOOL Indicates whether the user applies to much pressure or not
Brushing Time NSTimeInterval Duration of the current brushing session
Brushing Mode OBTBrushMode Currently used brush mode
Sector int Current quadrant / sector the user should brush
Battery Level float Battery level of the toothbrush
Handle Type NSString Type of toothbrush (e.g. SmartSeries 6000 (5-Mode))
Cached Brush Data NSArray Provides access to the cached sessions stored on the toothbrush
OBTDeviceState

This enumeration descibes the state of the toothbrush.

state description
OBTDeviceStateUnkown The device state is unknown at the moment
OBTDeviceStateIdle The toothbrush is in idle state (not brushing)
OBTDeviceStateBrushing The toothbrush is running (brushing)
OBTDeviceStateCharger The toothbrush has been put on the charger
OBTBrushMode

This enumeration descibes the different available brush modes of the toothbrush.

OBTBrushSession

This class represents a single brush session of a user.

name type description
brushSessionID long long to identify the current brush session. (read-only)
brushDate NSDate date of the current brush session
brushingDuration NSTimeInterval total brushing duration of the cureent session
totalPressureDuration NSTimeInterval total pressure duration during the current session
numberOfPressureEvents NSUInteger number of pressure events during the current session
numberOfStartEvents NSUInteger number of start events during this seesion. This includes the session restart after a pause
preferredBrushMode OBTBrushMode brush mode used the most time of this session.

Oral-B SDK

Abstract

The Oral-B SDK provides authorized developers with access to Oral-B Bluetooth enabled toothbrushes and/or the Oral-B cloud.

Therefore the OBTSDK provides interfaces to:

  • discover Bluetooth enabled Oral-B toothbrushes (SmartSeries 6000 and higher) via Bluetooth Low Energy (BLE)
  • connect to Oral-B toothbrushes
  • receive updates on state changes of the connected toothbrush, such as brushing time, device state, ...
  • receive brush sessions from a user's Oral-B Cloud account

Moreover the OBTSDK will automatically synchronize brush sessions recorded with a connected toothbrush with the Oral-B Cloud service.

Given that a user granted access, you can pull all brush sessions of a user.

The Oral-B toothbrush is modeled into OBTBrush. Brush sessions are encapsulated in the OBTBrushSession model.

Oral-B Developer Portal / How To Become An Authorized Third-Party Developer

To become a authorized third-party developer you have to sign up for a Oral-B third-party developer account. Registered third-party developers can then request an APP-ID and APP-KEY for his own applications.

Add Permissions for Bluetooth and Internet To Your Applications Manifest

If your application wants to make use of the Bluetooth library and connect to Bluetooth enabled Oral-B toothbrushes, you have to add the BLUETOOTH and INTERNET permissions to the manifest:


    <uses-permission android:name="android.permission.BLUETOOTH"/>

	<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>

	<uses-permission android:name="android.permission.INTERNET"/>
	
	<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

Authentication

The Oral-B SDK differentiates between two tiers auf authentication: Developer authentication and User authentication.

If you just want to interact with the toothbrush, the Developer authentication is sufficient. However, if you want to access a users brush sessions you have to ask for permissions first.

Please note

If you are building an app which is used to regularly record the users sessions the user would expect that you allow him to connect your app to the Cloud. Otherwise the sessions recorded while using your app might not be synced to the users cloud account.

Developer Authentication

Add APP-ID And APP-KEY To Your Applications Manifest

To authorize your application, you have to add the APP-ID and APP-Key to the meta-data of your application in your manifest:


	<application android:label="@string/app_name" ...>
	
	  	...
	  	
	    <meta-data android:name="com.obt.sdk.ApplicationId" android:value="@string/obt_sdk_app_id"/>
	    
		<meta-data android:name="com.obt.sdk.ApplicationKey" android:value="@string/obt_sdk_app_key"/>
		
	    ...
	    
	</application>

Afterwards you have to first invoke OBTSDK.initialize(Context context) to initialize the SDK. Then you can call OBTSDK.authorizeSdk(OBTSdkAuthorizationListener listener) to receive developer authorization and be able to discover and connect to Oral-B toothbrushes.

User Authentication

To allow a user to (automatically) sync sessions recorded with your app to their Oral-B Cloud account and to be able to fetch all sessions recorded by a user, you have to ask the user to grant permissions to your application. This will be done using OAuth 2 and is handled by the SDK.

You have to invoke OBTSDK.authorizeApplication(OBTAuthorizationListener listener) to do so.

Add Connection Activity To Your Applications Manifest

If your application wants to use the Bluetooth library and connect to Bluetooth enabled Oral-B Toothbrushes and/or wants to use the Oral-B Cloud, you have to add following activity to your application in your manifest:


	<activity android:name="com.obt.OBTActivity"
	
          android:orientation="portrait"
          
          android:theme="@android:style/Theme.Translucent.NoTitleBar"
          
          android:label="@string/app_name" />

Quick Start

Installation

Manually with Android Studio and Gradle

Create a repository from a basic directy using 'flatDir' in build.gradle in project root:

    repositories {
        mavenCentral()
        flatDir {
            dirs 'libs'
        }
    }

Then reference the .aar as dependency in build.gradle of your module:

    dependencies {
      compile(name:'libraryfilename', ext:'aar')
    }

Initialization of Oral-B SDK


	public class DemoApplication extends Application {

    	@Override
    	public void onCreate() {
    		super.onCreate();
    		try {
    		    //Call to initialize the OBTSDK
    			OBTSDK.initialize(this);
    		} catch (PackageManager.NameNotFoundException e) {
    			e.printStackTrace();
    		}
    	}
    }
    
    public class DemoActivity extends Activity implements OBTSdkAuthorizationListener {
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_bluetooth);
    
            try {                
                OBTSDK.authorizeSdk(this);
            } catch (IllegalStateException e) {
                //App ID or App Key not set. Have you forgot to call initialize first or to add them to the manifest? Please see documentation for more details.
            }
        }
        
        @Override
        public void onSdkAuthorizationSuccess() {
            //We are now allowed to use bluetooth connectivity features
        }
    
        @Override
        public void onSdkAuthorizationFailed(int failureCodes) {
            //Something went wrong, need to check failure code for detailed information
        }

Start searching Oral-B toothbrushes and connect to one

To connect to a toothbrush, you have to follow these steps:

  1. Init the SDK with your APP ID and APP KEY.
  2. Authorize SDK
  3. Add yourself as a OBTBrushListener to the OBTSDK via OBTSDK.setOBTBrushListener(OBTBrushListener listener)
  4. Listen to onNearbyBrushesFoundOrUpdated(List<OBTBrush> nearbyBrushes) and connect to a brush using OBTSDK.connectToothbrush(OBTBrush brush)
  5. Listen to any of the relevant callbacks of the OBTBrushListenerAdapter or OBTBrushListener, e.g. onBrushingTimeChanged(int brushingTime) in case you want to display the brush time

    private OBTBrushAdapter obtBrushAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_bluetooth);

        // Creating a ListView to show nearby Oral-B Toothbrushes
        ListView nearbyOralBToothbrushList = (ListView) findViewById(R.id.found_brushes_list);

        // Instantiate a custom adapter to hold the Oral-B Toothbrushes and set it to the list
        obtBrushAdapter = new OBTBrushAdapter();
        nearbyOralBToothbrushList.setAdapter(obtBrushAdapter);

        // Set OnItemClickListener to the ListView
        nearbyOralBToothbrushList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
                @Override
                public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
                    // Connect to chosen Oral-B Toothbrush
                    OBTSDK.connectToothbrush(obtBrushAdapter.getItem(position));
                }
        });
    }

    @Override
    public void onResume() {
        super.onResume();
        // Set this activity as OBTBrushListener
        OBTSDK.setOBTBrushListener(this);
    }

    @Override
    protected void onPause() {
        super.onPause();
        // Remove the OBTBrushListener
        OBTSDK.setOBTBrushListener(null);
    }

    @Override
    public void onNearbyBrushesFoundOrUpdated(List<OBTBrush> nearbyBrushes) {
        // Clear the custom adapter and set found Oral-B Toothbrushes as items
        obtBrushAdapter.clear();
        obtBrushAdapter.addAll(nearbyBrushes);
        obtBrushAdapter.notifyDataSetChanged();
    }

    @Override
    public void onBrushingTimeChanged(int brushingTime) {
        // Show brushing time in ui
    }

Fetch a user's brush sessions

To retrieve brush sessions from a user, you have to follow these steps:

  1. Init the SDK with your APP ID and APP KEY.
  2. Authorize SDK
  3. Ask the user to authorize your application using OBTSDK.authorizeApplication(OBTAuthorizationListener listener) (user will be redirected to grant permissions)
  4. On successful authorization you can invoke OBTSDK.fetchUserSessions(long from, OBTCloudListener callback)

Oral-B SDK Interface-Methods

The Oral-B SDK provides following functionality:

	public static void initialize(@NonNull Context context) throws PackageManager.NameNotFoundException

This method will initialize the OBT SDK with your APP-ID and APP-KEY. Make sure to have added these values to your manifest!

	public static void authorizeApplication(OBTUserAuthorizationListener listener)

This method needs to be called to let the user authorize your application to access the Oral-B Cloud

	public static boolean isBluetoothAvailableAndEnabled()

This method checks whether Bluetooth Low Energy is available and enabled

	public static void startScanning()

This method starts scanning for Bluetooth enabled Oral-B Toothbrushes

	public static void stopScanning()

This method stops scanning for Bluetooth enabled Oral-B Toothbrushes

	public static void connectToothbrush(OBTBrush brush, boolean showOBTActivityForKnownBrush)

This method connects to a specific Bluetooth enabled Oral-B Toothbrush. IF this is the first time connecting to this specific toothbrush, the SDK will show it's own activity to guide the user through the connection process. For all consecutive connections to a "known" toothbrush, the flag showOBTActivityForKnownBrush can be used to always show this activity or to connect in background.

	public static void disconnectToothbrush() 

This method disconnects a currently connected Bluetooth enabled Oral-B Toothbrush

	public static boolean isConnected()

This method checks if there is any Bluetooth enabled Oral-B Toothbrush currently connected

	public static boolean isScanning()

This method checks if the OBT SDK is currently scanning for Bluetooth enabled Oral-B Toothbrushes

	public static OBTBrush getConnectedToothbrush()

This method retrieves currently connected Bluetooth enabled Oral-B Toothbrush

	public static OBTBrush getPreferableToothbrush()

This method retrieves currently preferable Bluetooth enabled Oral-B Toothbrush

	public static List<OBTBrush> getNearbyToothbrushes()

This method retrieves a list of all Bluetooth enabled Oral-B Toothbrushes nearby

OBTBrushListener

This interface will receive callbacks from Oral-B Toothbrushes. It provides following methods:

    void onNearbyBrushesFoundOrUpated(List<OBTBrush> nearbyBrushes);

This method will be called whenever the list of nearby Oral-B Toothbrushes changes

    void onBluetoothError();

This method will be called when a Bluetooth error occurred

    void onBrushDisconnected();

This method will be called when Oral-B Toothbrush disconnects

    void onBrushConnected();

This method will be called when connection to a Oral-B Toothbrush was successful

    void onBrushingTimeChanged(long brushingTime);

This method will be called when the reported brushing time of the connected Oral-B Toothbrush changes in milliseconds

    void onBrushingModeChanged(int brushingMode);

This method will be called when the current brushing mode of the connected Oral-B Toothbrush changes

    void onDeviceStateChanged(int deviceState);

This method will be called when the current device state of the connected Oral-B Toothbrush changes

    void onRSSIChanged(int rssi);

This method will be called when the RSSI of the connected Oral-B Toothbrush changes

    void onBatteryLevelChanged(float batteryLevel);

This method will be called when the battery level of the connected Oral-B Toothbrush changes

    void onSectorChanged(int sector);

This method will be called when the reported sector of the connected Oral-B Toothbrush changes

    void onPressureChanged(boolean isHighPressure);

This method will be called when the high pressure value of the connected Oral-B Toothbrush changes

    void onAvailableBrushModesChanged(List<Integer> availableModes);

This method will be called when the available brush modes of the connected Oral-B Toothbrush changes

OBTCloudListener

This interface will receive callbacks from Oral-B Cloud. It provides following methods:

    void onSessionsLoaded(List<OBTSession> obtSessions);

This method will be called when sessions of the user were retrieved from the Oral-B Cloud

    void onFailure(int code, String message);

This method will be called when there was an error during communication with the Oral-B Cloud

OBTAuthorizationListener

This interface will receive callbacks from Oral-B Cloud authorization process. It provides following methods:

    void onAuthorizationSuccess();

This method will be called when application was successful authorized by the user

    void onAuthorizationFailed();

This method will be called when the authorization has failed

    void onAuthorizationCanceled();

This method will be called when the user has canceled the authorization process