Discussion Forums  >  Maps, Device Location, Tracking

Replies: 26    Views: 226

Lars1
I hate code!
Profile
Posts: 44
Reg: Dec 26, 2011
Stenungsund
440
03/09/12 12:56 PM (13 years ago)

Show device/user location problem

Android, BT 1,5 In Advanced map properties I have chosen "Show the users location" and "yes" on Show user location button. In the device the map is showed but not the users location. If I hit the map where the device is located there is a popup text "Your are here" but no icon on the map. Also when I in device chose "Show my location" nothing happens. Any ideas?
 
Zackamo
Aspiring developer
Profile
Posts: 175
Reg: Oct 25, 2011
Bryan TX
3,400
like
03/09/12 01:07 PM (13 years ago)
I think its a know bug (at least discussed) I haven't found a solution, but have found that BT does user location in a weird way, and not typical android fashion (from what I have read). I might try to hack around a bit and see if I can fix it. Will post if I figure it out.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
03/09/12 01:27 PM (13 years ago)
Zackamo, I have an BTv1.5 app that shows user location and one that doesn't. If comparing the source code would help I'd be happy to send it to you. Why it shows user location in one but not the other I haven't figured out. Fred
 
Zackamo
Aspiring developer
Profile
Posts: 175
Reg: Oct 25, 2011
Bryan TX
3,400
like
03/09/12 01:43 PM (13 years ago)
interesting..... very interesting. I feel like I got to work on my first app when playing around, from then I haven't been able to get it to work.. Before you send source, did you get your map api keys in the same way when building the app, oh have you always used keytool (if you do).
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
03/09/12 01:47 PM (13 years ago)
I use keytool. I have a detailed step-by-step for using keytool on my site. The only thing missing is why show my location is not working in some apps. GoNorthWest has a how-to using the command line. Fred
 
Zackamo
Aspiring developer
Profile
Posts: 175
Reg: Oct 25, 2011
Bryan TX
3,400
like
03/09/12 01:56 PM (13 years ago)
See I have done both... And although the api keys are the same, your steps along the way are just slightly different. However if you have used keytool twice, and different results then I can eliminate that. It doesn't really make sense that two different apps would cause it to break... One problem we are going to run into is that the code for location goes through a couple couple of screens deep, so we might have to do a comparative of a few screens. Let me figure out what screens I might need and we can go from there.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
03/09/12 02:03 PM (13 years ago)
No, the app that show the 'my location' isn't setup with an API Key. Fred
 
Zackamo
Aspiring developer
Profile
Posts: 175
Reg: Oct 25, 2011
Bryan TX
3,400
like
03/09/12 03:08 PM (13 years ago)
If you don't have any API key, how is it even showing a google map?
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
03/09/12 03:16 PM (13 years ago)
It's not showing the map, just the locations. Fred
 
Zackamo
Aspiring developer
Profile
Posts: 175
Reg: Oct 25, 2011
Bryan TX
3,400
like
03/09/12 03:25 PM (13 years ago)
Well interesting, I wonder if its putting that api key that is killing the process. On your app that has location, could you try putting the api key to see if that takes it out.. (this might be why I remember it working.. it was pre api key)
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
03/09/12 03:49 PM (13 years ago)
I'm not touching that file until I duplicate. Maybe it just a matter of using a map screen without using the API? Was there a change in the code by Buzztouch? Many questions, haven't had time to figure it out. Fred
 
Zackamo
Aspiring developer
Profile
Posts: 175
Reg: Oct 25, 2011
Bryan TX
3,400
like
03/09/12 04:03 PM (13 years ago)
They don't use the customary way to find device location which is a simple call and you get the blue dot / arrow. They manually find it, store it, then add a custom layer. My guess is since you don't have an api, its not actually doing anything, all its doing is showing two layers that you have active. Only way we could possibly prove that is for you to add a location to your map very far away from you and other location. My goal was to force mapview to use the proper technique for location, but failed on my first attempt awhile back. I'll try again this weekend.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
03/09/12 04:09 PM (13 years ago)
I have a location: Downtown Nashville It showing ''My Location'' accurately. I'm headed to a new location and I'll double check. (I think I've check before.) Fred
 
Zackamo
Aspiring developer
Profile
Posts: 175
Reg: Oct 25, 2011
Bryan TX
3,400
like
03/09/12 04:14 PM (13 years ago)
So then I have to believe the api is what is killing us, or layer isn't getting put on top of the map.. This should help me try to track down the bug this weekend (if i am smart enough to).
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
03/09/12 04:51 PM (13 years ago)
Sorry, no luck. At new location an it's still showing old location with accurate phone icon. At some point it read the device type and my location. This data was never entered by me. I don't remember if I ever opened the app in a virtual device. I don't think I did. Tried refresh the app but it's locking up when I do. Fred
 
Lars1
I hate code!
Profile
Posts: 44
Reg: Dec 26, 2011
Stenungsund
440
like
03/10/12 02:16 AM (13 years ago)
I tried running the app on device, thru Eclipse and without the API. Same result. The device has a location but no pin. BT; "The user's location can be highlighted (with a blue pin) when the map loads" I searched for "blue" in BT config.txt but there was no reference to a blue pin. Maybe it's just that it's a bug in the code? Lots of references to pincolor "red".
 
Zackamo
Aspiring developer
Profile
Posts: 175
Reg: Oct 25, 2011
Bryan TX
3,400
like
03/10/12 05:51 PM (13 years ago)
Welp... Out of curiosity what version of BT are we using.. Just finally got a map in my 2.0 test app and sure enough I get device location with api and everything. I know I don't have location in my 1.5 app, so perhaps its fixed in 2.0? I will on initial load, it appears as if I am in the wrong location, but as I zoom in it becomes approximate. So definitely not perfect. I am still going to try to hack in the correct way to do location. Let me know yalls BT version, as this should help us narrow down where the problem is.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
03/10/12 06:28 PM (13 years ago)
I have a map on BTv1.5 Guess I'll have a map in BTv2.0 tomorrow. Fred
 
Zackamo
Aspiring developer
Profile
Posts: 175
Reg: Oct 25, 2011
Bryan TX
3,400
like
03/10/12 09:08 PM (13 years ago)
Boom. Android way of doing current location. Add this code: me=new MyLocationOverlay(this, mapView); mapView.getOverlays().add(me); me.enableMyLocation(); to the if statement area here: // add device location if we have it and showUserLocation != "0" By adding it to the if statement, we should allow for enabling from console. I nuked all of the user location stuff so the phone won't come up. It should be noted that you are stuck with the blue dot. No custom stuff, but this is a bit cleaner in my opinion. I might consider rebuilding the plugin to add this as an option, since that is one of the joys of BT..
 
Lars1
I hate code!
Profile
Posts: 44
Reg: Dec 26, 2011
Stenungsund
440
like
03/11/12 11:23 AM (13 years ago)
Using BT v1,5 Where to add Your Code, in witch file?
 
Zackamo
Aspiring developer
Profile
Posts: 175
Reg: Oct 25, 2011
Bryan TX
3,400
like
03/11/12 12:16 PM (13 years ago)
Sorry. Totally forgot what screen. It appears like 2.0 and 1.5 it will be the same. BT_screen_map.java Search for the comment above but looks like to be around line 745ish.
 
Lars1
I hate code!
Profile
Posts: 44
Reg: Dec 26, 2011
Stenungsund
440
like
03/12/12 12:27 PM (13 years ago)
Thanks Zackamo. Not like this? //add device location if we have it and showUserLocation != "0" me=new MyLocationOverlay(this, mapView); mapView.getOverlays().add(me); me.enableMyLocation(); if(tmpLatitude.length() > 4 && !showUserLocation.equalsIgnoreCase("0")){ It give me errors.
 
Zackamo
Aspiring developer
Profile
Posts: 175
Reg: Oct 25, 2011
Bryan TX
3,400
like
03/12/12 01:49 PM (13 years ago)
aight... We need to add some declarations, sorry I forgot that.. Go to where all the variables are being called at the top, and add private MyLocationOverlay me=null; Also you want to add the original code after the if statement opens. So like this. //add device location if we have it and showUserLocation != "0" if(tmpLatitude.length() > 4 && !showUserLocation.equalsIgnoreCase("0")){ me=new MyLocationOverlay(this, mapView); mapView.getOverlays().add(me); me.enableMyLocation(); If for some reason it doesn't work, change tmpLatitude.length() > 4 to tmpLatitude.length() > 0 In all reality you can put the code I gave you it almost any of the main functions for this file and it should work. My goal was to have it play with current buzztouch thought process correctly. Perhaps once we can push plugins more, I'll release a modification to use MyLocationOverlay or Buzztouch one as option in the backend.
 
Lars1
I hate code!
Profile
Posts: 44
Reg: Dec 26, 2011
Stenungsund
440
like
03/17/12 03:56 PM (13 years ago)
Shall private MyLocationOverlay me=null; be placed at public class BT_screen_map extends MapActivity{ ? I get "MyLocationOverlay cannot be resolved to a type" error for every code-line
 
Lars1
I hate code!
Profile
Posts: 44
Reg: Dec 26, 2011
Stenungsund
440
like
03/26/12 11:36 AM (13 years ago)
Can't get it to work. Had a programmer look at the file and entered the code but it didn´t work. Eclipse says "MyLocationOverlay cannot be resolved to a type". Any help would be appreciated.
 
orangempa
I hate code!
Profile
Posts: 10
Reg: Nov 30, 2011
Irvine, CA
100
like
03/30/12 10:40 AM (13 years ago)
I'm having the same issue in 2.0, with the same error as above. Any idea on a fix?
 
Geo3d
Aspiring developer
Profile
Posts: 31
Reg: Apr 19, 2012
location unknow...
910
like
05/01/12 10:07 AM (13 years ago)
With the MyLocationOverlay cannot be resoled error - have your tried importing; "import com.google.android.maps.MyLocationOverlay;"
 

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.