[GraphHopper] Minimal setup for Android?

Peter graphhopper at gmx.de
Tue Jan 6 12:46:22 UTC 2015


Trying GraphHopper with Android Studio is still on my todo list but why
not use gradle config and just add GraphHopper as dependency there? No
need to mess around with JARs etc

> by telling me where to save the folder with the map data (on the phone
or on the SD card and where)?
> by telling me if and if so where I should store the .map and the .pbf
file on the phone or in the project?

See the Android docs. No need to store the pbf files on the phone. And
yes you can put the graphhopper files and the map files in the apk

Regards,
Peter

On 05.01.2015 22:45, Nico Nijman wrote:
> Hello, 
>
> Please allow me to introduce myself, I am Nico and I would like to
> create an Android app that displays a map of a small town and displays
> markers that indicate the locations of that days activities. If
> possible I would also like to add functionality for finding and
> displaying the most efficient route to each of these activities.
> Unfortunately I am still very unexperienced in all things related to
> Android programming.
>
> At present I am a long way from that goal, I created/downloaded and
> compiled my map to a folder on my computer called
> "C:\temp\graphhopper-0.3\map_son-gh" it contains edges, geometry,
> locationIndex, names, nodes and properties files, so I think this step
> was successful.
>
> Now I would like to create an app that, if this map_son-gh folder is
> stored on the phone, will access it and display the village. To get
> started I tried to use the sample code, the app builds, but when i try
> to start it it is immediately stopped so apparently there is a fatal
> error (either code missing or the files can not be found or are
> corrupted).
>
> I build the app with Android Studio 1.0, with JRE 1.7.0_71-b14 amd 64
> and the matching JDK and in my project I included
> graphhopper-0.3-android.jar, mapsforge-code-0.4.3.jar,
> mapsforge-map-0.4.3.jar, mapsforge-map-android-0.4.3.jar and
> mapsforge-map-reader-0.4.3.jar. 
> I tried to include "trove-3.0.3.jar" as I read that was also required,
> but then the project would no longer build because there were multiple
> instances of trove. I assumed this is because trove is nowadays
> probably included in the graphhopper jar.
>
> Could you kindly help me:
> - by telling me if my includes are correct?
> - by telling me if the map files are complete?
> - by telling me if and if so where I should store the .map and the
> .pbf file on the phone or in the project?
> - by telling me where to save the folder with the map data (on the
> phone or on the SD card and where)?
> - by telling me how I can debug this fatal error (how to get more
> information then "the app stopped. <ok>")?
> - provide me with the most basic sample code possible (just open the
> map and display it, no downloading, no routing, nothing that is not
> required, if possible with the map data as resource in the apk instead
> of somewhere where i can misplace it).
>
> Thank you for your attention and hopefully for your help.
>
> Kind regards, Nico Nijman
>
> p.s. just in case it matters, this is my map area/the
> village: http://www.openstreetmap.org/export#map=15/51.5126/5.4882
>
>
>
> _______________________________________________
> GraphHopper mailing list
> GraphHopper at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/graphhopper

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20150106/3d456c18/attachment.html>


More information about the GraphHopper mailing list