tharinduPro
tharinduPro

Reputation: 109

How to define Rectangle of Geofence in android

Currently I define Geofence using following method.

Geofence geofence = new Geofence.Builder()
                    .setRequestId("GEOFENCE")
                    .setCircularRegion(latitude, longitude, radius)
                    .setExpirationDuration(Geofence.NEVER_EXPIRE)
                    .setTransitionTypes(Geofence.GEOFENCE_TRANSITION_ENTER | Geofence.GEOFENCE_TRANSITION_EXIT)
                    .build();

And Now I need to know how to define a room of area as a Geofence to Detect enter and leaving the room. Is this possible?

Upvotes: 0

Views: 946

Answers (1)

Mark Sheekey
Mark Sheekey

Reputation: 618

I dont think you can specify a rectangular geofence (radio waves are circular after all). You could geofence the door (very small fence, not sure if you could make it that small and be accurate) then detect people going through the door.

Upvotes: 1

Related Questions