Java android.location Location fields, constructors, methods, implement or subclass

Example usage for Java android.location Location fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for android.location Location.

The text is from its open source code.

Field

intFORMAT_DEGREES
Constant used to specify formatting of a latitude or longitude in the form "[+-]DDD.DDDDD where D indicates degrees.
intFORMAT_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).
intFORMAT_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).

Constructor

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

Method

floatbearingTo(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.
Stringconvert(double coordinate, int outputType)
Converts a coordinate to a String representation.
voiddistanceBetween(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.
floatdistanceTo(Location dest)
Returns the approximate distance in meters between this location and the given location.
booleanequals(Object obj)
Indicates whether some other object is "equal to" this one.
floatgetAccuracy()
Get the estimated horizontal accuracy of this location, radial, in meters.
doublegetAltitude()
Get the altitude if available, in meters above the WGS 84 reference ellipsoid.
floatgetBearing()
Get the bearing, in degrees.
longgetElapsedRealtimeNanos()
Return the time of this fix, in elapsed real-time since system boot.
BundlegetExtras()
Returns additional provider-specific information about the location fix as a Bundle.
doublegetLatitude()
Get the latitude, in degrees.
doublegetLongitude()
Get the longitude, in degrees.
StringgetProvider()
Returns the name of the provider that generated this fix.
floatgetSpeed()
Get the speed if it is available, in meters/second over ground.
longgetTime()
Return the UTC time of this fix, in milliseconds since January 1, 1970.
booleanhasAccuracy()
True if this location has a horizontal accuracy.
booleanhasAltitude()
True if this location has an altitude.
booleanhasBearing()
True if this location has a bearing.
booleanhasSpeed()
True if this location has a speed.
booleanisFromMockProvider()
Returns true if the Location came from a mock provider.
voidremoveAltitude()
Remove the altitude from this location.
voidremoveBearing()
Remove the bearing from this location.
voidremoveSpeed()
Remove the speed from this location.
voidreset()
Clears the contents of the location.
voidset(Location l)
Sets the contents of the location to the values from the given location.
voidsetAccuracy(float horizontalAccuracy)
Set the estimated horizontal accuracy of this location, meters.
voidsetAltitude(double altitude)
Set the altitude, in meters above the WGS 84 reference ellipsoid.
voidsetBearing(float bearing)
Set the bearing, in degrees.
voidsetElapsedRealtimeNanos(long time)
Set the time of this fix, in elapsed real-time since system boot.
voidsetExtras(Bundle extras)
Sets the extra information associated with this fix to the given Bundle.
voidsetLatitude(double latitude)
Set the latitude, in degrees.
voidsetLongitude(double longitude)
Set the longitude, in degrees.
voidsetSpeed(float speed)
Set the speed, in meters/second over ground.
voidsetTime(long time)
Set the UTC time of this fix, in milliseconds since January 1, 1970.
StringtoString()