Skip to content

How to add the osmdroid library via Gradle

spyhunter99 edited this page Apr 25, 2020 · 19 revisions

osmdroid-android (the map engine)

If you use Gradle you have to add the following dependency to your build.gradle file:

dependencies {
    implementation 'org.osmdroid:osmdroid-android:(INSERT_VERSION_HERE)'
}

osmdroid-wms

Adds basic support for WMS servers, specifically GeoServer

dependencies {
    implementation 'org.osmdroid:osmdroid-wms:(INSERT_VERSION_HERE)'
}

osmdroid-mapsforge

Adds Maps Forge support

dependencies {
    implementation 'org.osmdroid:osmdroid-mapsforge:(INSERT_VERSION_HERE)'
}

osmdroid-geopackage

Adds geopackage support

dependencies {
    implementation 'org.osmdroid:osmdroid-geopackage:(INSERT_VERSION_HERE)'
}

osmdroid-third-party (google maps)

NOTICE: This library is no longer maintained. It is still in the source code repo but we no longer publish release artifacts for it. The last release version of it is 6.0.1. The most capabilities was moved into osmdroid-android. This library only contains a Google Maps API abstraction which no longer works due to changes made by Google.

osmdroid also has an optional library to provide additional features of 3rd party organizations.

dependencies {
    implementation 'org.osmdroid:osmdroid-third-party:6.0.1'
}