0

I am new to Android and I am trying to write one test app which should display the latitude and longitude of the current location. Right Now, I am using Android Emulator to do so. This is the code I am using.

locationManager = (LocationManager)getSystemService(context);
Location location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);

But the location object returns NULL rather than some mock location. I have added the permission in manifest too.

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

How can I achieve this Android emulator?

Kevin
  • 53,822
  • 15
  • 101
  • 132
AnoojNair
  • 491
  • 3
  • 11
  • 18
  • Got the answer.refer this:-http://stackoverflow.com/questions/2250597/find-current-location-latitude-and-longitude – AnoojNair Dec 13 '11 at 20:30

1 Answers1

3

you have to telnet to your instance emulator and put the following:

telnet localhost 5554
geo fix <lat> <lng>
pna
  • 5,651
  • 3
  • 22
  • 37