Android定位(是否使用GPS进行定位)

       TencentLocationRequest request = TencentLocationRequest.create();
            request.setRequestLevel(TencentLocationRequest.REQUEST_LEVEL_ADMIN_AREA);

            //设置是否使用GPS进行定位
            LocationManager locManager = (LocationManager) mContext.getSystemService(Context.LOCATION_SERVICE);
            if (locManager.isProviderEnabled(LocationManager.GPS_PROVIDER)){
                request.setAllowGPS(true);
            } else {
                request.setAllowGPS(false);
            }
原文地址:https://www.cnblogs.com/longzhongren/p/6908491.html