android, check gps position if near/close to certa

2019-08-03 03:42发布

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

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?

标签: java android gps
1条回答
Juvenile、少年°
2楼-- · 2019-08-03 04:15

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.

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

Here is one example to get the idea.

查看更多
登录 后发表回答