|
|
For the full requirements and configuration, please see the [[Integration Guide|Integration-guide]].
|
|
|
|
|
|
## Requirements
|
|
|
|
|
|
The beacon technology is based on **Bluetooth 4.0 LE**, also called Low Energy or Bluetooth Smart Ready. It is available on most Android devices, with a minimum of **Android 4.3**, API level 18. Please ensure that Play Services are installed and that Bluetooth is enabled as well as Location Services.
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
The SDK is distributed in .AAR format, which includes metadata such as definitions for its services. To add .AAR files to your application, first ensure that the build scripts can find them. In your root `build.gradle` file you should have a `repositories` element, to which the plain libraries directory should be added, typically called `libs`:
|
|
|
```groovy
|
|
|
allprojects {
|
|
|
repositories {
|
|
|
jcenter()
|
|
|
flatDir{
|
|
|
dirs 'libs'
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
```
|
|
|
See [the `sample-gradle` project's `build.gradle` file](https://github.com/ezeeworld/B4S-Android-SDK/blob/master/sample-gradle/build.gradle) for an example.
|
|
|
|
|
|
Next, add all the B4S dependencies and reference it's .AAR files in the main application's `app/build.gradle` file:
|
|
|
```groovy
|
|
|
dependencies {
|
|
|
compile 'de.greenrobot:eventbus:2.4.0'
|
|
|
compile 'com.squareup.retrofit:retrofit:2.0.0-beta2'
|
|
|
compile 'com.squareup.retrofit:converter-jackson:2.0.0-beta2'
|
|
|
compile 'com.google.android.gms:play-services-location:8.3.0'
|
|
|
compile 'com.google.android.gms:play-services-ads:8.3.0'
|
|
|
compile 'com.google.android.gms:play-services-gcm:8.3.0'
|
|
|
compile (name:'b4s-android-sdk', ext:'aar')
|
|
|
compile (name:'b4s-android-sdk-playservices830', ext:'aar')
|
|
|
}
|
|
|
```
|
|
|
|
|
|
**Important**: This example relies on the Play Services version 8.3 (v28), but the SDK is compatible with all versions of the Play Services. Simply refer to the desired `play-services-xxx` libraries as usual and select the corresponding `b4s-android-sdk-playservicesXXX` .AAR file. For example, if the Play Services 6.5 (v22) should be used instead:
|
|
|
```groovy
|
|
|
...
|
|
|
compile 'com.google.android.gms:play-services-location:6.5.87'
|
|
|
compile 'com.google.android.gms:play-services-ads:6.5.87'
|
|
|
...
|
|
|
compile (name:'b4s-android-sdk-playservices650', ext:'aar')
|
|
|
```
|
|
|
|
|
|
Finally, **copy the `b4s-android-sdk.aar`** and the 'b4s-android-sdk-playservicesXXX.aar' version of your choice from the [`/sdk/aar` release folder](https://github.com/ezeeworld/B4S-Android-SDK/tree/master/sdk/aar) to your `app/libs` directory.
|
|
|
|
|
|
## Push messaging dependency
|
|
|
|
|
|
For push messaging support via the B4S SDK, ensure that the `play-services-gcm` library is properly specified in your `app/build.gradle` dependencies:
|
|
|
```groovy
|
|
|
compile 'com.google.android.gms:play-services-gcm:8.3.0'
|
|
|
}
|
|
|
```
|
|
|
|
|
|
## Configuration
|
|
|
|
|
|
Continue with the [[configuration as described in the main Integration Guide|Integration-guide]]. |
|
|
\ No newline at end of file |