我正在研究一個需要我的android手機不斷更新位置的項目。它工作正常,但非常不準確。在室內,我通過getAccuracy()得到的準確位置在60左右(據我所知是以米爲單位),我希望準確度在(最大)2-3米。 首先,不可能不斷地獲得(2-3米)的精度? 如果是,如何?在Android中找到的GPS座標的準確性
關注是我用來獲取用戶位置的代碼片段。
public boolean getLocation(Context context, LocationResult result)
{
//I use LocationResult callback class to pass location value from MyLocation to user code.
locationResult = result;
if(lm==null)
lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
//exceptions will be thrown if provider is not permitted.
try{gps_enabled=lm.isProviderEnabled(LocationManager.GPS_PROVIDER);}catch(Exception ex){}
try{network_enabled=lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER);}catch(Exception ex){}
//don't start listeners if no provider is enabled
if(!gps_enabled && !network_enabled)
return false;
if(gps_enabled)
lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListenerGps);
if(network_enabled)
lm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListenerNetwork);
timer1=new Timer();
timer1.schedule(new GetLastLocation(), 10000);
return true;
}
我也越來越另一個問題,與我的設備不斷地放置在一個靜態的位置,兩個連續的GPS定位獲取之間的距離是非常不可靠的,它從0.0米變爲16米,這意味着我的設備是不斷移動。
如果您對此有任何想法,最好是如何達到準確度,請幫助我。
感謝
我可以在戶外獲得多少準確度? – 2012-08-12 11:17:34
戶外準確度取決於您所處的景觀類型。在平坦的鄉村地區,您可以獲得大約1米的精確度,在擁有大型摩天大樓的城市中間,準確度可降至50米左右。 – Rob 2012-08-12 23:12:07