public class RECOBeaconManager
extends java.lang.Object
RECOBeacon-related events.
RECOBeaconManager 클래스는 RECOBeacon과 관련된 이벤트를 다루는 인터페이스를 제공합니다.
사용자는 이 클래스의 인스턴스로부터 region monitoring과 region ranging과 관련된 메소드를 사용합니다.
RECOBeaconManager 클래스는 아래와 같은 기능을 지원합니다.
| Modifier and Type | Method and Description |
|---|---|
void |
bind(RECOServiceConnectListener serviceConnectListener)
Connect the instance of the RECOBeaconManager to
RECOBeaconService When the connection to RECOBeaconService is established, onServiceConnect() is called. |
static RECOBeaconManager |
getInstance(android.content.Context context)
Create an instance of the RECOBeaconManager given Context.
|
java.util.ArrayList<RECOBeaconRegion> |
getMonitoredRegions()
The list of shared regions monitored by all RECOBeaconManager instances.
|
java.util.ArrayList<RECOBeaconRegion> |
getRangedRegions()
The list of shared regions ranged by all RECOBeaconManager instances.
|
boolean |
isBound()
Method to check whether the connection between RECOBeaconManager and
RECOBeaconService is established or not. |
boolean |
isMonitoringAvailable()
Return whether the device supports region monitoring or not.
|
boolean |
isRangingAvailable()
Return whether the device supports region ranging or not.
|
void |
requestStateForRegion(RECOBeaconRegion region)
request state for given region.
|
boolean |
setBluetoothOn()
Turn on bluetooth of the device.
|
void |
setMonitoringListener(RECOMonitoringListener monitoringListener)
Set
RECOMonitoringListener interface that received callback methods when monitoring. |
void |
setRangingListener(RECORangingListener rangingListener)
Set
RECORangingListener interface that received callback methods when ranging. |
void |
setScanPeriod(long scanPeriod)
Set how long the device scans BLE(Bluetooth Low Energy) devices, measured in milliseconds.
|
void |
setSleepPeriod(long sleepPeriod)
Set the time lag between scanning, measured in milliseconds.
|
void |
startMonitoringForRegion(RECOBeaconRegion region)
Start monitoring given region.
|
void |
startRangingBeaconsInRegion(RECOBeaconRegion region)
Start ranging given region.
|
void |
stopMonitoringForRegion(RECOBeaconRegion region)
Stop monitoring given region.
|
void |
stopRangingBeaconsInRegion(RECOBeaconRegion region)
Stop ranging given region.
|
void |
unbind()
Unbind
RECOBeaconService from the instance of RECOBeaconManager. |
java.lang.String |
version()
RECO SDK version.
|
public static RECOBeaconManager getInstance(android.content.Context context)
Context를 입력 받아 RECOBeaconManager 인스턴스를 생성.
context - Application Context context - 어플리케이션 ContextRECOBeaconManager의 인스턴스
public boolean setBluetoothOn()
throws android.os.RemoteException
이 기기의 Bluetooth를 켬.
이 기기의 bluetooth가 켜져있지 않을 경우, bluetooth를 켜도록 요청합니다.
true - bluetooth가 이미 켜져있거나 켜도록 요청을 보낸 후 리턴합니다.
android.os.RemoteExceptionpublic void bind(RECOServiceConnectListener serviceConnectListener)
RECOBeaconService RECOBeaconService is established, onServiceConnect() is called.
RECOBeaconManager 인스턴스를 RECOBeaconService와 연결.
RECOBeaconService와 연결이 되었을 경우, RECOServiceConnectListener의 onServiceConnect() callback 함수를 호출합니다.
serviceConnectListener - RECOServiceConnectListenerpublic void unbind()
throws android.os.RemoteException
RECOBeaconService from the instance of RECOBeaconManager.
RECOBeaconManager 인스턴스와 RECOBeaconService의 연결 해제.
연결 해제시, region monitoring과 region ranging은 동작하지 않습니다.
android.os.RemoteExceptionpublic boolean isBound()
RECOBeaconService is established or not.
RECOBeaconManager 인스턴스와 RECOBeaconService가 연결되어 있는지 알려주는 메소드.
public boolean isMonitoringAvailable()
이 기기가 region monitoring을 지원하는지에 대한 boolean 값을 리턴.
region monitoring이 가능하면 true, 그렇지 않으면 false.
public boolean isRangingAvailable()
이 기기가 region ranging을 지원하는지에 대한 boolean 값을 리턴.
region ranging이 가능하면 true, 그렇지 않으면 false.
public void startMonitoringForRegion(RECOBeaconRegion region) throws android.os.RemoteException, java.lang.NullPointerException
getMonitoredRegions() method. didEnterRegion() or didExitRegion() is called.
해당 region에 대한 monitoring을 시작.
Monitoring 하고자 하는 모든 region에 대해 이 메소드를 호출해야 합니다. 같은 identifier를 가지는 region이 이미 monitoring 중일 때에는 기존의 region이 신규 region과 교체됩니다.
이 메소드를 이용해 등록한 region은 어플리케이션 내의 모든 RECOBeaconManager 객체들이 공유하게 되며 현재 monitoring 중인 region들은 getMonitoredRegions() 메소드를 이용해 접근할 수 있습니다.
등록된 각각의 region에 들어가거나 나올 경우 didEnterRegion() 메소드와 didExitRegion() 메소드를 통해 전달됩니다.
하나의 어플리케이션은 한 번에 최대 20개까지의 region을 등록하기를 권장합니다.
20개보다 많아질 경우, monitoring이 정상적으로 작동하지 않을 수 있습니다.
region - RECOBeaconRegion object to start region monitoring. It must not be null. region - Monitoring을 시작할 RECOBeaconRegion 객체. null이 될 수 없습니다.android.os.RemoteExceptionjava.lang.NullPointerExceptionpublic void stopMonitoringForRegion(RECOBeaconRegion region) throws android.os.RemoteException, java.lang.NullPointerException
해당 region에 대한 monitoring을 중지.
해당 region에 대한 monitoring을 멈춥니다.
region - RECOBeaconRegion object to stop monitoring. It must not be null.region - Monitoring을 중지할 RECOBeaconRegion 객체. 본 객체는 null이 될 수 없습니다. android.os.RemoteExceptionjava.lang.NullPointerExceptionpublic void startRangingBeaconsInRegion(RECOBeaconRegion region) throws android.os.RemoteException, java.lang.NullPointerException
getRangedRegions() method. didRangedBeaconsInRegion() is called for all ranged beacons.
해당 region에 대한 ranging을 시작.
Ranging을 하고하 자는 모든 region에 대해 이 메소드를 호출해야 합니다. 같은 identifier를 가지는 region이 이미 ranging 중일 때에는 기존의 region이 신규 region과 교체 됩니다.
이 메소드를 이용해 등록한 region은 어플리케이션 내의 모든 RECOBeaconManager 객체들이 공유하게 되며 현재 ranging 중인 region들은 getRangedRegions() 메소드를 이용해 접근할 수 있습니다.
등록된 각각의 region에 대해서, 발견하는 모든 beacon에 대해 didRangedBeaconsInRegion() 메소드를 통해 전달됩니다.
region - RECOBeaconRegion object to start ranging. It must not be null.region - Ranging을 시작할 RECOBeaconRegion 객체. 본 객체는 null이 될 수 없습니다. android.os.RemoteExceptionjava.lang.NullPointerExceptionpublic void stopRangingBeaconsInRegion(RECOBeaconRegion region) throws android.os.RemoteException, java.lang.NullPointerException
해당 region에 대한 ranging을 중지.
해당 region에 대한 ranging을 멈춥니다.
region - RECOBeaconRegion object to stop ranging. It must not be null.region - Ranging을 중지할 RECOBeaconRegion 객체. 본 객체는 null이 될 수 없습니다. android.os.RemoteExceptionjava.lang.NullPointerExceptionpublic void requestStateForRegion(RECOBeaconRegion region) throws android.os.RemoteException, java.lang.NullPointerException
didDetermineStateForRegion method.
해당 region의 상태 요청.
해당 region의 상태를 비동기적으로 가져옵니다.
이 메소드를 통한 요청은 비동기식으로 처리되며, 그 결과는 didDetermineStateForRegion 메소드를 통해 전달됩니다.
region - RECOBeaconRegion object whose state you want to know. It must not be null.region - 상태를 알고자 하는 RECOBeaconRegion 객체. 본 객체는 null이 될 수 없습니다. android.os.RemoteExceptionjava.lang.NullPointerExceptionpublic java.util.ArrayList<RECOBeaconRegion> getMonitoredRegions()
startMonitoringForRegion method.
모든 RECOBeaconManager 객체에 의해 공유되고 monitoring 되고 있는 region의 리스트.
Monitoring 할 region을 추가하기 위해서는 startMonitoringForRegion 메소드를 통해 추가해야 합니다.
RECOBeaconRegion objects.
현재 monitoring 되고 있는 RECOBeaconRegion 객체들의 리스트.
public java.util.ArrayList<RECOBeaconRegion> getRangedRegions()
startRangingBeaconsInRegion method.
모든 RECOBeaconManager 객체에 의해 공유되고 ranging 되고 있는 region의 리스트.
Ranging 할 region을 추가하기 위해서는 startRangingBeaconsInRegion 메소드를 통해 추가해야 합니다.
RECOBeaconRegion objects.
현재 ranging 되고 있는 RECOBeaconRegion 객체들의 리스트.
public void setMonitoringListener(RECOMonitoringListener monitoringListener)
RECOMonitoringListener interface that received callback methods when monitoring.
Monitoring과 관련된 callback 메소드를 전달받을 RECOMonitoringListener 인터페이스 설정.
monitoringListener - RECOMonitoringListener monitoringListener - 결과를 전달 받을 RECOMonitoringListenerpublic void setRangingListener(RECORangingListener rangingListener)
RECORangingListener interface that received callback methods when ranging.
Ranging과 관련된 callback 메소드를 전달받을 RECORangingListener 인터페이스 설정.
rangingListener - RECORangingListener rangingListener - 결과를 전달 받을 RECORangingListenerpublic void setScanPeriod(long scanPeriod)
기기가 BLE(Bluetooth Low Energy) 장치들을 스캔할 시간 설정. (단위: 밀리세컨드 millisecond)
scanPeriod - scan period, measured in milliseconds scanPeriod - long 형태의 스캔할 시간 (단위: 밀리세컨드 millisecond)public void setSleepPeriod(long sleepPeriod)
기기가 BLE 장치들을 스캔한 후, 다음 스캔 시작까지 걸리는 시간 설정. (단위: 밀리세컨드 millisecond)
sleepPeriod - time lag, measured in milliseconds. sleepPeriod - long 형태의 다음 스캔 시작까지 멈출 시간 (단위: 밀리세컨드 millisecond)public java.lang.String version()