whiteglasses48 / osmbonuspack

Automatically exported from code.google.com/p/osmbonuspack
0 stars 0 forks source link

Problem in routing #36

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.I followed exactly the first two steps in the tutorial

What is the expected output? What do you see instead?
Instead of seeing the route from point A to point B, these 2 points are 
connected by a straight line

What version of the product are you using?
osmbonupack_v4.1

Please provide any additional information below.
I get an exception when trying to parse the routing message:

 OSRMRoadManager.getRoad:http://router.project-osrm.org/viaroute?&loc=48.129999999999995,-1.63&loc=48.4,-1.9&instructions=true&alt=false

and then a JSONException:
org.json.JSONException: Unterminated string at character 363 of {"version": 
0.3,"status":0,"status_message": "Found route between points","route_geometry": 
"crrxzAppnbBnCd_@tAhKsGbImeAhmAiGvGwDbFwD|Ecb@tVgDpBo@Jed@lHqF|@{SiyAcOwy@aEcQmI
}Wm@eBsCyIaYkp@}AqD}AwDkP{`@uG{OeGqOkb@sfA{Wyl@gA{BqUcn@{AeIo@_I`BsGRwJeAiIeAsCu
CcE{DyB_BWuB?qEbCeE|F}AxIObK_AnIoC~IcExI_N|R{NhPuRdSeObMmSnNyVrMcXnJqf@dNmLnBaGX
sFaBwGeMaGsFuFwBsEk@mJfBeI|FeF`

Original issue reported on code.google.com by mg047...@gmail.com on 21 Nov 2013 at 8:31

GoogleCodeExporter commented 8 years ago
I just tried, with exactly the same start and end positions: no parsing error, 
the route is displayed. 
The behaviour you have is really strange. 

Maybe a difference in the JSON parser included in Android platform? 
Which Android version your project is targeting (Project/Properties/Android)? 
(I'm usually targeting Android 1.6)
And which Android version are you using when you test? (I'm usually using an 
AVD with Android 2.2)

Original comment by mathieu....@gmail.com on 21 Nov 2013 at 9:37

GoogleCodeExporter commented 8 years ago
I'm targeting Android 4.3 and that's also the android version of my avd

Original comment by mg047...@gmail.com on 22 Nov 2013 at 8:24

GoogleCodeExporter commented 8 years ago
I'm targeting 4.3.
Using the MapQuestRoadManager it worked, but I could get nothing but straight 
lines with OSRMRoadManager.

Original comment by rodrigo....@gmail.com on 22 Nov 2013 at 12:09

GoogleCodeExporter commented 8 years ago
I've tried to use the MapQuestRoadManager but i get this exception:

Unable to instantiate application android.app.Application: 
java.lang.IllegalStateException: Unable to get package info for example.qwer; 
is package not installed?

Original comment by mg047...@gmail.com on 22 Nov 2013 at 3:02

GoogleCodeExporter commented 8 years ago
I just tried the OSMBonusPackDemo, targeting 4.3, and using a 4.3 AVD: 
OSRMRoadManager and MapQuestRoadManager were both OK. 

If you follow exactly the tutorial 1, then you should first read carefully the 
"Important note" written at the beginning... 
Then please let us know the results. 

Original comment by mathieu....@gmail.com on 22 Nov 2013 at 10:00

GoogleCodeExporter commented 8 years ago
my code was exactly copied and pasted from the tutorial, I've noticed the 
network calls in the main thread but I used 

StrictMode.ThreadPolicy policy = new 
StrictMode.ThreadPolicy.Builder().permitAll().build();

StrictMode.setThreadPolicy(policy);

Currently (without me changing anything) the OSRMRoadManager works, but still 
it won't center the location.

I still can't use the MapQuestRoadManager though. Any thoughts why that is?
Could I be missing a reference? 

Original comment by mg047...@gmail.com on 25 Nov 2013 at 11:54

GoogleCodeExporter commented 8 years ago
I also copy/pasted the tuto in a new project, targeting 4.3: OSRMRoadManager 
and MapQuestRoadManager were both OK... 

Your manifest includes all permissions needed by osmdroid? Including INTERNET 
permission? 

Original comment by mathieu....@gmail.com on 25 Nov 2013 at 10:10

GoogleCodeExporter commented 8 years ago
There is now a Tutorial project in Source/trunk: OSMBonusPackTuto. It should 
help. 

Original comment by mathieu....@gmail.com on 29 Nov 2013 at 9:20

GoogleCodeExporter commented 8 years ago

Original comment by mathieu....@gmail.com on 9 Dec 2013 at 8:59

GoogleCodeExporter commented 8 years ago
mg047...@gmail.com : He is pretty right as android won't provide anything to 
run along with main thread. Either you have to make the call manually in a new 
thread or do this task in background and you'll get your path.

Original comment by meh.bis...@gmail.com on 12 Sep 2014 at 6:58