Android: How to make user create geofence for another tracked users?

时光毁灭记忆、已成空白 提交于 2019-12-01 01:16:12

I guess you should add a database and keep track of who created geofence on whom. Also store geofence radius and center point in the database. In order to check if user is inside geofence, calculate distance from user location coordinates and all geofences coordinates and then compare the distance with radius in 5 minutes span. If distance < radius, user is inside else outside. If user is inside set the flag to avoid repeated notifications. If user goes outside reset the flag. I think this should work.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!