My favorites | Sign in
Google
          
New issue | Search
for
| Advanced search | Search tips
Issue 2545: GPS emulation issues in emulator
45 people starred this issue and may be notified of changes. Back to list
Status:  Released
Owner:  digit.android
Closed:  Sep 16
Type-Defect
Priority-Medium
Component-Tools


Sign in to add a comment
 
Reported by Brett.Chabot, Apr 29, 2009
Build: 1.5_r1 on windows

Scenario:
1. Launch a app that listens for location updates (ie maps) on SDK emulator
2. Use DDMS or emulator console to issue location updates 
3. Continually repeat step 2

Observed results:
usually after 3 to 5 attempts, the app stops receiving location updates.

This appears to be a platform specific issue, as I cannot reproduce this
issue on Mac.

Comment 1 by testtherun, Apr 30, 2009
I have exactly the same problem.
Only difference:

the app stops receiving location updats after 1-2 attemts.

Comment 3 by s...@gmx.eu, May 01, 2009
Same here, my app only receives two locations, then my Listener isn't called again.
Sending Locations through DDMS doesnt work (rest of DDMS works fine). Sending geo fix
by telnet works, but only twice.
Comment 4 by testtherun, May 03, 2009
any solutions?
Comment 5 by Adolf.Hohl, May 08, 2009
I have the same issue. Noticing that going via telnet and sending a geo fix negative 
values and some with high presicion don't get accepted. I couldn't get it running.
Comment 6 by grapfe, May 08, 2009
Same problem here. Only the first geo fix command works, the next one won't get updated.
Comment 7 by coleman.jec, May 09, 2009
Same experience.  Only one update hits my listener.  Worked fine in 1.1


Comment 8 by renebartkowiak, May 11, 2009
Same here. I need that fuction for an application, so any suggestion?
Comment 9 by brettcha...@android.com, May 11, 2009
One potential workaround is to try to use mock location providers instead: 

http://developer.android.com/reference/android/location/LocationManager.html#addTestProvider(java.lang.String,
boolean, boolean, boolean, boolean, boolean, boolean, boolean, int, int)

Comment 10 by neoraptor123, May 14, 2009
I have the same problem too.
Does anyone have a solution?

Thank you.
Comment 12 by rlecheta, May 14, 2009
Hi, same problem too.

But wit works if you create some SDK 1.1 AVD (target=1) 

regards
Comment 13 by rcgroot, Jun 03, 2009
I have problem that looks the same. Outputting the Location object shows that the
first one has mTime=1234567 (something real) the second one has mTime=-1000 and then
the updates stop.

Getting the last known location and outputting that one shows that all mTimes after
the second Location are mTime=-1000. 

I submitted a fix that solves the problem in the mTime situation.
https://review.source.android.com/10251
Comment 14 by eran.neufeld, Jun 14, 2009
Same problem here.
This is really annoying, because it is actually almost impossible to work with the
emulator.
I hope the priority changes to something more serious.

Any other workaround besides addTestProvider?

Comment 15 by cyaconi, Jun 16, 2009
I'm testing the listener on a HTC Magic (I/O 2009), and my location is only updated 
once. I installed my application and started driving, and I was never informed of a 
location changed (I set up 60 secs and 50 mts).
I'm using SDK 1.5 r2
Thanks
Comment 16 by Tom.Bridge89, Jun 16, 2009
Same problem though I tried it on Ubuntu and still had the same issue of it stopping
after two location updates...????
Comment 17 by IvanRC1983, Jun 18, 2009
Same problem here. The location is updated two times only, after that, the ddms keeps
sending mock locations but the emulator does not show them into the map. Is there a
problem with the ddms or in the emulator?. 
Somebody has a solution? I need this working for my university's project, it is very
important!

Thanks, and sorry for my English!
Comment 18 by pale.cold.fire, Jun 19, 2009
same here...

this is really embarassing... you'd think this would have been tested at this basic 
level...
Comment 19 by a.wirayudha, Jul 04, 2009
I also get the same problem even on the real device (HTC Magic - Non Google), the
work around:

public class DeviceLocationListener implements LocationListener {
		public void onLocationChanged(Location location) {
			mLocationManager.removeUpdates(locationListener);
			mLocationManager.requestLocationUpdates(
                        LocationManager.GPS_PROVIDER,
                        3000,
                        1,
                        locationListener);
		}
}
Comment 20 by Tom.Bridge89, Jul 04, 2009
Ah thanks a.wirayudha the work around is simple and works so I guess that will have
to do. This problem was driving me crazy for ages.

Tom
Comment 21 by andrei.fifiita, Jul 05, 2009
Hy,
I wrote a script that sends a "geo fix [coord1] [coord2]" command (every command
should give a new location at about a distance of 10-40 m from the last one)
The onLocationChanged() method triggers normally but it doesn't receive the correct
coords. The coords are received when the new location is at a distance of about 10-20
km from the last location update received.
Ex:

Example:
Sending: geo fix 26.446486 44.464973
Sending: geo fix 26.446745 44.465572
Sending: geo fix 26.447004 44.46617
Sending: geo fix 26.447264 44.46677
Sending: geo fix 26.447523 44.46737
Sending: geo fix 26.447783 44.467968

When i print the received coords i get this:
Loc changed: 44.457335816666664 26.43766885
Loc changed: 44.45733591666667 26.437668900000002
Loc changed: 44.45733601666667 26.43766893333333
Loc changed: 44.474000016666665 26.43766898333333
Loc changed: 44.474000116666666 26.43766901666667

Why do I get coords with this lack of precision ? (requestLocationUpdates() has
minTime = 0, minDist = 0)
Comment 22 by jisakiel, Jul 05, 2009
I have experienced also those issues, both the missing position updates in 1.5
firmware (had to revert to 1.1 for my personal project to work) and the precision
issue in telnet, which, curiously enough, doesn't happen when the coordinates are
sent from eclipse (I would certainly have assumed that eclipse sent the coordinates
through a telnet connection!). 
Comment 23 by andrei.fifiita, Jul 05, 2009
I also tried sending mock locations (at a rate of about 1000 ms using another thread)
with sendTestProviderLocation(...) but that will not trigger onLocationChanged(). Is
it possible I forgot to do/set something ?
Comment 24 by baonhan, Jul 09, 2009
Same issue here, I can only receive 1 or 2 first location changes. Very annoying
Comment 25 by compuguy84, Jul 13, 2009
I am seeing the same issue in the emulator. My onLocationChanged is not being called
more than once or twice from either geofix or DDMS. I setup a Toast to notify me of
location changes. If I send a new location to the application, I get no indication it
was received. If I close my Activity in the emulator and reopen it, I see the Toasts
from the previous session as if they were queued up. 

SDK 1.5_r2, Vista SP1
Eclipse Platform
Version: 3.4.1
Build id: M20080911-1700
Comment 26 by dturner.soremo, Aug 12, 2009
Can someone test the issue with the 1.5r3 SDK/emulator.
(It includes a few related GPS-related fixes)
Comment 27 by ses1430, Aug 12, 2009
It's same with the 1.5r3.
Comment 28 by rcgroot, Aug 12, 2009
In 1.5r3 the problem remains for me too, issue and solution as described in:
http://code.google.com/p/android/issues/detail?id=2545#c13 
Comment 29 by py.ricau, Aug 13, 2009
Bug still remaining in 1.5r3...

One more detail : it seems to be linked to an application lifecycle : whenever I
relaunch an application, I can push GPS coordinates once again.
Comment 31 by cschandr...@gmail.com, Aug 13, 2009
Same issue here, I can only receive first two location changes. Any fixes??

Comment 32 by sheikyis, Aug 14, 2009
any one from google please give the solution and suggest how to proceed forward in
1.5 sdk...
Comment 33 by ses1430, Aug 18, 2009
I'm not sure this solved issue, or not.
Anyway, after I set correct Time zone & Time in setting of AVM, 
it works great. Someone try this and feedback plz.
Comment 37 by vishal.changrani, Aug 19, 2009
ses1430 you are my hero..works!!!
but i see one side effect when I use location listerer...my onTap on the Itemized 
overlay keeps getting called even when I dont take ON the overlay but somewhere near 
it....it does not happen when i dont use location listener..
But thx a lot for sharing the info!
Comment 38 by py.ricau, Aug 19, 2009
Thanks a lot ses1430, it works!! Though I don't really understand why...

Just to be precise:

In the emulator, on the Home Screen, press "Menu" -> "Settings" -> "Date & Time" ->
->Uncheck "Automatic" -> "Select Time Zone", and choose the right time zone (ie, yours).

And voila! Works great!!



Comment 39 by rcgroot, Aug 19, 2009
Yes, ses1430, your workaround does the trick!

The workaround makes sense because a buggy timezone usage in the GPS-emulator driver
(gps_qemu) causes the problem. Setting the timezone avoid the driver problem!

Thank you ses1430 for the help!

Rene
Comment 40 by jbq@google.com, Aug 21, 2009
(No comment was entered for this change.)
Labels: Component-Tools
Comment 42 by cschandr...@gmail.com, Aug 24, 2009
Finally it works, don't know why!!
Just follow the steps on Comment 38.
Thanks ses1430
Comment 43 by digit.android, Sep 16, 2009
This issue should be fixed in the recently released 1.6 SDK.
If this not the case, please update this bug.
Status: Released
Owner: digit.android
Comment 44 by ebay-dah...@web.de, Sep 30, 2009
hello,
ddms does not work on my mac. perhaps i make a stupid mistake.

please look at: 
http://groups.google.com/group/android-developers/browse_thread/thread/5360c665c92af02e/d1ee24b3377a47da#d1ee24b3377a47da

Thanks.
Comment 45 by niravshah99, Oct 07, 2009
Well just adding the time zone correctly fixed it.
Thanks
Nirav
Sign in to add a comment