# Print output for @column tags ?>
public
class
Location
extends Object
implements
Parcelable
java.lang.Object | |
↳ | android.location.Location |
A data class representing a geographic location.
A location may consist of a latitude, longitude, timestamp, and other information such as bearing, altitude and velocity.
All locations generated through LocationManager
are guaranteed to have a valid
latitude, longitude, and timestamp (both UTC time and elapsed real-time since boot). All other
parameters are optional.
Constants | |
---|---|
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). |
Inherited constants |
---|
Fields | |
---|---|
public
static
final
Creator<Location> |
CREATOR
|
Public constructors | |
---|---|
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. |
Public methods | |
---|---|
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. |
static
String
|
convert(double coordinate, int outputType)
Converts a coordinate to a String representation. |
static
double
|
convert(String coordinate)
Converts a String in one of the formats described by FORMAT_DEGREES, FORMAT_MINUTES, or FORMAT_SECONDS into a double. |
int
|
describeContents()
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
static
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. |
void
|
dump(Printer pw, String prefix)
|
boolean
|
equals(Object o)
Location equality is provided primarily for test purposes. |
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. |
float
|
getBearingAccuracyDegrees()
Get the estimated bearing accuracy of this location, in degrees. |
long
|
getElapsedRealtimeNanos()
Return the time of this fix in nanoseconds of elapsed realtime since system boot. |
double
|
getElapsedRealtimeUncertaintyNanos()
Get estimate of the relative precision of the alignment of the ElapsedRealtimeNanos timestamp, with the reported measurements in nanoseconds (68% confidence). |
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. |
float
|
getSpeedAccuracyMetersPerSecond()
Get the estimated speed accuracy of this location, in meters per second. |
long
|
getTime()
Return the UTC time of this location fix, in milliseconds since epoch (January 1, 1970). |
float
|
getVerticalAccuracyMeters()
Get the estimated vertical accuracy of this location, in meters. |
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
|
hasBearingAccuracy()
True if this location has a bearing accuracy. |
boolean
|
hasElapsedRealtimeUncertaintyNanos()
True if this location has a elapsed realtime accuracy. |
boolean
|
hasSpeed()
True if this location has a speed. |
boolean
|
hasSpeedAccuracy()
True if this location has a speed accuracy. |
boolean
|
hasVerticalAccuracy()
True if this location has a vertical accuracy. |
int
|
hashCode()
Returns a hash code value for the object. |
boolean
|
isFromMockProvider()
This method is deprecated.
Prefer |
boolean
|
isMock()
Returns true if this location is marked as a mock location. |
void
|
removeAccuracy()
This method is deprecated. use a new Location object for location updates. |
void
|
removeAltitude()
This method is deprecated. use a new Location object for location updates. |
void
|
removeBearing()
This method is deprecated. use a new Location object for location updates. |
void
|
removeSpeed()
This method is deprecated. use a new Location object for location updates. |
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
|
setBearingAccuracyDegrees(float bearingAccuracyDegrees)
Set the estimated bearing accuracy of this location, degrees. |
void
|
setElapsedRealtimeNanos(long time)
Set the time of this fix, in elapsed realtime since system boot. |
void
|
setElapsedRealtimeUncertaintyNanos(double time)
Set estimate of the relative precision of the alignment of the ElapsedRealtimeNanos timestamp, with the reported measurements in nanoseconds (68% confidence). |
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
|
setMock(boolean mock)
Sets whether this location is marked as a mock location. |
void
|
setProvider(String provider)
Sets the name of the provider that generated this fix. |
void
|
setSpeed(float speed)
Set the speed, in meters/second over ground. |
void
|
setSpeedAccuracyMetersPerSecond(float speedAccuracyMeterPerSecond)
Set the estimated speed accuracy of this location, meters per second. |
void
|
setTime(long time)
Set the UTC time of this fix, in milliseconds since epoch (January 1, 1970). |
void
|
setVerticalAccuracyMeters(float verticalAccuracyMeters)
Set the estimated vertical accuracy of this location, meters. |
String
|
toString()
Returns a string representation of the object. |
void
|
writeToParcel(Parcel parcel, int flags)
Flatten this object in to a Parcel. |
Inherited methods | |
---|---|
public static final int FORMAT_DEGREES
Constant used to specify formatting of a latitude or longitude in the form "[+-]DDD.DDDDD where D indicates degrees.
Constant Value: 0 (0x00000000)
public static final 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).
Constant Value: 1 (0x00000001)
public static final 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).
Constant Value: 2 (0x00000002)
public Location (String provider)
Construct a new Location with a named provider.
By default time, latitude and longitude are 0, and the location has no bearing, altitude, speed, accuracy or extras.
Parameters | |
---|---|
provider |
String : the source that provides the location. It can be of type
LocationManager#GPS_PROVIDER , LocationManager#NETWORK_PROVIDER ,
or LocationManager#PASSIVE_PROVIDER . You can also define your own
provider string, in which case an empty string is a valid provider. |
public Location (Location l)
Construct a new Location object that is copied from an existing one.
Parameters | |
---|---|
l |
Location |
public 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. The shortest path is defined using the WGS84 ellipsoid. Locations that are (nearly) antipodal may produce meaningless results.
Parameters | |
---|---|
dest |
Location : the destination location |
Returns | |
---|---|
float |
the initial bearing in degrees |
public static String convert (double coordinate, int outputType)
Converts a coordinate to a String representation. The outputType
may be one of FORMAT_DEGREES, FORMAT_MINUTES, or FORMAT_SECONDS.
The coordinate must be a valid double between -180.0 and 180.0.
This conversion is performed in a method that is dependent on the
default locale, and so is not guaranteed to round-trip with
convert(java.lang.String)
.
Parameters | |
---|---|
coordinate |
double |
outputType |
int |
Returns | |
---|---|
String |
Throws | |
---|---|
IllegalArgumentException |
if coordinate is less than -180.0, greater than 180.0, or is not a number. |
IllegalArgumentException |
if outputType is not one of FORMAT_DEGREES, FORMAT_MINUTES, or FORMAT_SECONDS. |
public static double convert (String coordinate)
Converts a String in one of the formats described by
FORMAT_DEGREES, FORMAT_MINUTES, or FORMAT_SECONDS into a
double. This conversion is performed in a locale agnostic
method, and so is not guaranteed to round-trip with
convert(double, int)
.
Parameters | |
---|---|
coordinate |
String |
Returns | |
---|---|
double |
Throws | |
---|---|
NullPointerException |
if coordinate is null |
IllegalArgumentException |
if the coordinate is not in one of the valid formats. |
public int describeContents ()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation. For example, if the object will
include a file descriptor in the output of writeToParcel(android.os.Parcel, int)
,
the return value of this method must include the
CONTENTS_FILE_DESCRIPTOR
bit.
Returns | |
---|---|
int |
a bitmask indicating the set of special object types marshaled
by this Parcelable object instance.
Value is either 0 or CONTENTS_FILE_DESCRIPTOR |
public static 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. Distance and bearing are defined using the WGS84 ellipsoid.
The computed distance is stored in results[0]. If results has length 2 or greater, the initial bearing is stored in results[1]. If results has length 3 or greater, the final bearing is stored in results[2].
Parameters | |
---|---|
startLatitude |
double : the starting latitude |
startLongitude |
double : the starting longitude |
endLatitude |
double : the ending latitude |
endLongitude |
double : the ending longitude |
results |
float : an array of floats to hold the results |
Throws | |
---|---|
IllegalArgumentException |
if results is null or has length < 1 |
public float distanceTo (Location dest)
Returns the approximate distance in meters between this location and the given location. Distance is defined using the WGS84 ellipsoid.
Parameters | |
---|---|
dest |
Location : the destination location |
Returns | |
---|---|
float |
the approximate distance in meters |
public boolean equals (Object o)
Location equality is provided primarily for test purposes. Comparing locations for equality in production may indicate incorrect assumptions, and should be avoided whenever possible.
Indicates whether some other object is "equal to" this one.
The equals
method implements an equivalence relation
on non-null object references:
x
, x.equals(x)
should return
true
.
x
and y
, x.equals(y)
should return true
if and only if
y.equals(x)
returns true
.
x
, y
, and z
, if
x.equals(y)
returns true
and
y.equals(z)
returns true
, then
x.equals(z)
should return true
.
x
and y
, multiple invocations of
x.equals(y)
consistently return true
or consistently return false
, provided no
information used in equals
comparisons on the
objects is modified.
x
,
x.equals(null)
should return false
.
The equals
method for class Object
implements
the most discriminating possible equivalence relation on objects;
that is, for any non-null reference values x
and
y
, this method returns true
if and only
if x
and y
refer to the same object
(x == y
has the value true
).
Note that it is generally necessary to override the hashCode
method whenever this method is overridden, so as to maintain the
general contract for the hashCode
method, which states
that equal objects must have equal hash codes.
Parameters | |
---|---|
o |
Object : the reference object with which to compare. |
Returns | |
---|---|
boolean |
true if this object is the same as the obj
argument; false otherwise. |
public float getAccuracy ()
Get the estimated horizontal accuracy of this location, radial, in meters.
We define horizontal accuracy as the radius of 68% confidence. In other words, if you draw a circle centered at this location's latitude and longitude, and with a radius equal to the accuracy, then there is a 68% probability that the true location is inside the circle.
This accuracy estimation is only concerned with horizontal accuracy, and does not indicate the accuracy of bearing, velocity or altitude if those are included in this Location.
If this location does not have a horizontal accuracy, then 0.0 is returned.
All locations generated by the LocationManager
include horizontal accuracy.
Returns | |
---|---|
float |
public double getAltitude ()
Get the altitude if available, in meters above the WGS 84 reference ellipsoid.
If this location does not have an altitude then 0.0 is returned.
Returns | |
---|---|
double |
public float getBearing ()
Get the bearing, in degrees.
Bearing is the horizontal direction of travel of this device, and is not related to the device orientation. It is guaranteed to be in the range (0.0, 360.0] if the device has a bearing.
If this location does not have a bearing then 0.0 is returned.
Returns | |
---|---|
float |
public float getBearingAccuracyDegrees ()
Get the estimated bearing accuracy of this location, in degrees.
We define bearing accuracy at 68% confidence. Specifically, as 1-side of the 2-sided range
on each side of the estimated bearing reported by getBearing()
, within which there
is a 68% probability of finding the true bearing.
In the case where the underlying distribution is assumed Gaussian normal, this would be considered 1 standard deviation.
For example, if getBearing()
returns 60°, and this method returns 10°, then there
is a 68% probability of the true bearing being between 50° and 70°.
Returns | |
---|---|
float |
public long getElapsedRealtimeNanos ()
Return the time of this fix in nanoseconds of elapsed realtime since system boot.
This value can be compared with SystemClock.elapsedRealtimeNanos()
, to
reliably order or compare locations. This is reliable because elapsed realtime is guaranteed
to be monotonic and continues to increment even when the system is in deep sleep (unlike
getTime()
). However, since elapsed realtime is with reference to system boot, it does
not make sense to use this value to order or compare locations across boot cycles.
All locations generated by the LocationManager
are guaranteed to have a valid
elapsed realtime set.
Returns | |
---|---|
long |
elapsed realtime of fix, in nanoseconds since system boot. |
public double getElapsedRealtimeUncertaintyNanos ()
Get estimate of the relative precision of the alignment of the ElapsedRealtimeNanos timestamp, with the reported measurements in nanoseconds (68% confidence). This means that we have 68% confidence that the true timestamp of the event is within ElapsedReatimeNanos +/- uncertainty. Example : - getElapsedRealtimeNanos() returns 10000000 - getElapsedRealtimeUncertaintyNanos() returns 1000000 (equivalent to 1millisecond) This means that the event most likely happened between 9000000 and 11000000.
Returns | |
---|---|
double |
uncertainty of elapsed real-time of fix, in nanoseconds. |
public Bundle getExtras ()
Returns additional provider-specific information about the location fix as a Bundle. The keys and values are determined by the provider. If no additional information is available, null is returned.
A number of common key/value pairs are listed below. Providers that use any of the keys on this list must provide the corresponding value as described below.
Returns | |
---|---|
Bundle |
public double getLatitude ()
Get the latitude, in degrees.
All locations generated by the LocationManager
will have a valid latitude.
Returns | |
---|---|
double |
public double getLongitude ()
Get the longitude, in degrees.
All locations generated by the LocationManager
will have a valid longitude.
Returns | |
---|---|
double |
public String getProvider ()
Returns the name of the provider that generated this fix.
Returns | |
---|---|
String |
the provider, or null if it has not been set |
public float getSpeed ()
Get the speed if it is available, in meters/second over ground.
If this location does not have a speed then 0.0 is returned.
Returns | |
---|---|
float |
public float getSpeedAccuracyMetersPerSecond ()
Get the estimated speed accuracy of this location, in meters per second.
We define speed accuracy at 68% confidence. Specifically, as 1-side of the 2-sided range
above and below the estimated speed reported by getSpeed()
, within which there is a
68% probability of finding the true speed.
In the case where the underlying distribution is assumed Gaussian normal, this would be considered 1 standard deviation.
For example, if getSpeed()
returns 5m/s, and this method returns 1m/s, then there
is a 68% probability of the true speed being between 4m/s and 6m/s.
Note that the speed and speed accuracy may be more accurate than would be obtained simply from differencing sequential positions, such as when the Doppler measurements from GNSS satellites are taken into account.
Returns | |
---|---|
float |
public long getTime ()
Return the UTC time of this location fix, in milliseconds since epoch (January 1, 1970).
There is no guarantee that different locations have times set from the same clock.
Locations derived from the LocationManager#GPS_PROVIDER
are guaranteed to have their
time set from the clock in use by the satellite constellation that provided the fix.
Locations derived from other providers may use any clock to set their time, though it is most
common to use the device clock (which may be incorrect).
Note that the device clock UTC time is not monotonic; it can jump forwards or backwards
unpredictably and may be changed at any time by the user, so this time should not be used to
order or compare locations. Prefer getElapsedRealtimeNanos()
for that purpose, as this
clock is guaranteed to be monotonic.
On the other hand, this method may be useful for presenting a human readable time to the user, or as a heuristic for comparing location fixes across reboot or across devices.
All locations generated by the LocationManager
are guaranteed to have a UTC time
set, however remember that the device clock may have changed since the location was
generated.
Returns | |
---|---|
long |
UTC time of fix, in milliseconds since January 1, 1970. |
public float getVerticalAccuracyMeters ()
Get the estimated vertical accuracy of this location, in meters.
We define vertical accuracy at 68% confidence. Specifically, as 1-side of the 2-sided
range above and below the estimated altitude reported by getAltitude()
, within which
there is a 68% probability of finding the true altitude.
In the case where the underlying distribution is assumed Gaussian normal, this would be considered 1 standard deviation.
For example, if getAltitude()
returns 150m, and this method returns 20m then
there is a 68% probability of the true altitude being between 130m and 170m.
Returns | |
---|---|
float |
public boolean hasAccuracy ()
True if this location has a horizontal accuracy.
All locations generated by the LocationManager
have an horizontal accuracy.
Returns | |
---|---|
boolean |
public boolean hasAltitude ()
True if this location has an altitude.
Returns | |
---|---|
boolean |
public boolean hasBearing ()
True if this location has a bearing.
Returns | |
---|---|
boolean |
public boolean hasBearingAccuracy ()
True if this location has a bearing accuracy.
Returns | |
---|---|
boolean |
public boolean hasElapsedRealtimeUncertaintyNanos ()
True if this location has a elapsed realtime accuracy.
Returns | |
---|---|
boolean |
public boolean hasSpeed ()
True if this location has a speed.
Returns | |
---|---|
boolean |
public boolean hasSpeedAccuracy ()
True if this location has a speed accuracy.
Returns | |
---|---|
boolean |
public boolean hasVerticalAccuracy ()
True if this location has a vertical accuracy.
Returns | |
---|---|
boolean |
public int hashCode ()
Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
HashMap
.
The general contract of hashCode
is:
hashCode
method
must consistently return the same integer, provided no information
used in equals
comparisons on the object is modified.
This integer need not remain consistent from one execution of an
application to another execution of the same application.
equals(Object)
method, then calling the hashCode
method on each of
the two objects must produce the same integer result.
equals(java.lang.Object)
method, then calling the hashCode
method on each of the
two objects must produce distinct integer results. However, the
programmer should be aware that producing distinct integer results
for unequal objects may improve the performance of hash tables.
As much as is reasonably practical, the hashCode method defined by
class Object
does return distinct integers for distinct
objects. (This is typically implemented by converting the internal
address of the object into an integer, but this implementation
technique is not required by the
Java™ programming language.)
Returns | |
---|---|
int |
a hash code value for this object. |
public boolean isFromMockProvider ()
This method is deprecated.
Prefer isMock()
instead.
Returns true if the Location came from a mock provider.
Returns | |
---|---|
boolean |
true if this Location came from a mock provider, false otherwise |
public boolean isMock ()
Returns true if this location is marked as a mock location. If this location comes from the Android framework, this indicates that the location was provided by a test location provider, and thus may not be related to the actual location of the device.
Returns | |
---|---|
boolean |
public void removeAccuracy ()
This method is deprecated.
use a new Location object for location updates.
Remove the horizontal accuracy from this location.
Following this call hasAccuracy()
will return false, and
getAccuracy()
will return 0.0.
public void removeAltitude ()
This method is deprecated.
use a new Location object for location updates.
Remove the altitude from this location.
Following this call hasAltitude()
will return false,
and getAltitude()
will return 0.0.
public void removeBearing ()
This method is deprecated.
use a new Location object for location updates.
Remove the bearing from this location.
Following this call hasBearing()
will return false,
and getBearing()
will return 0.0.
public void removeSpeed ()
This method is deprecated.
use a new Location object for location updates.
Remove the speed from this location.
Following this call hasSpeed()
will return false,
and getSpeed()
will return 0.0.
public void reset ()
Clears the contents of the location.
public void set (Location l)
Sets the contents of the location to the values from the given location.
Parameters | |
---|---|
l |
Location |
public void setAccuracy (float horizontalAccuracy)
Set the estimated horizontal accuracy of this location, meters.
See getAccuracy()
for the definition of horizontal accuracy.
Following this call hasAccuracy()
will return true.
Parameters | |
---|---|
horizontalAccuracy |
float |
public void setAltitude (double altitude)
Set the altitude, in meters above the WGS 84 reference ellipsoid.
Following this call hasAltitude()
will return true.
Parameters | |
---|---|
altitude |
double |
public void setBearing (float bearing)
Set the bearing, in degrees.
Bearing is the horizontal direction of travel of this device, and is not related to the device orientation.
The input will be wrapped into the range (0.0, 360.0].
Parameters | |
---|---|
bearing |
float |
public void setBearingAccuracyDegrees (float bearingAccuracyDegrees)
Set the estimated bearing accuracy of this location, degrees.
See getBearingAccuracyDegrees()
for the definition of bearing accuracy.
Following this call hasBearingAccuracy()
will return true.
Parameters | |
---|---|
bearingAccuracyDegrees |
float |
public void setElapsedRealtimeNanos (long time)
Set the time of this fix, in elapsed realtime since system boot.
Parameters | |
---|---|
time |
long : elapsed realtime of fix, in nanoseconds since system boot. |
public void setElapsedRealtimeUncertaintyNanos (double time)
Set estimate of the relative precision of the alignment of the ElapsedRealtimeNanos timestamp, with the reported measurements in nanoseconds (68% confidence).
Parameters | |
---|---|
time |
double : uncertainty of the elapsed real-time of fix, in nanoseconds. |
public void setExtras (Bundle extras)
Sets the extra information associated with this fix to the given Bundle.
Note this stores a copy of the given extras, so any changes to extras after calling this method won't be reflected in the location bundle.
Parameters | |
---|---|
extras |
Bundle : This value may be null . |
public void setLatitude (double latitude)
Set the latitude, in degrees.
Parameters | |
---|---|
latitude |
double |
public void setLongitude (double longitude)
Set the longitude, in degrees.
Parameters | |
---|---|
longitude |
double |
public void setMock (boolean mock)
Sets whether this location is marked as a mock location.
Parameters | |
---|---|
mock |
boolean |
public void setProvider (String provider)
Sets the name of the provider that generated this fix.
Parameters | |
---|---|
provider |
String |
public void setSpeed (float speed)
Set the speed, in meters/second over ground.
Following this call hasSpeed()
will return true.
Parameters | |
---|---|
speed |
float |
public void setSpeedAccuracyMetersPerSecond (float speedAccuracyMeterPerSecond)
Set the estimated speed accuracy of this location, meters per second.
See getSpeedAccuracyMetersPerSecond()
for the definition of speed accuracy.
Following this call hasSpeedAccuracy()
will return true.
Parameters | |
---|---|
speedAccuracyMeterPerSecond |
float |
public void setTime (long time)
Set the UTC time of this fix, in milliseconds since epoch (January 1, 1970).
Parameters | |
---|---|
time |
long : UTC time of this fix, in milliseconds since January 1, 1970 |
public void setVerticalAccuracyMeters (float verticalAccuracyMeters)
Set the estimated vertical accuracy of this location, meters.
See getVerticalAccuracyMeters()
for the definition of vertical accuracy.
Following this call hasVerticalAccuracy()
will return true.
Parameters | |
---|---|
verticalAccuracyMeters |
float |
public String toString ()
Returns a string representation of the object. In general, the
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
Returns | |
---|---|
String |
a string representation of the object. |
public void writeToParcel (Parcel parcel, int flags)
Flatten this object in to a Parcel.
Parameters | |
---|---|
parcel |
Parcel : The Parcel in which the object should be written. |
flags |
int : Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE .
Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |