我正在学习如何在android上使用Geofence
,我的问题是:如果我有一个实时数据库的地点列表(lat和long),我将不得不创建一个新对象每次列出新内容时Geofence
的内容?像这样:
Geofence geofence = new Geofence.Builder()
.setRequestId(GEOFENCE_REQ_ID) // Geofence ID
.setCircularRegion( LATITUDE, LONGITUDE, RADIUS) // defining fence region
.setExpirationDuration( DURANTION ) // expiring date
// Transition types that it should look for
.setTransitionTypes( Geofence.GEOFENCE_TRANSITION_ENTER | Geofence.GEOFENCE_TRANSITION_EXIT )
.build();
这里setCircularRegion( LATITUDE, LONGITUDE, RADIUS)
会通过这些地点吗?以及如何处理哪一个? https://developer.android.com/training/location/geofencing.html