Skip to main content

Initialization

You can initialize the SDK with the following code:

Dockware.builder
.sharedPreferences(preferences) # (optional)
.apiKey(BuildConfig.EXTERNAL_API_KEY)
.build()

If using the dockware-auth module, you can additionally replace the apiKey function in the builder pattern with managedAuth():

Dockware.builder
.sharedPreferences(preferences)
.managedAuth()
.build()

This will grant use of an auth property to the Dockware instance to manage authentication with dockware accounts. See more here.

The dockware instance can be accessed anywhere with the syntax:

Dockware.instance