Skip to content
karussell edited this page Feb 11, 2013 · 48 revisions

Set-up

As starting point you can use this example which can be used from Eclipse or NetBeans via maven command line.

Before installation 0. Go to the Android SDK Manager and install 2.2 (API 8)

Maven Command line

  1. Go to graphhopper sources and make sure mvn -version prints at least 3.0.3
  2. Create the graphhopper artifact via mvn -DskipTests=true clean install
  3. Download Maven SDK Deployer and execute mvn install -P 2.2 - it uses Android Maven Plugin under the hood where you need to set up ANDROID_HOME
  4. Install Mapsforge in your local repository via the provided script scripts/maven-install-mapsforge.sh
  5. Now go to the graphhopper-android project, build and start GraphHopper via mvn -DskipTests=true clean install android:deploy android:run

Eclipse

Import Sources as Android project. If you want to customize graphhopper itself do:

  1. Go to graphhopper sources
  2. Create the graphhopper jar via mvn -DskipTests=true clean install assembly:single
  3. Use the graphhopper-[version]-android.jar and copy it to the libs folder of graphhopper-android. Refresh and use it.

Limitations

  • To avoid RAM-bound graph implementations like MemoryGraphSafe you can use MMapGraph but it could be slower.

  • For now OSMReader does not work on Android due to some javax.xml dependencies. But you can simply create the graphhopper folder on your desktop and copy them to the Android storage. At the moment the graphhopper data created with a MMapGraph is different to one created with MemoryGraphSafe. So keep in mind that you are using the same graph implementation on the desktop and on android. If all was successful in the logs you should see something like: found graph xy with nodes:3037, edges:3221, edges segments:2, edges segmentSize:16384, created-at:Tue Sep 04 14:54:35 MESZ 2012

  • A memory bound a* algoritm is not yet implemented. Let me know if you need this!

Example

Routes for areas of up to 500km^2 are calculated in under 5s simple routing

Clone this wiki locally