Summary: Methods | Inherited Methods | [Expand All]
public final class

# BeaconFence

extends Object

java.lang.Object
↳ | com.google.android.gms.awareness.fence.BeaconFence

## Class Overview

Use this class to create beacon fences.

The fences in this class support detecting nearby beacons that are associated with attachments, which are a triple of namespace, type, and content.

Note: Values that indicate a changing state are momentarily `TRUE` for about 5 seconds, then automatically revert to `FALSE`.

## Summary

Public Methods
static AwarenessFence | found(Collection<BeaconState.TypeFilter> beaconTypes) This fence is momentarily `TRUE` (about 5 seconds) when a beacon with the specified types is found.
static AwarenessFence | found(TypeFilter... beaconTypes) This fence is momentarily `TRUE` (about 5 seconds) when a beacon with the specified types is found.
static AwarenessFence | lost(TypeFilter... beaconTypes) This fence is momentarily `TRUE` (about 5 seconds) when a beacon with the specified types is lost.
static AwarenessFence | lost(Collection<BeaconState.TypeFilter> beaconTypes) This fence is momentarily `TRUE` (about 5 seconds) when a beacon with the specified types is lost.
static AwarenessFence | near(TypeFilter... beaconTypes) This fence evaluates to `TRUE` if any of the specified types is found but not lost.
static AwarenessFence | near(Collection<BeaconState.TypeFilter> beaconTypes) This fence evaluates to `TRUE` if any of the specified types is found but not lost.

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()

## Public Methods

#### public static AwarenessFence found (Collection<BeaconState.TypeFilter> beaconTypes)

This fence is momentarily `TRUE` (about 5 seconds) when a beacon with the specified types is found.

To use this API, your app must declare the `android.permission.ACCESS_FINE_LOCATION` permission in AndroidManifest.xml, and the user must provide consent at runtime.

##### Parameters

beaconTypes | Collection of beacon types to scan for.

##### Returns

- `AwarenessFence`

#### public static AwarenessFence found (TypeFilter... beaconTypes)

This fence is momentarily `TRUE` (about 5 seconds) when a beacon with the specified types is found.

To use this API, your app must declare the `android.permission.ACCESS_FINE_LOCATION` permission in AndroidManifest.xml, and the user must provide consent at runtime.

##### Parameters

beaconTypes | `BeaconState.TypeFilter` listing beacon types to scan for.

##### Returns

- `AwarenessFence`

#### public static AwarenessFence lost (TypeFilter... beaconTypes)

This fence is momentarily `TRUE` (about 5 seconds) when a beacon with the specified types is lost.

To use this API, your app must declare the `android.permission.ACCESS_FINE_LOCATION` permission in AndroidManifest.xml, and the user must provide consent at runtime.

##### Parameters

beaconTypes | `BeaconState.TypeFilter` listing beacon types.

##### Returns

- `AwarenessFence`

#### public static AwarenessFence lost (Collection<BeaconState.TypeFilter> beaconTypes)

This fence is momentarily `TRUE` (about 5 seconds) when a beacon with the specified types is lost.

To use this API, your app must declare the `android.permission.ACCESS_FINE_LOCATION` permission in AndroidManifest.xml, and the user must provide consent at runtime.

##### Parameters

beaconTypes | Collection of beaconTypes to scan for.

##### Returns

- `AwarenessFence`

#### public static AwarenessFence near (TypeFilter... beaconTypes)

This fence evaluates to `TRUE` if any of the specified types is found but not lost.

To use this API, your app must declare the `android.permission.ACCESS_FINE_LOCATION` permission in AndroidManifest.xml, and the user must provide consent at runtime.

##### Parameters

beaconTypes | `BeaconState.TypeFilter` listing beacon types.

##### Returns

- `AwarenessFence`

#### public static AwarenessFence near (Collection<BeaconState.TypeFilter> beaconTypes)

This fence evaluates to `TRUE` if any of the specified types is found but not lost.

To use this API, your app must declare the `android.permission.ACCESS_FINE_LOCATION` permission in AndroidManifest.xml, and the user must provide consent at runtime.

##### Parameters

beaconTypes | `BeaconState.TypeFilter` listing beacon types.

##### Returns

- `AwarenessFence`