Skip to content
Make with

MapLibre Native Android SDKOfficial

Official MapLibre Native SDK for Android

Maintained by MapLibre

The official MapLibre Native Android SDK offers Android developers direct access to MapLibre Native capabilities. Built for Java and Kotlin, it provides high-performance vector map rendering, offline map support, and comprehensive mapping features without requiring additional frameworks. The SDK includes full Android lifecycle management and MapView components.

Quick start

implementation("org.maplibre.gl:android-sdk:13.6.1")
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import org.maplibre.android.MapLibre
import org.maplibre.android.camera.CameraPosition
import org.maplibre.android.geometry.LatLng
import org.maplibre.android.maps.MapView

class MainActivity : AppCompatActivity() {
    private lateinit var mapView: MapView

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        MapLibre.getInstance(this) // before creating the MapView
        mapView = MapView(this)
        setContentView(mapView)
        mapView.onCreate(savedInstanceState)
        mapView.getMapAsync { map ->
            map.setStyle("https://tiles.openfreemap.org/styles/liberty")
            map.cameraPosition = CameraPosition.Builder()
                .target(LatLng(20.0, 0.0))
                .zoom(2.0)
                .build()
        }
    }

    // MapView must receive the activity's lifecycle callbacks
    override fun onStart() { super.onStart(); mapView.onStart() }
    override fun onResume() { super.onResume(); mapView.onResume() }
    override fun onPause() { super.onPause(); mapView.onPause() }
    override fun onStop() { super.onStop(); mapView.onStop() }
    override fun onLowMemory() { super.onLowMemory(); mapView.onLowMemory() }
    override fun onDestroy() { super.onDestroy(); mapView.onDestroy() }
    override fun onSaveInstanceState(outState: Bundle) {
        super.onSaveInstanceState(outState)
        mapView.onSaveInstanceState(outState)
    }
}
›Setup noteschecked with v13.6.1

The latest stable release is 13.6.1 (Maven Central). Ignore 13.6.1-pre0: it is a pre-release, even though maven-metadata lists it as newest. The official quickstart's example version (11.8.0) is out of date. Groovy DSL: implementation 'org.maplibre.gl:android-sdk:13.6.1'. The repository is mavenCentral(). Since 13.0.0, android-sdk renders with Vulkan. For OpenGL ES, use org.maplibre.gl:android-sdk-opengl (same version). Call MapLibre.getInstance(context) before the MapView is created or inflated. The official quickstart inflates a <org.maplibre.android.maps.MapView> from XML. This snippet creates the MapView in code with the public MapView(Context) constructor, so no layout file is needed. MapView's javadoc says onCreate(savedInstanceState) and every lifecycle method must be forwarded (the official test app does this; the quickstart skips onCreate). LatLng takes latitude first.

More platforms on Get started.

Used by 64 products

See all →