简体   繁体   English

GPS_PROVIDER的位置

[英]Location with GPS_PROVIDER

Sorry, I'm a beginner in android. 抱歉,我是android的初学者。 I have to save when a car parks using a service. 当停车场使用服务时,我必须保存。 To do this I'm using LocationManager with GPS_PROVIDER to monitor the speed of the car. 为此,我将LocationManager与GPS_PROVIDER配合使用以监视汽车的速度。 I am using requestLocationUpdates but when the machine stops onLocationChanged it is no longer called so I can not get the speed, understand that it is stationary and save the parking space. 我正在使用requestLocationUpdates,但是当机器停止onLocationChanged时,不再调用它,因此无法获得速度,请了解它是静止的并节省了停车位。 How could I do? 我该怎么办?

If you want continued updates while stopped you need to ensure 'minDistance' is not preventing updates. 如果要在停止时继续更新,则需要确保“ minDistance”不会阻止更新。 It is passed to your 'requestLocationUpdates' call. 它被传递到您的“ requestLocationUpdates”调用。 Try setting the value to 0. However this will also have a negative impact on battery life. 尝试将该值设置为0。但是,这也会对电池寿命产生负面影响。 I would also suggest looking into the location APIs provided by Google Play Services instead of using the LocationManager. 我也建议您研究Google Play服务提供的位置API,而不要使用LocationManager。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 GPS_PROVIDER 定位的问题 - Problem using GPS_PROVIDER for location 无法使用GPS_PROVIDER / NETWORK_PROVIDER获取用户位置 - Not getting user location using GPS_PROVIDER / NETWORK_PROVIDER 来自Android中GPS_PROVIDER或NETWORK_PROVIDER的位置不一致 - Location from GPS_PROVIDER or NETWORK_PROVIDER in android is not consistent 使用GPS_PROVIDER和NETWORK_PROVIDER获取当前位置的问题 - Issue in getting Current Location with GPS_PROVIDER and NETWORK_PROVIDER Android requestLocationUpdates 不起作用(GPS_PROVIDER、ACCESS_FINE_LOCATION) - Android requestLocationUpdates not working (GPS_PROVIDER, ACCESS_FINE_LOCATION) 如果位置管理器无法通过GPS_Provider获取位置,请切换到NETWORK_Provider - If Location Manager cannot fetch location with GPS_Provider, switch to NETWORK_Provider 如何添加仅使用GPS_PROVIDER作为提供者而不使用NETWORK_PROVIDER触发的位置接近警报 - How to add a location proximity alert that triggers only using GPS_PROVIDER as provider and not using NETWORK_PROVIDER 查找GPS_Provider和Network_Provider在同一时间获得的位置 - Finding the location obtained by GPS_Provider and Network_Provider at the same time stamp Android:即使设备没有移动(固定),GPS_PROVIDER也会触发几处位置更改,直至数百米远 - Android: GPS_PROVIDER is triggering several location changes to hundred meters far, even while device is not moving (stationary) 如何通过GPS_PROVIDER获得更高的精度 - How to get more accuracy by GPS_PROVIDER
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM