Starting with SDK 2.2.0-RAILS we're using newly implemented Sensorberg IoT RAILS platform as a backend.
This system upgrade will ensure better functionality, project use cases and simpler user experience.
As a result, a new account must be set up on the Sensorberg IoT platform in order to continue your projects.
This applies to every dependency change from non-RAILS version to -RAILS based version.
Simply create an account by visiting portal.sensorberg.com. You have the option to manually move your data (e.g., beacons, campaigns etc) to the new platform and continue to manage your account.
Alternatively, you may contact our support team at firstname.lastname@example.org for assistance in the migration procedure.
We do currently not see the need for our customers to target Android 8. If you have specific needs that require Android 8 APIs we would like to hear from you.
How to install the Sensorberg Android SDK
You will need to have the jcenter artifactory in your list of repositories and declare the dependency to our sdk.
If your application also uses Geofences, than you must also add the Google Play Services Location module
Declare your BroadcastReceiver:
You cannot add a BroadCastReceiver at runtime! We are using a LocalBroadcastManager to send the broadcast and find the receiver(s).
The BroadcastReceiver is running in another process
You should be aware, that the Sensorberg Android SDK is running in a separate process. The broadcast will be sent in the separate process as well. The intention of the BroadcastReceiver is to present the content of your Action when the app is in background.
Enable the SDK in your Application object and register foreground/background notifications:
It´s now time to implement the BroadcastReceiver:
This class receives a broadcast, if the SDK has detected a beacon and successfully resolved an associated Action.
There’re several ways of acquiring Advertiser ID which varies per platform. Here we’ll show for the Google ID.
And of course, if you need to remove it, just call it null
Android 6 Permissions
If you app will target android 6 you will need to prompt the user for location permissions before scanning will work - this should be down in the activity. For
a more in-depth discussion please see the Android 6 blog.
In your activity which would use the scanner you need to ask for (location permission) at runtime:
Then you must receive the callback.
Please note that if you're using geofencing the ACCESS_FINE_LOCATION permission is required in your manifest. This is caused by Google Play Services requirements under the hood.
If ACCESS_FINE_LOCATION is not given you won't receive geofence notifications
Tip: Pretty ADB log with Android Bluetooth messages hidden
Use pidcat with grep to show your log and hide the System Bluetooth scan logs: