Skip to content
Demo app for Mapbox Android SDK on Google Play
Java Kotlin Other
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
.muse Add a configuration for muse builds (#1233) Oct 1, 2019
.tx Update config Jan 18, 2018
MapboxAndroidDemo Adjusted listener for example card onClick (#1228) Oct 11, 2019
MapboxAndroidWearDemo Added -dontwarn proguard rule for java sdk notnull (#1237) Oct 2, 2019
SharedCode Added try/catch for getting getISO3Country for analytics (#1182) Aug 27, 2019
config/checkstyle Added gradle and config folders at the top of the project. (#534) Nov 13, 2017
gradle bumped china plugin dependency to 2.3.0 (#1242) Oct 10, 2019
node_modules Adding sanity test (#741) Jul 18, 2018
screenshots Updated photos (#453) Aug 23, 2017
scripts Adjusted HomeScreenWidgetActivity class' location and its javadocs (#… May 17, 2019
.gitignore Added example of cache management methods usage (#1139) Aug 7, 2019 Release 8.4.0 (#1235) Oct 1, 2019 update to issue template (#931) Dec 12, 2018
Makefile Adding kotlin lint plugin and needed tweaks (#1140) Jul 18, 2019 Adding note about product flavors to README (#987) Apr 24, 2019
build.gradle Gradle Play Publisher plugin adjustments (#1198) Sep 3, 2019
circle.yml Adding addtional 4g max heap size declarations (#1240) Oct 8, 2019 Adding addtional 4g max heap size declarations (#1240) Oct 8, 2019
gradlew #59 - Updating Gradle Wrapper, Build Tools, and Support Library versions Apr 29, 2016
gradlew.bat #59 - Updating Gradle Wrapper, Build Tools, and Support Library versions Apr 29, 2016 Add play store stuff Apr 9, 2014
license bump to 2019 (#962) Feb 7, 2019
mapbox_demo.keystore readded keystone Aug 23, 2016
settings.gradle Adding Segment analytics code and opt out toggling (#336) Jun 21, 2017

Mapbox Android Demo app


This is a public demo of the Mapbox Maps SDK for Android. The demo app is available now in the Google Play Store and it shows off many of the examples found on:

There are also examples that only live in the app. The app's "labs" section has examples which often combine various Mapbox tools to create more complex examples.

Visit the overview page to get started using the Mapbox Maps SDK for Android in your Android project.

Steps to adding a new example

Feedback and contribution are encouraged in this repo. If you'd like to see a new example added into the app, either open an issue or create it yourself and open a pull request following these steps:

  • Create a new java file and place in the acceptable folder (examples or labs) giving it a descriptive name and ending the title with *Activity. It's important that all activities extend AppCompat.
  • If the activity needs a layout, add one with the naming convention activity_*.
  • Add the activity to the AndroidManifest.xml file.
  • Open the file and scroll down to the listItems method. You'll notice a switch statement, pick one of the cases (categories) and add the new example so it matches the others.
  • Code your example and test to make sure it works properly.
  • Open a pull request with the new example.

Note: This repo uses checkstyle to make sure code contributed follows the Mapbox Style standards. When a pull request is opened, Bitrise will check that no style issues occur in the code. Read this wiki entry to set up checkstyle in Android Studio.

Running locally

Setting the Mapbox access token

This demo app uses Mapbox vector tiles, which require a Mapbox account and a Mapbox 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 SharedCode/src/main/res/values/developer-config.xml. If the environment variable wasn't set, you can create/edit the developer-config.xml file. Create an access_token String resource and paste your access token into it:

<string name="access_token">PASTE_YOUR_TOKEN_HERE</string>
Product flavors

The app has a two product flavors; global and china. The global flavor has the full list of standard examples, whereas the china flavor has China-specific examples, which use the Mapbox China Plugin for Android. The plugin requires a special China Mapbox access token. Contact our sales team to start the process of receiving this special access token.

You might see China-related examples when you locally run the app on your device. This is because Android Studio is set on the china flavor. Find and click on the "Build Variants" tab in the lower left hand corner of the Android Studio window. Then choose globalDebug to change the flavor to the global flavor. Re-run the app on your device to see the "regular" demo app examples.

screen shot 2019-03-06 at 9 09 13 am

If you're still having issues, please open an issue ticket in this repo.

Inside the app

You can’t perform that action at this time.