android,检查gps位置是否接近/接近特定位置 [英] android, check gps position if near/close to certain position

查看:100
本文介绍了android,检查gps位置是否接近/接近特定位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有带gps位置(纬度和经度)的sqlite数据库/表.

I've got sqlite database/table with gps locations (latitude and longitude).

现在,我需要gps每隔几秒钟检查一次,如果我在附近,那么要接近数据库中的某个位置.

Now I need the gps to check every few seconds if I'm near, so close to one of the positions within my database.

什么是最好/最简单的方法?任何人都可以给出一些指导方针,或者可以举一个例子/示例来说明如何做到这一点吗?

what would be the best/easiest way to do this? Can anyone give some guildlines or maybe an example/turturial on how to do this?

推荐答案

使用

Using the Location Managers Proximity Alerts would be your best bet, you can set an alert for each location in your table and then catch the intent when they are fired.

与在某些时间间隔内手动击打gps相比,这些电池的电池使用效率更高.

These are much more battery efficient than manually hitting gps on some interval.

此处是获得此想法的一个示例.

Here is one example to get the idea.

这篇关于android,检查gps位置是否接近/接近特定位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆