[GraphHopper] App crashed getting response from GraphHopperAPI.rout(request)
Peter K
peathal at yahoo.de
Mon Apr 29 06:16:59 UTC 2013
Hi Awais,
first, there are two branches 0.1 and master. The Android and core
project must have the same. This will be changed in some weeks via
merging web+android+core into one git repo.
second, you need to create an graphhopper-android.jar from the core
project if you use a normal Eclipse project:
https://github.com/graphhopper/graphhopper/wiki/Android
=> |mvn -DskipTests=true clean install assembly:single|
or include the graphhopper core via the pom.xml file if you use a maven
project.
Otherwise you'll get exceptions like NoClassDefFoundError:
org.slf4j.LoggerFactory, this logger is replaced by slf4j-android in the
Android package.
Regards,
Peter.
> I download the graphhopper-0.1.apk it worked fine for berlin-gh. Then
> i build my own graph using run.sh and moved it to my android device at
> mnt/sdcard/graphhopper/maps/pakistan-gh. But it gave error
>
> An error occur while creating graph could not load storage at
> mnt/sdcard/graphhopper/maps/pakistan-gh
> And i found some differences that berlin-gh contains files
> egdes
> geometry
> loc2idIndex
> nodes
> berlin.map
>
> And the graph i build by run.sh using pakistan-latest.osm contains
> egdes
> geometry
> nodes
> spatialNIndex
> pakistan.map
>
> there is deference in files instead of loc2idIndex i got spatialNindex
> my be it is giving error due to this....
>
>
>
> On Sun, Apr 28, 2013 at 12:56 PM, Awais Bin Asif
> <09bicsebasif at seecs.edu.pk <mailto:09bicsebasif at seecs.edu.pk>> wrote:
>
> And the errors i am getting is
>
> 04-28 12:50:18.550: E/AndroidRuntime(4166): FATAL EXCEPTION: main
> 04-28 12:50:18.550: E/AndroidRuntime(4166):
> java.lang.ExceptionInInitializerError
> 04-28 12:50:18.550: E/AndroidRuntime(4166): at
> com.example.easytravelling.MainActivity.prepareGraph(MainActivity.java:245)
> 04-28 12:50:18.550: E/AndroidRuntime(4166): at
> com.example.easytravelling.MainActivity.onCreate(MainActivity.java:121)
> 04-28 12:50:18.550: E/AndroidRuntime(4166): at
> android.app.Activity.performCreate(Activity.java:4465)
> 04-28 12:50:18.550: E/AndroidRuntime(4166): at
> android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
> 04-28 12:50:18.550: E/AndroidRuntime(4166): at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
> 04-28 12:50:18.550: E/AndroidRuntime(4166): at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
> 04-28 12:50:18.550: E/AndroidRuntime(4166): at
> android.app.ActivityThread.access$600(ActivityThread.java:127)
> 04-28 12:50:18.550: E/AndroidRuntime(4166): at
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
> 04-28 12:50:18.550: E/AndroidRuntime(4166): at
> android.os.Handler.dispatchMessage(Handler.java:99)
> 04-28 12:50:18.550: E/AndroidRuntime(4166): at
> android.os.Looper.loop(Looper.java:137)
> 04-28 12:50:18.550: E/AndroidRuntime(4166): at
> android.app.ActivityThread.main(ActivityThread.java:4448)
> 04-28 12:50:18.550: E/AndroidRuntime(4166): at
> java.lang.reflect.Method.invokeNative(Native Method)
> 04-28 12:50:18.550: E/AndroidRuntime(4166): at
> java.lang.reflect.Method.invoke(Method.java:511)
> 04-28 12:50:18.550: E/AndroidRuntime(4166): at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:823)
> 04-28 12:50:18.550: E/AndroidRuntime(4166): at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:590)
> 04-28 12:50:18.550: E/AndroidRuntime(4166): at
> dalvik.system.NativeStart.main(Native Method)
> 04-28 12:50:18.550: E/AndroidRuntime(4166): Caused by:
> java.lang.ExceptionInInitializerError
> 04-28 12:50:18.550: E/AndroidRuntime(4166): at
> mapsforge.Constants.<clinit>(Constants.java:56)
> 04-28 12:50:18.550: E/AndroidRuntime(4166): ... 16 more
> 04-28 12:50:18.550: E/AndroidRuntime(4166): Caused by:
> java.lang.NoClassDefFoundError: org.slf4j.LoggerFactory
> 04-28 12:50:18.550: E/AndroidRuntime(4166): at
> com.graphhopper.util.Helper.<clinit>(Helper.java:52)
> 04-28 12:50:18.550: E/AndroidRuntime(4166): ... 17 more
>
>
>
>
>
>
> On Sun, Apr 28, 2013 at 12:48 PM, Awais Bin Asif
> <09bicsebasif at seecs.edu.pk <mailto:09bicsebasif at seecs.edu.pk>> wrote:
>
> Yes the demo app is working fine. Basically i want to
> integrate it in my Android app. I want to develop an Android
> app which gives offline navigation. But now i am trying to run
> the demo code first. And one more thing i want to ask there is
> AStar.java file upload
> at https://github.com/graphhopper/graphhopper/blob/master/src/main/java/com/graphhopper/routing/AStar.java
>
>
> can i use this algorithm for android app offline route
> planning.?????
>
>
> On Sun, Apr 28, 2013 at 1:22 AM, Peter K <peathal at yahoo.de
> <mailto:peathal at yahoo.de>> wrote:
>
> Please let me know the error and what you changed to
> better guide you ...
>
>
> > Then i took two parts of the code
>
> You tried to integrate it in your own application? Is the
> demo app working for you? Try starting from there and
> iterate ...
>
>>
>> Now i don't know the implementation of
>> GraphHopperAPI.rout(req) so how can i figure this out.
>>
>
> But this is in the source code!?
>
>
> Regards,
> Peter.
>
>
>
>> I am trying to run the code Graphhopper-Android
>> from https://github.com/graphhopper/graphhopper-android using
>> berlin-gh graph file available
>> at https://code.google.com/p/graphhopper/downloads/list
>>
>> First i tried to load the .map file and
>> it successfully loaded. it showed the brelin's map
>>
>> Then i took two parts of the code
>> PrepareGraph()
>> calcPath()
>>
>> Prepare graph makes toast "*Finished loading graph. Touch
>> to route*" thats mean graph loaded successfully. in
>> calcPath() function App crashed at
>>
>> GHResponse resp = hopper.route(req); while getting
>> response.
>>
>> where hopper is *GraphHopperAPI hopper*;
>> and for request i hard coded the lat lon from map.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20130429/48e3e906/attachment-0001.html>
More information about the GraphHopper
mailing list