public class GeoFence
extends java.lang.Object
implements android.os.Parcelable
从以下版本开始:
8.2.0
限定符和类型 | 字段和说明 |
---|---|
static int |
ADDGEOFENCE_SUCCESS
创建地理围栏成功
|
static java.lang.String |
BUNDLE_KEY_CUSTOMID
地理围栏广播中Bundle的key-业务Id
|
static java.lang.String |
BUNDLE_KEY_FENCE
地理围栏广播中Bundle的key-围栏对象
|
static java.lang.String |
BUNDLE_KEY_FENCEID
地理围栏广播中Bundle的key-围栏Id
|
static java.lang.String |
BUNDLE_KEY_FENCESTATUS
地理围栏广播中Bundle的key-围栏状态
|
static java.lang.String |
BUNDLE_KEY_LOCERRORCODE
地理围栏广播中Bundle的key-定位错误码
|
static android.os.Parcelable.Creator<GeoFence> |
CREATOR |
static int |
ERROR_CODE_EXISTS
错误码: 相同的围栏已经存在,无需重复添加 当地理围栏的customID,半径,
周边点(多边形),中心点坐标(圆形)这几个属性完全一致时,则认为是相同围栏
|
static int |
ERROR_CODE_FAILURE_AUTH
错误码:鉴权失败
|
static int |
ERROR_CODE_FAILURE_CONNECTION
错误码:网络连接异常
|
static int |
ERROR_CODE_FAILURE_PARSER
错误码:解析数据失败(有可能是连接的需要登录的网络但是没有登录)
|
static int |
ERROR_CODE_INVALID_PARAMETER
错误码:参数错误
|
static int |
ERROR_CODE_UNKNOWN
错误码:其他未知错误
|
static int |
ERROR_NO_VALIDFENCE
错误码:无可用地理围栏
|
static int |
INIT_STATUS_IN
围栏创建成功且首次定位成功时围栏和目标之间的初始状态-在围栏内
|
static int |
INIT_STATUS_OUT
围栏创建成功且首次定位成功时围栏和目标之间的初始状态-在围栏外
|
static int |
STATUS_IN
触发侦听行为时围栏状态-进入围栏
|
static int |
STATUS_LOCFAIL
围栏状态-定位失败(定位失败时,围栏状态无法进行检测)
|
static int |
STATUS_OUT
触发侦听行为时围栏状态-进入围栏
|
static int |
STATUS_STAYED
触发侦听行为时围栏状态-在围栏内停留
|
static int |
STATUS_UNKNOWN
围栏状态-状态未知
|
static int |
TYPE_BDMAPPOI
百度POI围栏
|
static int |
TYPE_DISTRICT
百度行政区划围栏
|
static int |
TYPE_POLYGON
自建的多边形围栏
|
static int |
TYPE_ROUND
自建的圆形围栏
|
构造器和说明 |
---|
GeoFence()
构造方法
|
限定符和类型 | 方法和说明 |
---|---|
int |
describeContents() |
java.lang.String |
getActivatesAction()
获取设置的地理围栏触发条件
|
com.baidu.geofence.model.DPoint |
getCenter()
获取围栏中心点坐标(百度POI围栏和圆形围栏能获取到)
|
BDLocation |
getCurrentLocation()
获取当前位置,只有在围栏触发时才有值,其它情况值为null
|
java.lang.String |
getCustomId()
获取自定义的围栏ID(添加围栏时设置)
|
long |
getEndTimeMillis() |
java.lang.String |
getFenceId()
获取地理围栏的ID
|
int |
getInTriggerCount() |
java.lang.String |
getKeyWord()
获取关键字(只有创建围栏时传入keyword才有值)
|
int |
getOutTriggerCount() |
PoiItem |
getPoiItem()
获取围栏内的兴趣点属性 只有围栏类型为:GeoFence.TYPE_BDMAPPOI时才有值
|
java.util.ArrayList<com.baidu.geofence.model.DPoint> |
getPoints()
获取围栏边界的所有坐标点(只有多边形围栏才能获取到)
|
float |
getRadius()
获围栏的半径
|
java.lang.String |
getRegion()
获取地区名称(只有行政区划围栏才有值)
|
long |
getStartTimeMillis() |
int |
getStatus()
获取围栏的状态
|
int |
getStayTime() |
int |
getStayTriggerCount() |
int |
getType()
获取围栏类型
|
boolean |
isAble()
获取围栏是否可用
|
boolean |
isIn() |
boolean |
isOneSecond() |
boolean |
isOut() |
boolean |
isSend() |
void |
setAble(boolean able)
设置围栏是否可用
|
void |
setActivatesAction(java.lang.String activatesAction) |
void |
setCenter(com.baidu.geofence.model.DPoint center) |
void |
setCurrentLoc(BDLocation currentLoc) |
void |
setCustomId(java.lang.String customId) |
void |
setEndTimeMillis(long eTimeMillis) |
void |
setFenceId(java.lang.String fenceId) |
void |
setFenceType(int fenceType) |
void |
setIn(boolean in) |
void |
setInTriggerCount(int inTriggerCount) |
void |
setKeyWord(java.lang.String keyWord) |
void |
setOneSecond(boolean oneSecond) |
void |
setOut(boolean out) |
void |
setOutTriggerCount(int outTriggerCount) |
void |
setPoiItem(PoiItem poiItem) |
void |
setPoints(java.util.ArrayList<com.baidu.geofence.model.DPoint> points) |
void |
setRadius(float radius) |
void |
setRegion(java.lang.String region) |
void |
setSend(boolean send) |
void |
setStartTimeMillis(long sTimeMillis) |
void |
setStatus(int status) |
void |
setStayTime(int stayTime) |
void |
setStayTriggerCount(int stayTriggerCount) |
void |
writeToParcel(android.os.Parcel dest,
int flags) |
public static final java.lang.String BUNDLE_KEY_FENCEID
public static final java.lang.String BUNDLE_KEY_CUSTOMID
public static final java.lang.String BUNDLE_KEY_FENCESTATUS
public static final java.lang.String BUNDLE_KEY_LOCERRORCODE
public static final java.lang.String BUNDLE_KEY_FENCE
public static final int ADDGEOFENCE_SUCCESS
public static final int ERROR_CODE_INVALID_PARAMETER
public static final int ERROR_CODE_FAILURE_CONNECTION
public static final int ERROR_CODE_FAILURE_PARSER
public static final int ERROR_CODE_FAILURE_AUTH
public static final int ERROR_CODE_UNKNOWN
public static final int ERROR_NO_VALIDFENCE
public static final int ERROR_CODE_EXISTS
public static final int STATUS_IN
public static final int STATUS_OUT
public static final int STATUS_STAYED
public static final int INIT_STATUS_IN
public static final int INIT_STATUS_OUT
public static final int STATUS_LOCFAIL
public static final int STATUS_UNKNOWN
public static final int TYPE_ROUND
public static final int TYPE_POLYGON
public static final int TYPE_BDMAPPOI
public static final int TYPE_DISTRICT
public static final android.os.Parcelable.Creator<GeoFence> CREATOR
public void setStayTime(int stayTime)
public int getStayTime()
public boolean isOneSecond()
public void setOneSecond(boolean oneSecond)
public boolean isOut()
public void setOut(boolean out)
public boolean isIn()
public void setIn(boolean in)
public void setEndTimeMillis(long eTimeMillis)
public long getEndTimeMillis()
public void setStartTimeMillis(long sTimeMillis)
public long getStartTimeMillis()
public void setRegion(java.lang.String region)
public java.lang.String getRegion()
public void setKeyWord(java.lang.String keyWord)
public java.lang.String getKeyWord()
public boolean isSend()
public void setSend(boolean send)
public void setPoints(java.util.ArrayList<com.baidu.geofence.model.DPoint> points)
public float getRadius()
public java.util.ArrayList<com.baidu.geofence.model.DPoint> getPoints()
public void setStatus(int status)
public void setActivatesAction(java.lang.String activatesAction)
public void setCurrentLoc(BDLocation currentLoc)
public void setPoiItem(PoiItem poiItem)
public void setFenceType(int fenceType)
public void setRadius(float radius)
public void setFenceId(java.lang.String fenceId)
public void setCenter(com.baidu.geofence.model.DPoint center)
public void setCustomId(java.lang.String customId)
public java.lang.String getFenceId()
public java.lang.String getCustomId()
public int getType()
public PoiItem getPoiItem()
public java.lang.String getActivatesAction()
public int getStatus()
public com.baidu.geofence.model.DPoint getCenter()
public boolean isAble()
public void setAble(boolean able)
public BDLocation getCurrentLocation()
public void setInTriggerCount(int inTriggerCount)
public int getInTriggerCount()
public void setOutTriggerCount(int outTriggerCount)
public int getOutTriggerCount()
public void setStayTriggerCount(int stayTriggerCount)
public int getStayTriggerCount()
public void writeToParcel(android.os.Parcel dest, int flags)
writeToParcel
在接口中 android.os.Parcelable
public int describeContents()
describeContents
在接口中 android.os.Parcelable