/mapbox-gl-native-android

Interactive, thoroughly customizable maps in native Android powered by vector tiles and OpenGL

Primary LanguageJavaOtherNOASSERTION

Circle CI build status

The Mapbox Maps SDK for Android is a library based on Mapbox GL Native for embedding interactive map views with scalable, customizable vector maps onto Android devices.

Getting Started

This particular README is for people who are interested in working on and improving the Maps SDK for Android. If you're looking for more general information and instructions on the Maps SDK:

Visit https://docs.mapbox.com/android/maps/overview to see current documentation on the Maps SDK for Android.

Visit https://docs.mapbox.com/android/api/map-sdk to view the Maps SDK's current API reference Javadoc files.

See the Mapbox website's Android install flow to install and use the Mapbox Maps SDK for Android in an application.

Setup environment

These instructions are for developers interested in making code-level contributions to the SDK itself. If you instead want to use the SDK in your app, see above.

Getting the source

Clone the git repository and pull in submodules:

git clone git@github.com:mapbox/mapbox-gl-native-android.git && cd mapbox-gl-native-android
git submodule update --init --recursive

Installing dependencies

Opening the project

Open the root folder of this repository in Android Studio.

Project configuration

Setup Mapbox Access token for dependency download

Add a Mapbox access token with scope set to DOWNLOADS:READ in the root build.gradle.

allprojects {
    repositories {
        maven {
            url 'https://api.mapbox.com/downloads/v2/releases/maven'
            authentication {
                basic(BasicAuthentication)
            }
            credentials {
                username = "mapbox"
                password = "INSERT_MAPBOX_ACCESS_TOKEN_HERE"
            }
        }
    }
}

Setup Checkstyle

Mapbox uses specific IDE settings related to code and check style. See checkstyle guide for configuration details.

Setup Mapbox Access Token for Mapbox vector tiles

The test application (used for development purposes) uses Mapbox vector tiles, which require a Mapbox account and API access token. Obtain a free access token on the Mapbox account page.

With the first gradle invocation, gradle will take the value of the MAPBOX_ACCESS_TOKEN environment variable and save it to MapboxGLAndroidSDKTestApp/src/main/res/values/developer-config.xml. If the environment variable wasn't set, you can edit developer-config.xml manually and add your access token to the mapbox_access_token resource.

Additional resources

Symbolicating native crashes

When hitting native crashes you can use ndk-stack to symbolicate crashes. More information in this guide.