Example usage for Java android.location Location fields, constructors, methods, implement or subclass
The text is from its open source code.
int | FORMAT_DEGREES Constant used to specify formatting of a latitude or longitude in the form "[+-]DDD.DDDDD where D indicates degrees. |
int | FORMAT_MINUTES Constant used to specify formatting of a latitude or longitude in the form "[+-]DDD:MM.MMMMM" where D indicates degrees and M indicates minutes of arc (1 minute = 1/60th of a degree). |
int | FORMAT_SECONDS Constant used to specify formatting of a latitude or longitude in the form "DDD:MM:SS.SSSSS" where D indicates degrees, M indicates minutes of arc, and S indicates seconds of arc (1 minute = 1/60th of a degree, 1 second = 1/3600th of a degree). |
Location(String provider) Construct a new Location with a named provider. | |
Location(Location l) Construct a new Location object that is copied from an existing one. | |
Location |
float | bearingTo(Location dest) Returns the approximate initial bearing in degrees East of true North when traveling along the shortest path between this location and the given location. |
String | convert(double coordinate, int outputType) Converts a coordinate to a String representation. |
void | distanceBetween(double startLatitude, double startLongitude, double endLatitude, double endLongitude, float[] results) Computes the approximate distance in meters between two locations, and optionally the initial and final bearings of the shortest path between them. |
float | distanceTo(Location dest) Returns the approximate distance in meters between this location and the given location. |
boolean | equals(Object obj) Indicates whether some other object is "equal to" this one. |
float | getAccuracy() Get the estimated horizontal accuracy of this location, radial, in meters. |
double | getAltitude() Get the altitude if available, in meters above the WGS 84 reference ellipsoid. |
float | getBearing() Get the bearing, in degrees. |
long | getElapsedRealtimeNanos() Return the time of this fix, in elapsed real-time since system boot. |
Bundle | getExtras() Returns additional provider-specific information about the location fix as a Bundle. |
double | getLatitude() Get the latitude, in degrees. |
double | getLongitude() Get the longitude, in degrees. |
String | getProvider() Returns the name of the provider that generated this fix. |
float | getSpeed() Get the speed if it is available, in meters/second over ground. |
long | getTime() Return the UTC time of this fix, in milliseconds since January 1, 1970. |
boolean | hasAccuracy() True if this location has a horizontal accuracy. |
boolean | hasAltitude() True if this location has an altitude. |
boolean | hasBearing() True if this location has a bearing. |
boolean | hasSpeed() True if this location has a speed. |
boolean | isFromMockProvider() Returns true if the Location came from a mock provider. |
void | removeAltitude() Remove the altitude from this location. |
void | removeBearing() Remove the bearing from this location. |
void | removeSpeed() Remove the speed from this location. |
void | reset() Clears the contents of the location. |
void | set(Location l) Sets the contents of the location to the values from the given location. |
void | setAccuracy(float horizontalAccuracy) Set the estimated horizontal accuracy of this location, meters. |
void | setAltitude(double altitude) Set the altitude, in meters above the WGS 84 reference ellipsoid. |
void | setBearing(float bearing) Set the bearing, in degrees. |
void | setElapsedRealtimeNanos(long time) Set the time of this fix, in elapsed real-time since system boot. |
void | setExtras(Bundle extras) Sets the extra information associated with this fix to the given Bundle. |
void | setLatitude(double latitude) Set the latitude, in degrees. |
void | setLongitude(double longitude) Set the longitude, in degrees. |
void | setSpeed(float speed) Set the speed, in meters/second over ground. |
void | setTime(long time) Set the UTC time of this fix, in milliseconds since January 1, 1970. |
String | toString() |