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.
If you are using version 2.2.0 still, you are required to change the base URL in your Application class in a static initializer:
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.
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 dev preview branch the permission ACCESS_FINE_LOCATION 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, but you can still receive those generated by beacons, provided your app holds ACCESS_COARSE_LOCATION permission
Tip: Pretty ADB log with Android Bluetooth messages hidden
Use pidcat with grep to show your log and hide the System Bluetooth scan logs: