Hi my friend,
I mostly following Estimote’s SDK sample code to use ProximityObserver to detect Beacon’s entering and existing event.
RequirementsWizardFactory.createEstimoteRequirementsWizardForAndroidThings() is properly returning “requirement fulfilled!”
Please see the code sample as below. Would be much appreciated to give me some hints.
Regards,
Lei
ProximityZone zone1 =
mProximityObserver.zoneBuilder()
.forAttachmentKeyAndValue("location", "medicalcenter")
.inNearRange()
.withOnEnterAction(new Function1<ProximityAttachment, Unit>() {
@Override public Unit invoke(ProximityAttachment proximityAttachment) {
String doctorID = proximityAttachment.getPayload().get("doctorid");
return null;
}
})
.withOnExitAction(new Function1<ProximityAttachment, Unit>() {
@Override
public Unit invoke(ProximityAttachment proximityAttachment) {
/* Do something here */
return null;
}
})
.withOnChangeAction(new Function1<List<? extends ProximityAttachment>, Unit>() {
@Override
public Unit invoke(List<? extends ProximityAttachment> proximityAttachments) {
/* Do something here */
return null;
}
})
.create();