mapbox-gl-native

Mapbox Android SDK

Bitrise

A library based on Mapbox GL Native for embedding interactive vector maps into Java applications on Android devices.

This repository is for day-to-day development of the SDK. Building the SDK yourself requires a number of dependencies and steps that are unnecessary for developing production applications. For production applications, please consider installing an official, prebuilt release instead; see the Mapbox Android SDK website for installation instructions.

Installing the SDK

Setting up the Android emulator

The Mapbox Android SDK requires Android 4.0.3+ (API level 15+).

If you want to run the test app in the emulator, we recommend the x86 build because it will run a lot faster.

First ensure you have an MAPBOX_ACCESS_TOKEN environment variable set, as described below. Then, create an x86 build:

make android-lib-x86

In Android Studio, create an x86 AVD (Android Virtual Device):

Now when you run or debug the Android project you will see a window “Choose Device”. Select your new AVD from drop down under “Launch emulator”. If you select “Use same device for future launches” Android Studio will remember the selection and not ask again.

Running Mapbox GL Native on a hardware Android device

The Mapbox Android SDK requires Android 4.0.3+ (API level 15+).

First read the Google documentation to set up your device and your OS to connect to the device.

When you plug your device in and then run or debug the Android project you will see a window “Choose Device”. Choose your device from the “Choose a running device” list.

If your device does not show up, double check the Google documentation.