Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
android谷歌地图:如何仅使用GPS?_Android_Google Maps_Gps_Google Play Services - Fatal编程技术网

android谷歌地图:如何仅使用GPS?

android谷歌地图:如何仅使用GPS?,android,google-maps,gps,google-play-services,Android,Google Maps,Gps,Google Play Services,我需要更高的准确度,要获得android使用网络和wifi或GPS的位置,我需要它只使用GPS进行最精确的定位 我正在开发一个简单的应用程序来跟踪手机,该应用程序运行良好,但我的问题是,即使在我的手机上启用GPS并请求高精度设置PriorityLocationRequest。PRIORITY\u high\u精度;,该应用程序使用wifi和网络来确定我的位置,而不是GPS。我怎样才能让它只使用GPS 明显地 我的部分代码 public class MainActivity extends A

我需要更高的准确度,要获得android使用网络和wifi或GPS的位置,我需要它只使用GPS进行最精确的定位

我正在开发一个简单的应用程序来跟踪手机,该应用程序运行良好,但我的问题是,即使在我的手机上启用GPS并请求高精度设置PriorityLocationRequest。PRIORITY\u high\u精度;,该应用程序使用wifi和网络来确定我的位置,而不是GPS。我怎样才能让它只使用GPS

明显地

我的部分代码

public class MainActivity extends ActionBarActivity implements GoogleApiClient.ConnectionCallbacks,
    GoogleApiClient.OnConnectionFailedListener, LocationListener {

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate ...
    mGoogleApiClient = new GoogleApiClient.Builder(this)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .addApi(LocationServices.API)
            .build();
    createMapView();
}

@Override
public void onConnected(Bundle bundle) {

    mLocationRequest = LocationRequest.create();
    mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
    mLocationRequest.setInterval(1000); // Update location every second

    LocationServices.FusedLocationApi.requestLocationUpdates(
            mGoogleApiClient, mLocationRequest, this);
}

更改位置请求优先级

mLocationRequest = LocationRequest.create();
mLocationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);

这将帮助您

我需要更高的精确度,要获得位置,请使用android网络和wifi或GPS,我需要它仅使用GPS来获得最精确的位置。您好。我认为优先权、平衡权、功率、准确性使用网络和wifi。