Class BlukiiController
Main controller of blukii SDK
BlukiiController controls the instantiation of all package controllers that can only be loaded by BlukiiController.
Note: There must be only one BlukiiController instance to prevent multiple instantiations of package controllers and data structures.
To use the blukii SDK you have to provide a free API key (Basic). You can create an API key with Basic Permissions in your blukii Manager Account. To provide the API key add the following snippet to your Manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.blukii.sample.app" >
<application ...>
<meta-data
android:name="com.blukii.sdk.API_KEY"
android:value="API_KEY" />
<activity>
...
</activity>
</application>
</manifest>
After creating the instance by calling init(Context)
you have to call
getInstance()
to use the instance it afterwards. It is recommended to hold an instance
pointer inside an object that keeps valid during complete app lifetime.
Example Snippet
public class DemoApp extends Application {
private BlukiiController mBlukiiController;
@Override
public void onCreate() {
// init BlukiiController
mBlukiiController = BlukiiController.init(this);
}
}
public class MainActivity extends Activity {
private BlukiiCloud mBlukiiCloud;
@Override
protected void onCreate(Bundle savedInstanceState) {
// use BlukiiController (initialized in Application object)
mBlukiiCloud = BlukiiController.getInstance().getCloud();
}
}
-
Method Summary
Modifier and TypeMethodDescriptiongetCloud()
Gets an instance of the cloud controller classBlukiiCloud
.Gets an instance of the config classDataManager
.Gets an instance of the discovery main controller classBlukiiClient
.Gets an instance of the info main controller classBlukiiInfo
.static BlukiiController
Gets an instance ofBlukiiController
.getNewBlukiiConfig
(android.bluetooth.BluetoothDevice device) Creates and retrieves an instance of classBlukii
for the connection base communication with one blukii device.getNewSmartBeaconConfig
(android.bluetooth.BluetoothDevice device) Creates and retrieves an instance of classSmartBeacon
for the connection base communication with one blukii Smart Beacon device.getNewSmartKeyConfig
(android.bluetooth.BluetoothDevice device) Creates and retrieves an instance of classSmartKey
for the connection base communication with one blukii SmartKey device.static BlukiiController
init
(android.content.Context context) Initializes theBlukiiController
instance.
-
Method Details
-
init
Initializes theBlukiiController
instance. It can only be called once.- Parameters:
context
- a valid Application context- Returns:
- an instance of
BlukiiController
- See Also:
-
getInstance
Gets an instance ofBlukiiController
.BlukiiController
needs to be initialized before by callinginit(Context)
- Returns:
- an instance of
BlukiiController
- See Also:
-
getDiscoveryClient
Gets an instance of the discovery main controller classBlukiiClient
.- Returns:
- an instance of
BlukiiClient
- See Also:
-
getInfoClient
Gets an instance of the info main controller classBlukiiInfo
.- Returns:
- an instance of
BlukiiInfo
- See Also:
-
getConfigDataManager
Gets an instance of the config classDataManager
.- Returns:
- an instance of
DataManager
- See Also:
-
getNewBlukiiConfig
Creates and retrieves an instance of classBlukii
for the connection base communication with one blukii device.- Parameters:
device
- actual bluetooth device- Returns:
- an instance of
Blukii
- See Also:
-
getNewSmartBeaconConfig
Creates and retrieves an instance of classSmartBeacon
for the connection base communication with one blukii Smart Beacon device.- Parameters:
device
- actual bluetooth device- Returns:
- an instance of
SmartBeacon
- See Also:
-
getNewSmartKeyConfig
Creates and retrieves an instance of classSmartKey
for the connection base communication with one blukii SmartKey device.- Parameters:
device
- actual bluetooth device- Returns:
- an instance of
SmartKey
- See Also:
-
getCloud
Gets an instance of the cloud controller classBlukiiCloud
.- Returns:
- an instance of
BlukiiCloud
- See Also:
-