Skip to content

victordiaz/mapbox-android-sdk

 
 

Repository files navigation

This is pre-alpha software. It may be broken at any time in development, and there is zero guarantee of API stability. Kick the tires at your own risk, they may explode.

Mapbox Android SDK

Open source alternative for native Mapbox maps on Android.

Including the library in your project

The development of the SDK is on its very earliest stage, so many of its elements will be unstable and not fully tested. If you want to try it in your app project, the easiest option is to download the latest JAR build here. Otherwise you can build the library from source, and experiment with the latest additions to the project.

Building from source

With Gradle (recommended)

We use Gradle to generate a built version of our latest code in a matter of seconds. To use it with your IDE, make sure that Gradle is installed on your machine and import the project by selecting build.gradle as the project file.

If you don't have Gradle installed we also provide a small shell script that autoextracts Gradle and builds the project. Just run build.sh in a terminal, and you're set.

Manually

Building from source means you get the very latest version of our code. The first step is to clone the repository to a directory in your system

git clone https://github.com/mapbox/mapbox-android-sdk.git

The MapBox Android SDK has the following dependencies. All of them are included in this repository, but they need to be added manually in your IDE:

Our flavor of OSMDroid

OSMDroid is an open source project to display OSM maps in Android. It provides a Google Maps for Android-like MapView object in which the map rests. Our fork of this library resides in path/to/sdk/src/main

The SDK

Our library itself is located in path/to/sdk/src/src

Building in IntelliJ IDEA or Android Studio

  • Created an Android project in IDEA
  • Go to Import Module... and select the OSMDroid folder
  • Repeat the step with the SDK
  • Go to File-Project Structure-Modules, and add both projects as module dependencies of your app project.

Resources

OSMDroid is at the moment built as a Java library, not an explicit Android library, so there are references to resource static files that need to be referenced in your classpath. This will be corrected soon, but for now it needs to be done in IntelliJ IDEA. To do so:

  • Go to File-Project Structure-SDKs.
  • For each SDK, add the path to OSMDroid's resources - path/to/mapboxsdk/mapbox-android-sdk/src/main/resources/org/osmdroid

Using the library

Read the quick start guide

About

PRE-ALPHA: Mapbox on Android

Resources

License

Stars

Watchers

Forks

Packages

No packages published