Bug in Eclipse Emulator DDMS? - android

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.

Related

Why Gmap and App Map do not work on Emulator?

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.

locationclient.getlastlocation() always returns null on emulator

I am new into Android world. I was just referring this tutorial from Google:
http://developer.android.com/training/location/retrieve-current.html
Program compiles fine and launches application on emulator, but when I try to find mLocationClient.getLastLocation() it returns null, ALWAYS
I searched for almost a day and ahve already tried sending parameter from DDMS, telnet, switching google MAPs but still no success.
Please help me out.
What eventually worked for me was setting a location (I use Genymotion, so the "GPS widget" in the upper right corner), then starting Google Maps, and then running my app.
My guess is that my app wasn't actually setting the current location (which I thought connecting my locationClient would do automatically) - Google Maps checks and sets the location, so getLastLocation actually has something to return.
I think the emulator sometimes has its own bugs and issues. maybe that's one of them.
try the next things:
use the latest version of Android for the emulator. also update the ADT & SDK to the latest versions.
use alternative emulators
use real devices
use fake-gps-apps (location mocking) which make the OS think that your device is in some position
make sure that in the OS settings, mocking of gps locations is enabled
Open google map once in the emulator then give all geolocalisation permissions to google map, switch back to your app it should work.

Android application is crashed, when build from my machine, but not from other machine

I'm using a mac machine to build a android application, but it will crashed when run on device. but with the same code and key I build the application using another machine (windows). it is working well on devices.
Using my mac I already build several other apps and those are working well.
Can any one give me a solution?
First get the feedback of your client device as Kumar suggested.
get the clients device specifications,screenshots and try to reproduce on emulator.Exactly what caused the error may want you to ask him what steps to follow to reproduce the error.etc
is it possible to test this app on emulator with out any code changes?
Yes.You have a DDMS perspective.Just go to the top right corner above the coding window.There's a sort of plus (+) button there.From there you have a DDMS perspective.In this perspective,you can control emulator.You can feed the GPS co-ordinates here.
Look at this
Sounds like you are using some new API that your client doesn't have. He might be running an older OS. Run Android Lint checks and see if you get an API warnings.
Check your client's OS version and your own. Create emulator with your client's OS version and see if it's crashing.

HTML5 Geolocation not working in Android Emulator

I am facing a strange issue wherein HTML5 Geolocation is not working only on Android Emulator. I have a very simple code as follows:
navigator.geolocation.getCurrentPosition(suc, locFail, { 'enableHighAccuracy': true, 'timeout': 60000, 'maximumAge': 60000 });
Once the emulator is running I do supply mock coordinates using DDMS/telnet geo fix.
But the moment it executes the above line of code, the emulator hangs. In LogCat I get messages notifying that each service is dying and then I get the Android Emulator Launch screen. I cannot do anything with the emulator except closing it and restarting it.
Version of Android: 2.3.3
ADT Version: 20
Emulator Settings: Allow mock locations is enabled. Use GPS Satellites is enabled.
The same code works perfectly fine on my desktop browser.
Any help will be highly appreciated.
Thank you
When you create an AVD, you will see two versions. For e.g. The Target names for 2.3.3 will be Android 2.3.3 and Google APIs (Google Inc). Try selecting the Google APIs version for your AVD and see if it works.
Try to move to the Google Maps version of the AVD and see if you are able to see the mock locations.

Wrong Latitude/longitude received in Android Emulator on Mac

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

Categories

Resources