You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is how can we remove it when it causes several issues without it like #251? Should we use something like OkHttp instead for Android? To my knowledge it is based on HttpURLConnection but corrects some limitations regarding certs etc.
The best way would be handling the situation with the recommended Android way (there must be a solution somehow - though I have not managed investing time in it).
We can continue with Apache HTTP APIs by declaring the folowing:
As it is only a demo I would prefer a way which won't make problems in a year. So I would prefer to not go the legacy route and use either the Android way or the external okhttp, where I made good experiences with in our Java/Android clients
Usually avoiding to load a library/app with too many external dependencies, so I'd first review the official recommendation.
But it's your call at the end. 😄
Well, I do not care that much, as this is a demo and people can choose a different download mechanism. But yes, if there would be a stable and reusable download component without deps this would be best :) ... and we could keep the downloader pluggable.
Also if people use http to download there should not be any problems
https is enforced for everything on GraphHopper.com
I could make an exception for the maps, but it could make problems with the enabled hsts. Not sure if this applied only to browsers (I don't think so), so if the downloaded fetches once a https site it will never fetch a http site again.
I think it has something to do with the certificates or with some ssl ciphers that I did not allow for graphhopper.com and make only problems for older clients. So one would have to add these certs and/or make certain ciphers working BUT this is the work that okhttp already did if I'm not wrong and it is only 300KB ;)
I'm now very confused. We use setDoOutput in the Downloader which is wrong:
"setDoOutput(true) is used for POST and PUT requests. If it is false then it is for using GET requests."
So it is identical to #127 and it looks from history like we swapped forth and back for those setDoOutput/setDoInput method, see comment and then commit1, commit2 and commit3.
So all hassle is probably because of that already fixed (and then accidentally reverted) bug which somehow only appeared for Android.
Activity
karussell commentedon Oct 11, 2015
The problem is how can we remove it when it causes several issues without it like #251? Should we use something like OkHttp instead for Android? To my knowledge it is based on HttpURLConnection but corrects some limitations regarding certs etc.
devemux86 commentedon Oct 12, 2015
The best way would be handling the situation with the recommended Android way (there must be a solution somehow - though I have not managed investing time in it).
We can continue with Apache HTTP APIs by declaring the folowing:
karussell commentedon Oct 12, 2015
As it is only a demo I would prefer a way which won't make problems in a year. So I would prefer to not go the legacy route and use either the Android way or the external okhttp, where I made good experiences with in our Java/Android clients
devemux86 commentedon Oct 12, 2015
Usually avoiding to load a library/app with too many external dependencies, so I'd first review the official recommendation.
But it's your call at the end. 😄
karussell commentedon Oct 12, 2015
Well, I do not care that much, as this is a demo and people can choose a different download mechanism. But yes, if there would be a stable and reusable download component without deps this would be best :) ... and we could keep the downloader pluggable.
Also if people use http to download there should not be any problems
devemux86 commentedon Oct 12, 2015
So why the
httpsin Sample if it can solve the situation?karussell commentedon Oct 12, 2015
https is enforced for everything on GraphHopper.com
I could make an exception for the maps, but it could make problems with the enabled hsts. Not sure if this applied only to browsers (I don't think so), so if the downloaded fetches once a https site it will never fetch a http site again.
devemux86 commentedon Oct 12, 2015
Well (not making promises) I can review the
httpsissue, if another solution doesn't appear in the meantime.karussell commentedon Oct 12, 2015
I think it has something to do with the certificates or with some ssl ciphers that I did not allow for graphhopper.com and make only problems for older clients. So one would have to add these certs and/or make certain ciphers working BUT this is the work that okhttp already did if I'm not wrong and it is only 300KB ;)
devemux86 commentedon Oct 12, 2015
Ok since as you said it's about Samples only, we can go with an external dependency.
karussell commentedon Nov 19, 2015
I'm puzzled. I'ved tried via http (and a subdomain, see #565) but it is only working with the modified AndroidDownloader...
devemux86 commentedon Nov 20, 2015
Really? I thought now with
httpwe could useDownloaderagain..karussell commentedon Nov 20, 2015
I'm now very confused. We use setDoOutput in the Downloader which is wrong:
"setDoOutput(true) is used for POST and PUT requests. If it is false then it is for using GET requests."
So it is identical to #127 and it looks from history like we swapped forth and back for those setDoOutput/setDoInput method, see comment and then commit1, commit2 and commit3.
So all hassle is probably because of that already fixed (and then accidentally reverted) bug which somehow only appeared for Android.
karussell commentedon Nov 20, 2015
Please see if this fixes the problem for your Android version too :)
devemux86 commentedon Nov 20, 2015
I intend to PR some updates and will look after this too. 😄
devemux86 commentedon Nov 24, 2015
@karussell I tried the latest changes, it seems to download fine.
devemux86 commentedon Nov 24, 2015
I don't remember if we have discussed the possibility of Android DownloadManager system service.
karussell commentedon Nov 24, 2015
Nice, thanks for the feedback! And please go ahead if there is something better/simpler than our current solution for Android :) !
devemux86 commentedon Nov 24, 2015
We use it in Mapsforge Samples in its simplest form, so it's worth a try.