Friday, April 19, 2013

Give location information in Android Emulator

When we dealing with simulating the GPS or location-based service on emulator of Eclispes ADT bundle, the results are null generally, namely, we don't have the access of the longitude and latitude of the coordination. However, in this kind of scenarios, there are two commons ways to address this problem.


  1. open the command in Windows and make sure that you open the telnet services. For Windows 7 the telnet service is automatically closed unless we manually start it. (Please Google how to start telnet service if you have doubts) In the command line, type telnet localhost 5554. If your emulator is port 5556 or something else, type it accordingly. The port number will be shown in the title when you start the emulator. Then type geo fix 0 0. The two numbers here are the coordination (longitude and latitude respectively) of the location you desired.
  2. OR you can use the DDMS on the upper right corner of the Eclipse ADT. Then choose the device and type the coordinates and press send.
press the above icon on the top right of the Eclipse window and choose DDMS


Either way will do the trick.

p.s.
One more solution is to use this brilliant guy dpdearing's solution. An Android GPS Location Emulator

No comments:

Post a Comment