Android Google Geofencing transition jumps even device is not moving

a 夏天 提交于 2019-12-06 11:26:05

问题


I have developed a Geofencing App, which is working mostly proper. But I have also users saying me, that the app is reporting repeatable entering and exiting of the zone even the device is not moving!

The app uses the latest Google Geofencing API with the transition types GEOFENCE_TRANSITION_ENTER and GEOFENCE_TRANSITION_EXIT with expiration NEVER_EXPIRE and ACCESS_FINE_LOCATION on. The users configured also a large radius with 2000 meters with no success. The locations are set to high accuracy.

But the transitions is jumping from exit to enter, even the device is on the table in the house and not moving.

How can I improve this in the app?


回答1:


Google geofences mainly use network points, which rely on wifi and cell towers, and are prone to varying levels of accuracy. This causes a lot of location point "jumps" that the geofence registers as enter and exit events. One way to prevent this, is to make a gps call on a transition event, to verify that the user did indeed leave. If the user left, send the notification, if not, reset the geofence with INITIAL_TRIGGER_EXIT set in GeofencingRequest.



来源:https://stackoverflow.com/questions/34617007/android-google-geofencing-transition-jumps-even-device-is-not-moving

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