You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
78 lines
1.3 KiB
Java
78 lines
1.3 KiB
Java
package android.location;
|
|
|
|
public class Location {
|
|
|
|
private double latitude;
|
|
private double longitude;
|
|
private double altitude;
|
|
private double accuracy;
|
|
private double speed;
|
|
private double bearing;
|
|
private long timestamp;
|
|
|
|
/* for internal use */
|
|
public Location (double latitude,
|
|
double longitude,
|
|
double altitude,
|
|
double accuracy,
|
|
double speed,
|
|
double bearing,
|
|
long timestamp) {
|
|
this.latitude = latitude;
|
|
this.longitude = longitude;
|
|
this.altitude = altitude;
|
|
this.accuracy = accuracy;
|
|
this.speed = speed;
|
|
this.bearing = bearing;
|
|
this.timestamp = timestamp;
|
|
}
|
|
|
|
public double getLatitude() {
|
|
return latitude;
|
|
}
|
|
|
|
public double getLongitude() {
|
|
return longitude;
|
|
}
|
|
|
|
public boolean hasAltitude() {
|
|
return altitude != -Double.MAX_VALUE;
|
|
}
|
|
|
|
public double getAltitude() {
|
|
return altitude;
|
|
}
|
|
|
|
public boolean hasAccuracy() {
|
|
return true;
|
|
}
|
|
|
|
public float getAccuracy() {
|
|
return (float)accuracy;
|
|
}
|
|
|
|
public boolean hasSpeed() {
|
|
return speed != -1;
|
|
}
|
|
|
|
public float getSpeed() {
|
|
return (float)speed;
|
|
}
|
|
|
|
public boolean hasBearing() {
|
|
return bearing != -1;
|
|
}
|
|
|
|
public float getBearing() {
|
|
return (float)bearing;
|
|
}
|
|
|
|
public long getTime() {
|
|
return timestamp;
|
|
}
|
|
|
|
public String getProvider() {
|
|
return "fused";
|
|
}
|
|
}
|