<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Add this to Java: more info
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);
LocationListener locationListener = new LocationListener() {
// Implement methods
}
Finally - This is the cool bit! On the command line type this for the simulator to receive a location update!:
telnet localhost 5554
geo fix 0.1 51.5
More complete Location sample here:
ReplyDeletehttp://stackoverflow.com/questions/3145089/what-is-the-simplest-and-most-robust-way-to-get-the-users-current-location-in-an/3145655#3145655