Class BlukiiController

java.lang.Object
com.blukii.sdk.common.BlukiiController

public final class BlukiiController extends Object

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 Details

    • init

      public static BlukiiController init(@NonNull android.content.Context context)
      Initializes the BlukiiController instance. It can only be called once.
      Parameters:
      context - a valid Application context
      Returns:
      an instance of BlukiiController
      See Also:
    • getInstance

      public static BlukiiController getInstance()
      Gets an instance of BlukiiController.

      BlukiiController needs to be initialized before by calling init(Context)

      Returns:
      an instance of BlukiiController
      See Also:
    • getDiscoveryClient

      public BlukiiClient getDiscoveryClient()
      Gets an instance of the discovery main controller class BlukiiClient.
      Returns:
      an instance of BlukiiClient
      See Also:
    • getInfoClient

      public BlukiiInfo getInfoClient()
      Gets an instance of the info main controller class BlukiiInfo.
      Returns:
      an instance of BlukiiInfo
      See Also:
    • getConfigDataManager

      public DataManager getConfigDataManager()
      Gets an instance of the config class DataManager.
      Returns:
      an instance of DataManager
      See Also:
    • getNewBlukiiConfig

      public Blukii getNewBlukiiConfig(android.bluetooth.BluetoothDevice device)
      Creates and retrieves an instance of class Blukii for the connection base communication with one blukii device.
      Parameters:
      device - actual bluetooth device
      Returns:
      an instance of Blukii
      See Also:
    • getNewSmartBeaconConfig

      public SmartBeacon getNewSmartBeaconConfig(android.bluetooth.BluetoothDevice device)
      Creates and retrieves an instance of class SmartBeacon for the connection base communication with one blukii Smart Beacon device.
      Parameters:
      device - actual bluetooth device
      Returns:
      an instance of SmartBeacon
      See Also:
    • getNewSmartKeyConfig

      public SmartKey getNewSmartKeyConfig(android.bluetooth.BluetoothDevice device)
      Creates and retrieves an instance of class SmartKey for the connection base communication with one blukii SmartKey device.
      Parameters:
      device - actual bluetooth device
      Returns:
      an instance of SmartKey
      See Also:
    • getCloud

      public BlukiiCloud getCloud()
      Gets an instance of the cloud controller class BlukiiCloud.
      Returns:
      an instance of BlukiiCloud
      See Also: