Discussion Forums  >  Uncategorized

Replies: 12    Views: 176

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

Android 1.5 Driving Directions problem

My maps are showing the correct location for a business, and I've set the marker option to show driving directions when it's tapped. The correct latitude and longitude of the business isn't being passed to my GPS app. The GPS is reporting both my starting and destination positions as my current location. Is this a bug in 1.5 or am I doing something wrong? Help please.
 
RacinJason
Aspiring developer
Profile
Posts: 73
Reg: Jan 13, 2011
Hanover, PA
730
like
01/17/12 08:45 AM (14 years ago)
I have had the same problem with my Android apps as well. But have found no way to fix it. It's not reporting the location in the google maps part of BT. But it will report the user location correctly in the BT browser map screen. I'd love to get this working but don't see how.
 
aBeginner
Lost but trying
Profile
Posts: 16
Reg: Mar 29, 2011
Singapore
460
like
01/18/12 12:58 AM (14 years ago)
Having the same problem here... I think no one has the answer... Have asked this for a very long time...
 
muhromatic
buzztouch Evangelist
Profile
Posts: 24
Reg: Dec 19, 2011
NYC
240
like
01/23/12 10:00 AM (14 years ago)
Has anyone been able to address/fix this issue? Please share if possible.
 
Zackamo
Aspiring developer
Profile
Posts: 175
Reg: Oct 25, 2011
Bryan TX
3,400
like
01/24/12 07:54 PM (14 years ago)
Also having this problem...
 
aBeginner
Lost but trying
Profile
Posts: 16
Reg: Mar 29, 2011
Singapore
460
like
01/25/12 12:09 AM (14 years ago)
I think I know where the problem is. Sorry, but I am not good with the codes. Here is the section I believe there is a problem. if(tmpLatitude.length() > 3){ try{ //currentDevice.location > Obj_MapLocation.location BT_item tappedLocation = (BT_item) childItems.get(selectedIndex); Uri uri = Uri.parse(http://maps.google.com/maps?saddr= + tmpLatitude + , + tmpLongitude + &daddr= + tmpLatitude + , + tmpLongitude); Intent intent = new Intent(android.content.Intent.ACTION_VIEW, uri); I believe the problem is that tmpLongtitude and tmpLatitude are the values used in &daddr=. I already have a few screens with values of the Latitude and Longtidues of the location. So what are the variables to use in daddr= ? Do I have to declare the values?
 
lorenh
Android Fan
Profile
Posts: 32
Reg: Jan 05, 2012
Kansas City, MO
1,870
like
01/25/12 11:05 AM (14 years ago)
The info on this site may be helpful. http://code.google.com/android/add-ons/google-apis/reference/com/google/android/maps/GeoPoint.html The site mentions the commands getLatitudeE6() and getLongitudeE6(). Evidently, these extract the latitude and longitude info from a GeoPoint. I'm not a Java programmer, but it looks to me that childLocationPoints in line 112 of BT_screen_map.java is where the GeoPoint information is stored. There is probably some way to use the getLatitudeE6() command to extract the latitude information and assign it to a variable. That variable could then be plugged into the &daddr part of Uri uri = Uri.parse(http://maps.google.com/maps?saddr= + tmpLatitude + , + tmpLongitude + &daddr= + tmpLatitude + , + tmpLongitude); Same for getLongitudeE6() Can someone help with the syntax and where to declare the variables?
 
lorenh
Android Fan
Profile
Posts: 32
Reg: Jan 05, 2012
Kansas City, MO
1,870
like
01/25/12 03:04 PM (14 years ago)
Success! Here's the change required to make the tapped marker's latitude and longitude pass to your native GPS program. In YourApp> src> com.yourapp> BT_screen_map.java Change line 593 from: Uri uri = Uri.parse(http://maps.google.com/maps?saddr= + tmpLatitude + , + tmpLongitude + &daddr= + tmpLatitude + , + tmpLongitude + ); To: Uri uri = Uri.parse(http://maps.google.com/maps?saddr= + tmpLatitude + , + tmpLongitude + &daddr= + tappedLocation.getLatitude() + , + tappedLocation.getLongitude());
 
aBeginner
Lost but trying
Profile
Posts: 16
Reg: Mar 29, 2011
Singapore
460
like
01/26/12 08:59 PM (14 years ago)
NICE!!! It works!!! Thank you so much lorenh!!! If you don't mind, I have another problem with the maps. The show user location button doesn't work. I have been tinkering with the values inside BT_screen_map.java, but I can't seem to get it to show my current location. Any ideas where I need to change? Thank you in advance =D
 
lorenh
Android Fan
Profile
Posts: 32
Reg: Jan 05, 2012
Kansas City, MO
1,870
like
01/27/12 08:31 AM (14 years ago)
I've noticed the same thing, but haven't had time to look for the problem. I've set my core properties to turn on GPS tracking when my app is launched. That's provided the user's location on maps. I know they recommend giving the end user the ability to turn that feature off, but I don't see any command in the Control Panel that allows that, just the Show user location option, which doesn't turn GPS on. If I figure it out, I'll post the answer here.
 
Annonymous
Profile
01/27/12 12:23 PM (14 years ago)
I've noticed the same thing, but haven't had time to look for the problem. I've set my core properties to turn on GPS tracking when my app is launched. That's provided the user's location on maps. I know they recommend giving the end user the ability to turn that feature off, but I don't see any command in the Control Panel that allows that, just the Show user location option, which doesn't turn GPS on. If I figure it out, I'll post the answer here.
 
RacinJason
Aspiring developer
Profile
Posts: 73
Reg: Jan 13, 2011
Hanover, PA
730
like
01/29/12 09:14 AM (14 years ago)
Is it normal to get an error message from the file when you replace the code on line 593 of the BT_screen_map.java file?
 
aBeginner
Lost but trying
Profile
Posts: 16
Reg: Mar 29, 2011
Singapore
460
like
01/29/12 05:10 PM (14 years ago)
Nope. I didn't have any problem at all
 

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.