简体   繁体   English

追踪android中的位置

[英]Tracking the location in android

I got the current location latitude and longitude while giving on in a switch button in android and displaying the location in google map. 我在android中的切换按钮上放弃并在google map中显示位置的同时获得了当前位置的纬度和经度。 But I need the latitude and longitude changes automatically wherever the device moves and the location on the map should change with respect to the position. 但是,无论设备移动到哪里,我都需要自动更改纬度和经度,并且地图上的位置应相对于位置进行更改。 How is it possible? 这怎么可能? Can anyone give me a way? 谁能给我办法?

You could have a look at GoogleApiClient . 您可以看看GoogleApiClient You can use requestLocationUpdates(...) to get the users position in a given intervall. 您可以使用requestLocationUpdates(...)获取给定间隔中的用户位置。
You can find more Info here 您可以在这里找到更多信息

But honestly you could have find the answer on your own if you googled a bit. 但是说实话,如果您在Google上稍作搜索,便可以自己找到答案。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM