Android – Integration checklist

The following checklist ensures the successful integration of the Bluedot Android SDK into your app. Please make sure every step has been completed before you attempt to run your app.

1. Login to your Bluedot account and create an application; don’t forget to keep your API key, package name and email address handy.
2. Download the Android Point SDK and place it into the libs folder of your app project.

image

AndroidManifest.xml changes

When integrating Bluedot Point SDK using the AAR, there is no need to add permissions or the services used by the SDK inside the app’s AndroidManifest.xml file. As these declarations are imported from the AndroidManifest.xml bundled inside the AAR.

3. In the AndroidManifest.xml file, add the following permissions and service configurations:

<!-- General Point SDK functionality -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETE" />
<!-- Required for Beacons integration -->
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<!-- General Point SDK functionality -->
<service
android:name="au.com.bluedot.point.net.engine.BlueDotPointService"
android:exported="false">
</service>

<service android:name="au.com.bluedot.point.net.engine.DataJobScheduler"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE" />

<service android:name="au.com.bluedot.point.net.engine.DataIntentService" 
android:exported="false" 
android:permission="android.permission.BIND_JOB_SERVICE" />

<service android:name="au.com.bluedot.point.net.engine.BluedotLocationService"
    android:exported="false"/>

<receiver
 android:name="au.com.bluedot.point.net.engine.BluedotBootReceiver"
 android:directBootAware="true"
 android:enabled="false"
 android:exported="false">
 <intent-filter>
  <action android:name="android.intent.action.BOOT_COMPLETED" />
  <action android:name="android.intent.action.QUICKBOOT_POWERON" />
  <action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />
 </intent-filter>
</receiver>
<!-- Required for Beacons integration --> 
<service android:name="au.com.bluedot.point.beacon.BlueDotBLEService" 
android:exported="false"> </service>

4. Get the instance of ServiceManager via the static method, with getInstance passing the context.
5. Subscribe for Application Notifications if you configured a Custom Action in Point Access, as shown below:

public class BDTestApplication extends Application implements ServiceStatusListener,ApplicationNotificationListener{
     
    @Override
    public void onBlueDotPointServiceStartedSuccess() {
        mServiceManager.subscribeForApplicationNotification(this);
 
    }
    ...
}

6. Before starting the Point Service, check if it is already running via the isBlueDotPointServiceRunning method in ServiceManager.
7. Implement the ServiceStatusListener in your Application; pass it to the sendAuthenticationRequest in ServiceManager to start Bluedot Point Service in the onCreate callback with your credentials from step 1:

mServiceManager = ServiceManager.getInstance(this);
     
if(!mServiceManager.isBlueDotPointServiceRunning()){
    mServiceManager.sendAuthenticationRequest("API KEY", this);
}

8. Write your app logic code in onBlueDotPointServiceStartedSuccess. Do not forget to handle errors if something goes wrong by utilizing the onBlueDotPointServiceError callback.
9. To unsubscribe the ApplicationNotificationListener , call the unsubscribeForApplicationNotification method in the ServiceManager.
10. Finally, you have to shut down the Bluedot Point Service when your app finishes with it by calling the stopPointService method in ServiceManager.

Created by Bluedot DevOps on June 19, 2018

Start the discussion