Lines Matching defs:location

17 package com.example.android.location;
25 import android.location.Address;
26 import android.location.Geocoder;
27 import android.location.Location;
28 import android.location.LocationListener;
29 import android.location.LocationManager;
70 * This sample demonstrates how to incorporate location based services in your app and
71 * process location updates. The app also shows how to convert lat/long coordinates to
90 // Receive location updates from the fine location provider (gps) only.
92 // Receive location updates from both the fine (gps) and coarse (network) location
137 // when the user returns to the activity, which ensures the desired location provider is
145 // the location services, then when the user clicks the "OK" button,
157 // Stop receiving location updates whenever the Activity becomes invisible.
164 // Set up fine and/or coarse location providers depending on whether the fine provider or
172 // Get fine location updates only.
179 // Update the UI immediately if a location is obtained.
182 // Get coarse and fine location updates.
192 // one to update the UI. If only one provider returns a location, use it.
204 * Method to register location updates with a desired location provider. If the requested
211 * @return A previously returned {@link android.location.Location} from the requested provider,
215 Location location = null;
218 location = mLocationManager.getLastKnownLocation(provider);
222 return location;
239 private void doReverseGeocoding(Location location) {
242 (new ReverseGeocodingTask(this)).execute(new Location[] {location});
245 private void updateUILocation(Location location) {
247 // location.
250 location.getLatitude() + ", " + location.getLongitude()).sendToTarget();
253 if (mGeocoderAvailable) doReverseGeocoding(location);
259 public void onLocationChanged(Location location) {
260 // A new location update is received. Do something useful with it. Update the UI with
261 // the location update.
262 updateUILocation(location);
280 * http://developer.android.com/guide/topics/location/obtaining-user-location.html
289 // A new location is always better than no location
293 // Check whether the new location fix is newer or older
299 // If it's been more than two minutes since the current location, use the new location
303 // If the new location is more than two minutes older, it must be worse
308 // Check whether the new location fix is more or less accurate
314 // Check if the old and new location are from the same provider
318 // Determine location quality using a combination of timeliness and accuracy