Ok, this is a really weird one.
I'm sending Latitude/Longitude to Emulator running my App and its getting the wrong Coordinates !!! Everything I send (either via DDMS using GPX file, DDMS Manual, or telnet and using geo fix command), gets received, but when I print the latitude/longitude points received by the app, there are off by just a little bit (well a few hundred yards to where I was aiming for).
Discovered this because I've always tested my app on a PC, but recently purchased a Mac. So I'm going through my standard tests, using the GPX file with lat/long points that I always used on the PC, and the app is showing the wrong location.
Example:
I send this:
geo fix geo fix -72.74 41.74
And in my app, onLocationChanged, location.toString() says this:
Location[mProvider=gps,mTime=1287892837000,mLatitude=41.74016776666667,mLongitude=-72.74533443333333,mHasAltitude=false,mAltitude=0.0,mHasSpeed=false,mSpeed=0.0,mHasBearing=false,mBearing=0.0,mHasAccuracy=false,mAccuracy=0.0,mExtras=Bundle[mParcelledData.dataSize=4]]
I mean what the heck?? Tested with Google Maps also, and if I select myLocation, it goes to the same wacky coordinates instead of the actual ones I sent.
Looks like some weird math or conversion issue, since the numbers are close, but not exact.
Again, this all works fine on the PC, meaning, on the PC it gets the exact coordinates that I send. For the Emulator I created an avd using AVD manager, WVGA854, Google API Level 8.
Running on new MacBook pro, and new Eclipse Helios install and new install of Android SDK.
This seems like the bug in DDMS .
http://code.google.com/p/android/issues/detail?id=11264
Related
I recently switched to Android Studio 2.0. Before that I was able to send GPX files to the emulator through ADM's Emulator control tab. Since the switching, that feature seems to be broken. I am currently able to connect through telnet and manually send geo fixes (not easy to simulate long tracks this way), but ADM refuses to let me set a GPX file, a manual location or a KML file. Buttons are enabled but I can't click other them.
I should say, that ADM is correctly connected to the device, since I was able to parse file system, etc.
Any hint on what's happening? Any workaround?
I use Eclipse and Android SDK to develop apps for android,recently i wrote a program to show a map on it, it works fine on real device but it don't show any map on emulator.
I check the emulator internet connection and it works and i checked the browser on emulator and it works and i checked the Google map app on the emulator and it show me an black page.
I think about a graphical library or something would be missing, is it possible ? what can i do to correct it?
PS:
1-I use Google APIs 4.2.2 image.
2-I know there are many emulator but they don't works with DDMS on Eclipse.for example DDMS can't send GPS location or SMS to theme or call theme.and i want some log system like LogCat.
You have to use genny motion . Its works like real device.
http://www.genymotion.com/
android genymotion vs emulator
use the following steps to make avd for s4 or any type:withe help of genymotion third party pulgin:
download first genymotion https://cloud.genymotion.com/page/launchpad/download/
cmd for install genymotion http://schier.co/post/install-genymotion-2.0-in-ubuntu
then: The installation of the plugin can be done by launching Eclipse and going to "Help / Install New Software" menu, then just add a new Update Site with the following URL: http://plugins.genymotion.com/eclipse.
installing the google play service from the following : http://blog.zeezonline.com/2013/11/install-google-play-on-genymotion-2-0/
Genny Motion is the best solution by far and had almost all features a developer needs.
But the reason that i cant see the map is the time i should wait and https protocol which is don't work properly in our country because of it's encryption ,it seems it took a while to appear a map, i left the program to eat dinner , when i came back it appears !!! but Google map App still don't work , maybe it needs time too.
Emulator does not having gps hardware to run google map, that the reason it's showing blank, To run Map we need both a internet and gps as well.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to emulate GPS location in the Android Emulator?
I'm struggling with activating the GPS functionality in the Android Emulator (Eclipse)
I wrote a test program for getting the current location. It's working on my Android Phone.. so I'm sure the app is working.
If I'm testing the program in the Android Emulator from Eclipse... nothing is happening! What am I missing?
I already added GPS support in the AVD
I know the Emulator control... but nothing is happening in the app.
Do I need to install some extra futures in the SDK?
I hope someone can point me in the right direction!
With the emulator running, do a
telnet localhost 5554
to connect to the emulator. Then you can do several commands, for example:
geo fix (longitude) (latitude)
That command instructs the emulator to behave as if the phone was at those location (basically fake the GPS coordinates).
You can use google maps feature called "drop latlong marker" to get GPS coordinates for a particular place.
You just need to send latitude and longitude via Emulator Control under DDMS, no need to other things.
pretty simple:)
the geo-fix solution works , but the eclipse ui solution should also work. you are not supposed to install anything special.
try to create a new emulator (which has gps support enabled in its features) and run it , select it in the emulators list under "devices" , and then go to the emulator control . set there the location and press "Send" .
in any case , if that doesn't work , you can even install third party apps on the emulator that do the same thing :
https://play.google.com/store/search?q=location+spoofer&c=apps
I originally asked this question as a possible bug in Eclipse Helios :
link text
I accepted that it was bug in Helios but I now find that I'm now getting the same error under Eclipse 3.5
When I send a location from the DDMS perspective using the emulator control tab. I have a standard listener:
onLocationChanged(Location location){...}
If I break on the first line of this, having sent the lat/lon pair of 53.5/-3.0 from the DDMS tab, then the mLatitude/mLongitude in the location argument have changed to 53.508833/-3.005000 (6 dec places only shown).
The Android SDK is 2.2 in both and the target is Google APIs level 7.
Does anybody else experience this or could offer a possible explanation? (It amounts to quite a big error in terms of metres on the map.)
Yes!!! I have the same issue.
I also have Eclipse Helios, but not sure if this is a Helios issue, since I can start the Emulator from the command line, and send coords using "geo fix" command and get the same problem.
Could be an issue with new versions of Android SDK. I have used previous Android SDK and Eclipse Europa on a PC with no problem. Recently (Oct 2010) I bought a Mac, so I had to install new Eclipse and new Android SDK.
So I'm testing my app, the same one that works fine when testing on the PC, and I'm using the same GPX file that I always use to send coords to the app. And sure enough I get the weird issue you show above with extra numbers after the decimal point added in. Same thing if I use geo fix from command line.
Also, definitely not an App issue. I can open Google Maps in Emulator and send geo fix coords and then use My Location feature in Google maps and it centers on the wrong coords.
So I'm guessing a problem with Emulator in new versions of Android SDK.
I made a small test application that uses the GPS module. To test it, I used telenet to connect to the emulator and send geo fix coordinates.
Sending geo fix 90 90 from telnet made my application react ok.
After reading a while I found about the DDMS. There seems to be a problem with sending coordinates from it to the device. No matter what option I try: Manual or KML file (the KML loads fine) the device only receives one 0.0 and 0.0 coordinates, no matter what I send it.
What am I doing wrong ?
It seems that eclipse has something to do with locales of the computer. The solution to make it work was to force the eclipse to use en locales. So, find your eclipse.ini file and add this in the end of the file: -Duser.language=en
I recorded a path in google earth with the route I wanted to follow. I saved it. I converted it here: http://ge2adt.appspot.com/