Skip to content

Download problem and route create problem #251

Closed

Description

Hi

I get 2 problems with Grapphopper.

When i start app, does not display a list of maps that can be download, it show a toast ask me if i am connected to internet. Second, if i try to create a route, it crash after red flag has been add to the map. the Logcat display "Call load or importOrLoad before routing"

Activity

  1. karussell commented on Sep 1, 2014

    @karussell
    Member

    Discussion was moved from the mailing list: https://lists.openstreetmap.org/pipermail/graphhopper/2014-September/001191.html

    First, we need to solve the problem that you cannot access the download website from android as reported here - looks like a similar issue to #127

  2. karussell commented on Sep 1, 2014

    @karussell
    Member

    Sorry, no idea. As this works for me on my device and in the simulator, I can only hope you spend a bit time in debugging this. Please make sure that you use 0.3 and what you can try is to implement the download differently or just try to ping the URL in a different way and see if this works or if there is an issue with your device or firewall etc.

    Regarding your other issue: you should be able to use locally installed maps. Make sure you use the correct path.

    Ah, maybe it is because your device is has only read access. Please see this issue #217 for a possible work around

  3. karussell commented on Sep 2, 2014

    @karussell
    Member

    I must find what create the error when i create the route

    The issue is because it did not properly load the graph and detects that when you try to route

    a link to the apk that works with your device?

    I've tried it again after uninstalling data&app. See the apk at 0.3 on https://graphhopper.com/#community

  4. devemux86 commented on Sep 2, 2014

    @devemux86
    Contributor

    I tested the latest Android app from master and the remote download does not work too.
    The exception returned in https://github.com/graphhopper/graphhopper/blob/master/android/src/com/graphhopper/android/MainActivity.java#L261 is:

    java.io.FileNotFoundException: https://graphhopper.com/public/maps/0.3/
        at com.android.okhttp.internal.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:186)
        at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:246)
        at com.graphhopper.util.Downloader.fetch(Downloader.java:75)
        at com.graphhopper.util.Downloader.fetch(Downloader.java:86)
        at com.graphhopper.util.Downloader.downloadAsString(Downloader.java:145)
        at com.graphhopper.android.MainActivity$3.saveDoInBackground(MainActivity.java:242)
        at com.graphhopper.android.MainActivity$3.saveDoInBackground(MainActivity.java:1)
        at com.graphhopper.android.GHAsyncTask.doInBackground(GHAsyncTask.java:15)
        at android.os.AsyncTask$2.call(AsyncTask.java:288)
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
        at java.lang.Thread.run(Thread.java:841)
  5. karussell commented on Sep 2, 2014

    @karussell
    Member

    Strange. Emux, would you mind to try again HTTP, maybe the HTTPS itself makes the problem on some devices.

  6. devemux86 commented on Sep 3, 2014

    @devemux86
    Contributor

    I tested the sample app at Android 2.3 and 3 and it shows and downloads the remote data in both cases.
    In Android 4.4 the remote list comes empty with the above exception (http or https).

    My guess is that Downloader component does not work properly in all Android versions?
    (The Samsung S2 has Android 4.1)

  7. karussell commented on Sep 3, 2014

    @karussell
    Member

    Hi Emux, big thanks for your investigations! That looks really ugly.

  8. devemux86 commented on Sep 3, 2014

    @devemux86
    Contributor

    When you download from your own servers did you experience a similar
    problem?

    Yes I see the same problem too.

    Are there new web access privileges to grant in Android 4.4?

    I think the only needed permission is android.permission.INTERNET which
    you have already.
    It's worth also reading this about the recommended http client:
    http://android-developers.blogspot.gr/2011/09/androids-http-clients.html

    Would you mind to download the list with the help of the
    DefaultHttpClient instead. Here is an example
    http://stackoverflow.com/a/5410907/194609

    I tried with your server and the dataAsString comes filled with the
    remote files.

    Emux

  9. 10 remaining items

  10. devemux86 commented on Sep 4, 2014

    @devemux86
    Contributor

    (We should have this conversation on the GraphHopper mailing list instead of the issues tracker)
    If I understand what you're asking, you need to perform a query with different travel mode (foot) and a graph that supports it of course.

  11. added this to the 0.4 milestone on Sep 9, 2014
  12. babarmagma commented on Sep 10, 2014

    @babarmagma

    Having same issue Call load or importOrLoad before routing when testing in the Graphopper demo project. I have added files to the sdcard both map and gh folder. When i select destination on map app crashes. I was having graphhopper 0.3 version. i also tried 0.4 snapshot still the exception presists.

    Any ideas?

  13. added a commit that references this issue on Jan 19, 2015
    afe0ae3
  14. karussell commented on Jan 19, 2015

    @karussell
    Member

    I've provided a workaround 'AndroidDownloader' so that the HttpClient instead of the plain HttpUrlConnection is used. But I have no idea what the real cause is. As Android has lots of problems related to certification stuff I guess it related to this or the SSL3 fallback or something. It could be important to find the cause as it might be a security problem (not that problematic for this download but for other stuff it could get important) and maybe someone else could invest a bit more time into debugging the plain 'Downloader' for Android version 4.*

    If this works for at least one other dev, I'll merge the branch or merge better suggestions :)

  15. karussell commented on Feb 4, 2015

    @karussell
    Member

    Ok, no feedback means all works ;) so merged it for now. Please try and report here if success or still problems

  16. devemux86 commented on Mar 6, 2015

    @devemux86
    Contributor

    I just tested it in KitKat and it works. :)

  17. karussell commented on Mar 6, 2015

    @karussell
    Member

    Thanks for the feedback! And nice that it works!

  18. karussell commented on Mar 11, 2015

    @karussell
    Member

    Thanks! Understandable that they did so, but now the problem is that we were already using URLConnection before in our Downloader class and this made the problems with HTTPS. (I guess the problems are due to some certificates and apache http was using a different set or something, I really dislike this Android diversity mess and the 'platform independence' Google introduced)

  19. karussell commented on Nov 20, 2015

    @karussell
    Member

    See comment what probably really went wrong here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions