我正在與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