Java 如何使用android FusedLocationProviderClient获得超过1m的定位精度?
我正在尝试创建一个android应用程序,在室内提供准确的位置(1米或更少)。似乎推荐的方法是使用 然而,目前我得到的经纬度水平精度在5米到15米之间,而垂直精度通常高达50米 不确定这是否有区别,但测试设备是HTC U11 我已经更新了google play服务位置com.google.android.gms:play服务位置:17.0.0 我已经在我的应用程序清单中包括了android.permission.ACCESS\u FINE\u位置和Java 如何使用android FusedLocationProviderClient获得超过1m的定位精度?,java,android,location,google-geolocation,Java,Android,Location,Google Geolocation,我正在尝试创建一个android应用程序,在室内提供准确的位置(1米或更少)。似乎推荐的方法是使用 然而,目前我得到的经纬度水平精度在5米到15米之间,而垂直精度通常高达50米 不确定这是否有区别,但测试设备是HTC U11 我已经更新了google play服务位置com.google.android.gms:play服务位置:17.0.0 我已经在我的应用程序清单中包括了android.permission.ACCESS\u FINE\u位置和locationRequest.setPrio
locationRequest.setPriority(locationRequest.PRIORITY\u HIGH\u准确性)位置请求中的代码>
我有一些密码可以打开GPS
mFusedLocationClient=LocationServices.getFusedLocationProviderClient(此);
locationRequest=locationRequest.create();
locationRequest.setPriority(locationRequest.PRIORITY\u高精度);
locationRequest.setInterval(3*1000);//3秒
locationRequest.SetFastTestInterval(1*1000);//3秒
new-GpsUtils(this.turnGPSOn)(new-GpsUtils.onGpsListener(){
@凌驾
public void gpsStatus(布尔值isGPSEnable){
//打开GPS
isGPS=isGPSEnable;
}
});
locationCallback=新locationCallback(){
@凌驾
public void onLocationResult(LocationResult LocationResult){
if(locationResult==null){
返回;
}
对于(位置:locationResult.getLocations()){
如果(位置!=null){
wayLatitude=location.getLatitude();
wayLongitude=location.getLongitude();
Lat.setText(Double.toString(location.getLatitude());
Longs.setText(Double.toString(location.getLongitude());
Acc.setText(String.format(“%.2f”,location.getAccurance());
if(location.hasatitude()){
Alt.setText(String.format(“%.2f”,location.getAltitude()-108));
setText(String.format(“%.2f”,location.getVerticalAccuracyMeters());
}
否则{
Alt.setText(“丢失”);
VAcc.setText(“丢失”);
}
SendToBackend(路线纬度、路线经度、位置);
如果(!isContinue&&mFusedLocationClient!=null){
mFusedLocationClient.RemovelocationUpdate(locationCallback);
}
}
}
}
};
根据谷歌的说法,室内的准确度应该可以达到1米以下
提前感谢:-)影响精度的原因有很多:天气、环境、设备、卫星状态,可能还有其他一些原因。恐怕你真的不能做任何其他事情来提高准确性。你链接到的谷歌IO视频指的是WiFi RTT或802.11mc,它是WiFi 6的一部分。您的设置需要支持列出的所有要求:,特别是您的WiFi接入点需要支持该协议。