我正在与GPS相关的应用程序,我需要得到垂直精度,但它总是修复11.0000我需要它动态作为纬度和经度,我用getAccuracy,但它导致水平精度。垂直精度在Android GPS GPS
@Override
public void onLocationChanged(Location location)
{
if (location != null)
{
lat = location.getLatitude();
lon = location.getLongitude();
Geocoder geoCoder = new Geocoder(getBaseContext(),
Locale.getDefault());
address = mailOb.getAddress(geoCoder, lat, lon);
if (!meterFootFlag)
{
diameter = Math.round(location.getAccuracy()) + " m.";
altitude = Math.round(location.getAltitude()) + " m.";
}
else
{
diameter = Math.round(location.getAccuracy() * 3.28084)
+ " ft.";
altitude = Math.round(location.getAltitude() * 3.28084)
+ " ft.";
}
if (diameter.contains("+"))
diameter.replace("+", "");
else if (altitude.contains("+"))
altitude.replace("+", "");
}
else
{
lat = 0.0;
lon = 0.0;
if (!meterFootFlag)
{
altitude = 0.0 + " m.";
diameter = 0.0 + " m.";
}
else
{
altitude = 0.0 + " ft.";
diameter = 0.0 + " ft.";
}
}
mlocManager.removeUpdates(MySettings.this);
pDialog.dismiss();
我怎样才能得到它垂直精度提前
感谢
那么在这种情况下有什么选择?我要离开去使用它吗?或者我可以使用其他任何东西,然后呢? – Yagnesh
我更新了我的amswer – AlexWien
@Yug是我的答案有用吗?考虑也upvoting。 – AlexWien