Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • B B4S-Android-SDK
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Francois Reboursier
  • B4S-Android-SDK
  • Wiki
  • Installation with Gradle

Installation with Gradle · Changes

Page history
Separated installation guide for Gradle build system authored Nov 20, 2015 by Eric Kok's avatar Eric Kok
Hide whitespace changes
Inline Side-by-side
Installation-with-Gradle.md 0 → 100644
View page @ 335f3b3b
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
Clone repository
  • Home
  • Installation with Eclipse Ant
  • Installation with Gradle
  • Integration guide
  • Migration guide