Skip to content

HowToInclude

MKer edited this page May 31, 2022 · 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 {
    ...
    implementation 'com.github.MKergall:osmbonuspack:6.9.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.

In your build.gradle, add the following lines:

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

Then set the following dependencies:

dependencies {
    compile(name:'osmbonuspack_6.9.0', ext:'aar')
    implementation 'org.osmdroid:osmdroid-android:6.1.13'
    implementation 'org.apache.commons:commons-lang3:3.8.1'
    implementation 'com.google.code.gson:gson:2.8.6'
    implementation 'com.squareup.okhttp3:okhttp:4.7.2'
}