6

DDMS is not able to send location to the emulator. I have tried sending just the location from DDMS but still the emulator is not able to receive location. The application works properly in the device but its not able to capture location data in the emulator.

I am testing on Android 2.2 emulator. Can anyone let me know what can be the issue?

sunil
  • 9,541
  • 18
  • 66
  • 88
  • That's most probably you have a check `isDeviceHasGPSProvider()` and Emulator will always return false. May be your app is not actually registering for location updates – Muhammad Babar Aug 23 '14 at 18:18

4 Answers4

13

Make sure your AVD has GPS support hardware set to true

Create New AVD > Hardware > New > GPS support

Value should be "yes"

Also, ensure your app is requesting location updates in some way, otherwise the emulator will just ignore any incoming locations from DDMS or the console.

Jenn
  • 3,143
  • 1
  • 24
  • 28
  • Thank you! I'm a .net developer so I'm admittedly a newbie with Android. Your comment "Also, ensure your app is requesting location updates in some way, otherwise the emulator will just ignore any incoming locations from DDMS or the console" was exactly what I needed! Thanks! – Johnie Karr Jan 19 '13 at 18:37
8

I just use the android console via telnet, it always works.

Just open a command line and:

telnet localhost 5554

5554 is the port number of your emulator, it is usually that but might change, it can be on the window fram of the emulator as PORT:AVD_NAME.

You should be greeted with an Android console message.

To send positions to your device just type.

geo fix []

Two valid statements would be

geo fix -77.036519 38.896143
geo fix -77.036519 38.896143 100

Hope this helps, its not DDMS, but it works always. You can also feed it nmea sentences but I dont think you need that.

blindstuff
  • 18,298
  • 10
  • 47
  • 48
1

I don't know what your setup looks like, but I've had problems sending locations via DDMS using Windows XP and regional settings set to Swedish. Changing the regional settings to English(USA) solves the problem for me. I guess it has something to do with how numbers are formatted. With swedish settings numbers are formatted as 123 456 789,00 and with English(USA) as 123,456,789.00. Hope it helps

Key
  • 6,986
  • 1
  • 23
  • 15
  • i have tried that already but it doesn't make any effect to it. I assume that you are talking about the emulator timezone and the system timezone. – sunil Sep 07 '10 at 08:54
  • @sunil: Sorry about being unclear, but I am talking about the regional settings of your Windows system were the emulator is running (if you are running Windows). – Key Sep 07 '10 at 12:05
0

I had this problem and I resolve it by disabling the firewall, hope it works for you.

Navid
  • 901
  • 9
  • 20