ABSTRACT
The iBKS SDK for Android is a library which allows communication, managing and interaction with iBKS Beacons.
The iBKS SDK function prototypes covers the following five packages integrated in the library:
- Connection
- Scan
- Eddystone Service
- iBeacon Service
- Global Service
AUDIENCE
The iBKS SDK is primarily focused for Android software developers with basic knowledge of beacon configuration
This SDK will help you to manage iBKS Beacons with your own Android APP in a few easy steps.
All you need:
-
Android Studio
-
Android device with 5.0 version or above.
-
At least one iBKS Beacon with FW version “EDSTEID V5.2016.06.29.1” or above.
First of all, create a new Android Studio project and add the iBKS SDK to the build.gradle (Module:app) declaring the following dependency:
compile 'com.accent_systems.ibks-sdk:ibks-sdk:1.0.3'
The minSdkVersion of the app should be 21 or higher because there are some Bluetooth functions that don’t work for older Android SDK versions.
- App permissions
In order to manage Bluetooth in Android it’s necessary to request some permissions at user.
If the Android version is 6.0 or higher it’s necessary to request location permission. To do this, it’s necessary to add permission in AndroidManifest.xml
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
In order To use Bluetooth in Android device, the first thing to do is check if the device that runs the app has Bluetooth Low Energy (beacons work with this type of Bluetooth) and if it is enabled. To enable Bluetooth it’s necessary to add permission in AndroidManifest.xml
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
In order to use some functions that request access to internet, it’s necessary to add permissions on AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET" />
- EID registration
If you would like to use the EID registration in your APP, follow these steps:
-
Log in to **Google Console Developers **
-
Enable Proximity Beacon API
-
Create the Credentials for your APP:
-
Android API key for your package.
-
OAuth Client ID for your package.
It’s possible that you may wait some minutes or hours to grant the access to the API.
The users of your APP don’t need to create Credentials but they should also enable the Proximity Beacon API on their account.
- Compile your project
Now, compile your project and you are ready for playing with iBKS-SDK.
We recommend to have a look at “iBKS SDK Sample Project” before starting with your own project in order to get used to iBKS-SDK.
- Get started with a sample project
From this github project, you will find the “iBKS SDK Sample Project”. This example shows how to do the main tasks on a Bluetooth APP such as:
-
Scan devices
-
Connect devices
-
Read/Write characteristics
-
Set/Get Eddystone Slots
-
Register EID beacon
-
Get EID in Clear
-
Set/Get iBeacon Slots
-
Set/Get Characteristics of Global service
-
Get client account and Google project Id
-
Parse advertising data
The “iBKS SDK Sample Project” App starts with a scan of Bluetooth devices. When an item of the list is clicked, the app establishes the connection with the beacon that allows you to do any of the tasks mentioned above. Follow the next steps to start playing:
-
Download the project
-
Open the project with Android Studio
-
Compile the project
-
Try the example on your mobile device
Last update: 2019/01/14