Discussion Forums  >  Uncategorized

Replies: 7    Views: 284

lorenh
Android Fan
Profile
Posts: 32
Reg: Jan 05, 2012
Kansas City, MO
1,870
01/25/12 03:37 PM (14 years ago)

Finally got driving directions to work

When creating a Location Map, one of your options is to choose what action takes place when you tap the marker pin on the map. Connecting to a Details screen works fine, but the other option Show Driving Directions hasn't worked for several of us. The problem was that the latitude/longitude coordinates of the marker pin weren't being passed properly to whatever GPS app you use. The destination and device location were being reported as the same lat/long. I was able to get the correct location passed by modifying line 593 in the file BT_screen_map.java as follows: Uri uri = Uri.parse(http://maps.google.com/maps?saddr= + tmpLatitude + , + tmpLongitude + &daddr= + tappedLocation.getLatitude() + , + tappedLocation.getLongitude()); I'm running v2.0, but I had the same problem with 1.5. I expect the solution will work in v1.5, but the line number may be slightly different. Look for this original line of code and change it to the one above: Uri uri = Uri.parse(http://maps.google.com/maps?saddr= + tmpLatitude + , + tmpLongitude + &daddr= + tmpLatitude + , + tmpLongitude + );
 
orangempa
I hate code!
Profile
Posts: 10
Reg: Nov 30, 2011
Irvine, CA
100
like
01/25/12 03:47 PM (14 years ago)
I ran into that issue as well. Now, do you have to do the same for every unique location?
 
lorenh
Android Fan
Profile
Posts: 32
Reg: Jan 05, 2012
Kansas City, MO
1,870
like
01/25/12 04:45 PM (14 years ago)
I've tested it with four different Location Map screens and the correct info was passed each time. My app has a menu list of different locations. Selecting one of the menu items loads a map showing that location. Tapping the map marker pin pops up a menu that lets me select driving directions.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
01/25/12 05:11 PM (14 years ago)
 
RacinJason
Aspiring developer
Profile
Posts: 73
Reg: Jan 13, 2011
Hanover, PA
730
like
01/29/12 09:21 AM (14 years ago)
I can't get this code to work in V1.5. I get a Syntax error on token +, ++ expected and The method parse(String) in the type Uri is not applicable for the arguments (String, double) errors. Can anyone help with the adjustment for the code on line 593 to work? I'm sure this will help many people still using 1.5 at this time.
 
RacinJason
Aspiring developer
Profile
Posts: 73
Reg: Jan 13, 2011
Hanover, PA
730
like
01/29/12 10:39 AM (14 years ago)
I got past the error messages for V1.5. It's the same as 2.0 just have to make sure you input all the quotes into the code correctly and use the exiting code and replace only the end of it.
 
Codebreaker
Aspiring developer
Profile
Posts: 6
Reg: Mar 04, 2012
Derry, Ireland
2,210
like
03/20/12 03:09 PM (13 years ago)
I also figured out the driving direction error message I'm new to app building and without buzztouch I would still be reading the how-to books. Great product and excellent help Buzztouch. This was my problem. I'm using BT V1.4 android code to build a touristy type app and when testing/running the app in the emulator I kept getting an error when tapping Get Driving Directions on a multi-location screen. I found the solution here... http://developer.android.com/guide/topics/location/obtaining-user-location.html Simply by telling the emulator in Eclipse where you are using lat / long co ordinates, a phone icon appears on the screen and when you now tap for directions you get what you need. This may be kindergarden stuff to some but for an aspiring developer like myself it was 10+ hours of reading forums and the like. I hope this helps others with a similiar problem
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
04/09/12 04:43 PM (13 years ago)
I got it to work too! Thank you, lorenh! I am back on track with my Android location app. I had to make a minor change to the code above to get it to work in 1.5. This is what worked for me: Uri uri = Uri.parse("http://maps.google.com/maps?saddr=" + tmpLatitude + "," + tmpLongitude + "&daddr=" + tappedLocation.getLatitude() + "," + tappedLocation.getLongitude());
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.