Gui*_*ido 8 android android-location
这是我收听GPS位置更新的方式(使用LocationManager和a LocationListener):
locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
listener = new MyLocationistener(); // LocationListener
locationManager.requestLocationUpdates(
LocationManager.GPS_PROVIDER,
30000, // milliseconds (minTime)
20, // meters (minDistance)
listener );
Run Code Online (Sandbox Code Playgroud)
但我想动态调整使用的minTime和minDistance参数LocationManager#requestLocationUpdates.我的目标是根据几个使用政策节省电池,即:
我想知道:
LocationManager#removeUpdates并LocationManager#requestLocationUpdates再次,如果是唯一的选择.编辑:应用程序是一个跟踪系统,以了解人们在哪里,以便将任务分配给最接近给定poing的人.实际上电池几乎不会持续8个小时,所以我想增加它.
| 归档时间: |
|
| 查看次数: |
5200 次 |
| 最近记录: |