【发布时间】:2015-11-24 11:55:52
【问题描述】:
我正在开发 googlemaps 应用程序,我正在使用 google fusion 位置提供程序来查找当前位置,并且我正在尝试 requestlocationupdates,但是当我使用 gps 和 locationrequest 优先级 HIGH_ACCURACY 时我面临的问题,我的电池电量消耗非常快,这就是为什么我想将我的 locationrequest 优先级更改为 BALANCED_POWER 但没有 gps 我无法获得纬度和经度但是在谷歌文档中他们提到没有 gps 也应该可以工作请回复
代码:
_googleApiClient = new GoogleApiClient.Builder(this)
.addApi(LocationServices.API)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
_locationRequest = new LocationRequest();
_locationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);
PendingResult<Status> pendingResult = LocationServices.FusedLocationApi.requestLocationUpdates(
_googleApiClient, _locationRequest,this);
【问题讨论】:
-
你能实现你想要的吗?我很好奇它是否对你有用..