Coder Social home page Coder Social logo

katiya-cw / mapbox-android-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mapbox/mapbox-android-demo

0.0 0.0 0.0 115.3 MB

Demo app for Mapbox Android SDK on Google Play

Home Page: https://play.google.com/store/apps/details?id=com.mapbox.mapboxandroiddemo

License: BSD 2-Clause "Simplified" License

Shell 0.06% Java 94.12% Makefile 0.02% HTML 0.07% JavaScript 0.19% Kotlin 5.54%

mapbox-android-demo's Introduction

Mapbox Android Demo app

CircleCI

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 MainActivity.java 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

mapbox-android-demo's People

Contributors

bleege avatar tobrun avatar lukaspaczos avatar tmcw avatar osana avatar guardiola31337 avatar electrostat avatar daisuke-nomura avatar riastrad avatar zugaldia avatar langsmith avatar samfader avatar jennyvayla avatar ivovandongen avatar colleenmcginnis avatar lorntao avatar lyzidiamond avatar 1ec5 avatar pengdev avatar roblabs avatar isatimur avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.