summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md82
1 files changed, 68 insertions, 14 deletions
diff --git a/README.md b/README.md
index 3c8fb2fd38..400dea0f78 100644
--- a/README.md
+++ b/README.md
@@ -21,6 +21,11 @@ implemented in C++11, currently targeting iOS, OS X, and Ubuntu Linux.
We try to link to as many system-provided libraries as possible. When these are unavailable or too outdated, we run a thin build-script layer called [Mason](https://github.com/mapbox/mason) to automate builds, and load precompiled binary packages when possible.
+Be sure to pull down all submodules first:
+
+ git submodule init
+ git submodule update
+
## OS X
On OS X, we are using `zlib`, `SQLite3`, `libcurl` and `libpng` provided by the operating system. In addition to that, you need to have the Boost headers installed. To install all prerequisites, use [Homebrew](http://brew.sh/) and type `brew install pkg-config boost`.
@@ -43,12 +48,7 @@ iOS makes use of a Cocoa-specific API called [`mapbox-gl-cocoa`](https://github.
If you intend to develop here, `mapbox-gl-cocoa` is included as a submodule of the overall build setup.
-To pull down the submodule(s), run:
-
- git submodule init
- git submodule update
-
-Then, you can run `make iproj` to create and open an Xcode project with an iOS-specific view controller housing. This will automatically install required dependencies as well.
+You can run `make iproj` to create and open an Xcode project with an iOS-specific view controller housing. This will automatically install required dependencies as well.
Note that if you are doing OS X development as well, to toggle from OS X back to iOS, you will need to `make iproj` again.
@@ -62,9 +62,9 @@ We are using Ubuntu for development. While the software should work on other dis
Install GCC 4.8+ if you are running Ubuntu 13.10 or older. Alternatively, you can also use Clang 3.4+.
- sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test
- sudo apt-get update
- sudo apt-get install gcc-4.8 g++-4.8
+ sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test
+ sudo apt-get update
+ sudo apt-get install gcc-4.8 g++-4.8
Ensure you have git and other build essentials:
@@ -81,17 +81,17 @@ Install glfw3 dependencies:
Finally, install Boost. If you're running Ubuntu 12.04 or older, you need to install a backport PPA since the version provided by APT doesn't contain Boost Geometry:
- sudo add-apt-repository --yes ppa:boost-latest/ppa
- sudo apt-get update
- sudo apt-get install libboost1.55-dev
+ sudo add-apt-repository --yes ppa:boost-latest/ppa
+ sudo apt-get update
+ sudo apt-get install libboost1.55-dev
Otherwise, you can just install
- sudo apt-get install libboost-dev
+ sudo apt-get install libboost-dev
Once you're done installing the build dependencies, you can get started by running
- ./configure
+ ./configure
Then, you can then proceed to build the library:
@@ -102,6 +102,58 @@ Set an access token as described below, and then run:
make run-linux
+## Android (on Linux)
+
+Install a few build depedencies:
+
+ apt-get install -y make pkg-config
+
+Install Oracle JDK 7 (requires license agreement) from http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
+
+Or the OPEN JDK:
+
+ sudo apt-get install -y openjdk-7-jdk
+
+Install Android NDK:
+
+ sudo apt-get install p7zip-full
+ wget http://dl.google.com/android/ndk/android-ndk-r10c-linux-x86_64.bin
+ chmod +x android-ndk-r10c-linux-x86_64.bin
+ 7z x ./android-ndk-r10c-linux-x86_64.bin > /dev/null
+ export ANDROID_NDK_PATH="$(pwd)/android-ndk-r10c"
+ export NDK_PATH=${ANDROID_NDK_PATH}
+
+Install Android SDK:
+
+ sudo apt-get install lib32stdc++6 lib32z1
+ wget http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz
+ tar -xzf ./android-sdk_r23.0.2-linux.tgz
+ ./android-sdk-linux/tools/android update sdk -u -a -t tools,platform-tools,build-tools-21.1.1,android-21,extra-android-m2repository,extra-google-m2repository
+ export ANDROID_HOME="$(pwd)/android-sdk-linux"
+
+Run:
+
+ make android
+
+APKs for testing are output to `android/java/app/build/outputs/apk/app-debug.apk`
+
+You can also open `android/java` in Android Studio.
+
+## Android (on OS X)
+
+Install the [Android NDK](https://developer.android.com/tools/sdk/ndk/index.html) for 64-bit OS X.
+
+ export ANDROID_NDK_PATH="/dir/to/android-ndk-r10c"
+
+Install the Android SDK. We recommend doing this by way of [Android Studio](https://developer.android.com/sdk/installing/studio.html). The latest versions recommend that you place the SDK someplace like `/usr/local/android-sdk-macosx`.
+
+ export ANDROID_HOME="/dir/to/android-sdk-macosx"
+
+Run:
+
+ make android
+
+You can then open `android/java` in Android Studio.
# Troubleshooting
@@ -123,6 +175,8 @@ For iOS and OS X use of the demo apps in Xcode, setup the access token by editin
For Linux, set the environment variable `MAPBOX_ACCESS_TOKEN` to your token.
+For Android, open the class MapFragment and look for the line with `mMap.setAccessToken("access token goes here");`.
+
# Style
Some styles in JSON format are included at `./styles`. See the [style spec](https://github.com/mapbox/mapbox-gl-style-spec) for more details.