Klasse 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();
}
}
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibunggetCloud()Gets an instance of the cloud controller classBlukiiCloud.Gets an instance of the config classDataManager.Gets an instance of the discovery main controller classBlukiiClient.static BlukiiControllerGets an instance ofBlukiiController.getNewBlukiiConfig(android.bluetooth.BluetoothDevice device) Creates and retrieves an instance of classBlukiifor the connection base communication with one blukii device.getNewSmartBeaconConfig(android.bluetooth.BluetoothDevice device) Creates and retrieves an instance of classSmartBeaconfor the connection base communication with one blukii Smart Beacon device.getNewSmartPenConfig(android.bluetooth.BluetoothDevice device) Creates and retrieves an instance of classSmartBeaconfor the connection base communication with one blukii Smart Beacon device.static BlukiiControllerinit(android.content.Context context) Initializes theBlukiiControllerinstance.
-
Methodendetails
-
init
Initializes theBlukiiControllerinstance. It can only be called once.- Parameter:
context- a valid Application context- Gibt zurück:
- an instance of
BlukiiController - Siehe auch:
-
getInstance
Gets an instance ofBlukiiController.BlukiiControllerneeds to be initialized before by callinginit(Context)- Gibt zurück:
- an instance of
BlukiiController - Siehe auch:
-
getDiscoveryClient
Gets an instance of the discovery main controller classBlukiiClient.- Gibt zurück:
- an instance of
BlukiiClient - Siehe auch:
-
getConfigDataManager
Gets an instance of the config classDataManager.- Gibt zurück:
- an instance of
DataManager - Siehe auch:
-
getNewBlukiiConfig
Creates and retrieves an instance of classBlukiifor the connection base communication with one blukii device.- Parameter:
device- actual bluetooth device- Gibt zurück:
- an instance of
Blukii - Siehe auch:
-
getNewSmartBeaconConfig
Creates and retrieves an instance of classSmartBeaconfor the connection base communication with one blukii Smart Beacon device.- Parameter:
device- actual bluetooth device- Gibt zurück:
- an instance of
SmartBeacon - Siehe auch:
-
getNewSmartPenConfig
Creates and retrieves an instance of classSmartBeaconfor the connection base communication with one blukii Smart Beacon device.- Parameter:
device- actual bluetooth device- Gibt zurück:
- an instance of
SmartBeacon - Siehe auch:
-
getCloud
Gets an instance of the cloud controller classBlukiiCloud.- Gibt zurück:
- an instance of
BlukiiCloud - Siehe auch:
-