Skip to content

HowToInclude

MKer edited this page Mar 28, 2019 · 29 revisions

Prerequisites

You should be familiar with Android SDK.

OSMBonusPack library is available as an AAR.

1. Including using JitPack

OSMBonusPack is available through JitPack (it is not available on Maven Central).

In the build.gradle of your Project (top level), add the jitpack repository:

repositories { 
     ...
     maven { url "https://jitpack.io" }
}

Then in the build.gradle of your app, add this dependency:

dependencies {
    ...
    compile 'com.github.MKergall:osmbonuspack:6.6.0'
}

and that's it.

2. Including as a local lib

  • In Releases, download the latest osmbonuspack.aar file.
  • create a "libs" directory at the root of your project, and copy the file inside.
  • No need to copy default resources for bubbles, as they are already included in the AAR.
  • No need to copy other libraries.

In your build.gradle, add the following lines:

repositories {
    mavenCentral()
    flatDir {
      dirs 'libs'
    }
}

Then set the following dependencies:

dependencies {
    compile(name:'osmbonuspack_v6.6.0', ext:'aar')
    compile 'org.osmdroid:osmdroid-android:6.1.0'
    compile 'org.apache.commons:commons-lang3:3.3.4'
    compile 'com.google.code.gson:gson:2.8.5'
    compile 'com.squareup.okhttp3:okhttp:3.10.0'
}