EstimoteSDK-Android 文档翻译

Package com.estimote.sdk

Interface Summary

接口概要

BeaconManager.ErrorListener

Callback to be invoked when any error happened while performing low energy scanning.

当进行低功耗浏览发生任何错误会被触发的回调

BeaconManager.MonitoringListener

Callback to be invoked when beacons are discovered in a region.

beacons在一个区域被发现时被触发的回调

BeaconManager.RangingListener

Callback to be invoked when beacons are ranged.

beacons被测距时触发的回调

BeaconManager.ServiceReadyCallback

Callback to inform client when service is ready to use.

当服务准备好时通知客户端的回调函数

Utils.RestartCompletedListener

Interface used to notify called that Bluetooth stack has been restarted.

当蓝牙栈已经被重启时用来通知的所调用的接口

 

Class Summary

类概要

Beacon

Immutable representations of single beacon.

不变的单个beacon的呈现

BeaconManager

This is a class that clients should use to interact with iBeacons.

这是一个客户端应该用来和iBeacons交互的类

Region

Defines a region based on device's proximity to a beacon.

定义一个基于beacon设备精度的区域

Utils

Grab bag of utilities.

混杂的实用工具

 


 

 

Enum Summary

枚举概要

Region.State

Describes current location relationship with region bounds.

描述当前位置和区域边界的关联

Utils.Proximity

Defines distance relationship between beacon and the device.

定义beacon和设备的距离关系

Package com.estimote.sdk.connection

Interface Summary

BeaconConnection.ConnectionCallback

Callback used to indicate state of the connection to the beacon.

用来指向beacon连接状态的回调函数

BeaconConnection.WriteCallback

Callback used to indicate status of updating beacon characteristic.

用来指向更新beacon特征的回调函数

 

Class Summary

BeaconConnection

Establishes connection to the beacon and reads its characteristics.

建立和beacon的连接并且读取它的特征

BeaconConnection.BeaconCharacteristics

Value object for beacon's characteristics (battery level, broadcasting power, advertising interval, software and hardware version).

包含Beacon特征值的对象(电池等级,广播能量,广告间隔,软件和硬件版本)

 


 

Package com.estimote.sdk.service

SDK classes for Androidservice that is responsible for interacting with beacons.

Android 服务的SDK类需要负责和beacons交互。

See: 
          
Description

Class Summary

BeaconService

Don't use this class directly, use it via BeaconManager.

不要直接用这个类,应该通过BeaconManager使用它。

MonitoringResult

Data object for results from Monitoring.

监测结果的数据对象

RangingResult

Data object for results from ranging.

测距结果的数据对象

ScanPeriodData

Data object containing values for setting scan periods.

包含设置扫描周期的数据对象

 

Package com.estimote.sdk.service Description

SDK classes for Android service that isresponsible for interacting with beacons.

Do not use those classes directly.Use BeaconManager instead.

In your AndroidManifest.xml declare service:

在你的 AndroidManifest.xml声明服务:

 <serviceandroid:name="com.estimote.sdk.service.BeaconService"

          android:exported="false"/>

 

and add neededBluetooth permissions:

并且添加需要的蓝牙许可:

 <uses-permissionandroid:name="android.permission.BLUETOOTH"/>

 <uses-permissionandroid:name="android.permission.BLUETOOTH_ADMIN"/>

Package com.estimote.sdk.utils

Class Summary

L

L stands for logging.

L可以替代日志

 

 

com.estimote.sdk 
Class Beacon

java.lang.Object
  com.estimote.sdk.Beacon

All Implemented Interfaces:

Parcelable


public class Beacon
extends Object
implements Parcelable

Immutable representations of single beacon.

单个beacon不变的呈现形式

Two beacons are considered equal if their proximity UUID, majorand minor are equal.

假如两个beaconUUIDmajorminor相同的话,它们被认为是等同的。

This mimics CLBeacon fromiOS.

这个模仿IOSCLBeacon


Nested Class Summary

嵌套类概述

 

Nested classes/interfaces inherited from interface android.os.Parcelable

嵌套的类继承自android.os.Parcelable

Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>

 

Field Summary

字段概要

static Parcelable.Creator<Beacon>

CREATOR 
           

 

Fields inherited from interface android.os.Parcelable

CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE

 

Constructor Summary

构造函数概要

Beacon(String proximityUUID, String name, String macAddress, int major, int minor, int measuredPower, int rssi) 
           

 

Method Summary

 int

describeContents() 
           

 boolean

equals(Object o) 
           

 String

getMacAddress() 
           

 int

getMajor() 
           

 int

getMeasuredPower() 
           

 int

getMinor() 
           

 String

getName() 
           

 String

getProximityUUID() 
           

 int

getRssi() 
           

 int

hashCode() 
           

 String

toString() 
           

 void

writeToParcel(Parcel dest, int flags) 
           

 

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait

 

Field Detail

CREATOR

public static final Parcelable.Creator<Beacon> CREATOR

Constructor Detail

Beacon

public Beacon(String proximityUUID,
              String name,
              String macAddress,
              int major,
              int minor,
              int measuredPower,
              int rssi)

Method Detail

getProximityUUID

public String getProximityUUID()

Returns:

ProximityUUID of the beacon in format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX (alllowercases).

返回:

XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX(全部小写)BeaconUUID


getName

public String getName()

Returns:

Devicefriendly name (this name is advertised by the beacon).

返回:

设备友好的名字(这个名字被beacon广告)


getMacAddress

public String getMacAddress()

Returns:

MACaddress of the beacon.

返回:

BeaconMAC地址


getMajor

public int getMajor()

Returns:

Majorversion of the beacon.

返回:

Beacon的主要版本


getMinor

public int getMinor()

Returns:

Minorversion of the beacon.

返回:

Beacon的次要版本


getMeasuredPower

public int getMeasuredPower()

Returns:

Measuredpower of the beacon (in dBm).

返回:

Beacon的实测功率(dBM


getRssi

public int getRssi()

Returns:

ReceivedSignal Strength Indication at the moment of scanning.

返回:

在扫描时刻接收到的型号强度。

 


toString

public String toString()

Overrides:

toString inclass Object


equals

public boolean equals(Object o)

Overrides:

equals inclass Object


hashCode

public int hashCode()

Overrides:

hashCode inclass Object


describeContents

public int describeContents()

Specifiedby:

describeContents ininterface Parcelable


writeToParcel

public void writeToParcel(Parcel dest,
                          int flags)

Specifiedby:

writeToParcel ininterface Parcelable

com.estimote.sdk 
Class BeaconManager

java.lang.Object
  com.estimote.sdk.BeaconManager

public class BeaconManager
extends Object

This is a class that clients should use to interact withiBeacons. All name conventions come from iOS and Estimote iOS library. Itallows to:

这是一个客户端应该用来和iBeacons交互的类。所有命名约束来自IOSEstimoteIOS库。他允许:

  • range beacons (scan beacons and optionally filter them by their values)
  • 测距beacons(扫描beacons并且根据它们的值可选地过滤)
  • monitor beacons (track beacons in order to get events that device has entered or leaved regions of interest)
  • 监测beacons(为了得到设备进入或离开特定区域的事件而跟踪beacons)

Typical use for ranging:

   private static final String ESTIMOTE_PROXIMITY_UUID = "B9407F30-F5F8-466E-AFF9-25556B57FE6D";
   private static final Region ALL_ESTIMOTE_BEACONS = new Region("rid", ESTIMOTE_PROXIMITY_UUID, null, null)
 
   BeaconManager beaconManager = new BeaconManager(context);
   beaconManager.setRangingListener(new BeaconManager.RangingListener() {
     @Override public void onBeaconsDiscovered(Region region, final List beacons) {
       Log.d(TAG, "Ranged beacons: " + beacons);
     }
   });
   beaconManager.connect(new BeaconManager.ServiceReadyCallback() {
     @Override public void onServiceReady() {
       try {
         beaconManager.startRanging(ALL_ESTIMOTE_BEACONS);
       } catch (RemoteException e) {
         Log.e(TAG, "Cannot start ranging", e);
       }
     }
   });
 
   // When no longer needed. Note that ranging will stop.
   beaconManager.disconnect();

It is a good practice to have only one instance of BeaconManager perapplication stored in your Applicationsubclass.

最好在你的应用子类中只有一个BeaconManager实例。

This is wrapper around BeaconService thatclients should use as implementation details of service can be changed in time.

它是一个BaconService的包装材料,服务的实现细节改变时,客户应该及时用。

Some methods throw RemoteException.This can happen if service call happened and hosting process no longer exists(only if service is remote process).

有些方法会抛RemoteException错误。当服务呼叫发生并且当前进程不再存在时可能发生(仅当服务室远程进程时)


Nested Class Summary

static interface

BeaconManager.ErrorListener 
          Callback to be invoked when any error happened while performing low energy scanning.

当电量低并且发生错误时触发的回调函数。

static interface

BeaconManager.MonitoringListener 
          Callback to be invoked when beacons are discovered in a region.

beacons被发现在一个区域中时调用

static interface

BeaconManager.RangingListener 
          Callback to be invoked when beacons are ranged.

beacons被测距时被调用

static interface

BeaconManager.ServiceReadyCallback 
          Callback to inform client when service is ready to use.

当服务准备用时被调用来通知客户

 

Constructor Summary

BeaconManager(Context context) 
          Constructs 
BeaconManager instance.

 

Method Summary

 boolean

checkPermissionsAndService() 
          Checks if required Bluetooth permissions are set (android.permission.BLUETOOTH and android.permission.BLUETOOTH_ADMIN) along with 
BeaconService in AndroidManifest.xml.

检查蓝牙权限和BeaconService是否在AndroidMainfest.XML中给出

 void

connect(BeaconManager.ServiceReadyCallback callback) 
          Connects to 
BeaconService.

连接到BeaconService

 void

disconnect() 
          Disconnects from 
BeaconService.

BeaconService中断开

 boolean

hasBluetooth() 
          Returns true if device supports Bluetooth Low Energy.

假如设备支持BLE的话返回true

 boolean

isBluetoothEnabled() 
          Returns true if Bluetooth is enabled on the device.

假如设备打开蓝牙返回true

 void

setBackgroundScanPeriod(long scanPeriodMillis, long waitTimeMillis) 
          Changes defaults scanning periods when monitoring is performed.

改变监测进行时默认的扫描周期

 void

setErrorListener(BeaconManager.ErrorListener listener) 
          Sets new error listener.

设置新的错误监听

 void

setForegroundScanPeriod(long scanPeriodMillis, long waitTimeMillis) 
          Changes defaults scanning periods when ranging is performed.

改变测距进行时默认的扫描周期

 void

setMonitoringListener(BeaconManager.MonitoringListener listener) 
          Sets new monitoring listener.

设置新的监视监听者。

 void

setRangingListener(BeaconManager.RangingListener listener) 
          Sets new ranging listener.

设置新的测距监听者。

 void

startMonitoring(Region region) 
           

 void

startRanging(Region region) 
          Starts ranging given range.

开始对给出的区域进行测距修正

 void

stopMonitoring(Region region) 
           

 void

stopRanging(Region region) 
           

 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

BeaconManager

public BeaconManager(Context context)

Constructs BeaconManager instance.It's good practice to have only one per application stored in yourApplication subclass.

Parameters:

context -Context to wire up BeaconManager.

Method Detail

hasBluetooth

public boolean hasBluetooth()

Returnstrue if device supports Bluetooth Low Energy.


isBluetoothEnabled

public boolean isBluetoothEnabled()

Returnstrue if Bluetooth is enabled on the device. If not, you should ask user toenable it via:

   Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
   startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);

checkPermissionsAndService

public boolean checkPermissionsAndService()

Checksif required Bluetooth permissions are set (android.permission.BLUETOOTH andandroid.permission.BLUETOOTH_ADMIN) along with BeaconService inAndroidManifest.xml.

Returns:

True ifpermissions and service is declared in AndroidManifest.xml.


connect

public void connect(BeaconManager.ServiceReadyCallback callback)

Connectsto BeaconService.

Parameters:

callback -Callback to be invoked when connection is made to service.


disconnect

public void disconnect()

Disconnectsfrom BeaconService.If there were any ranging or monitoring in progress, they will be stopped. Thisshould be typically called in onDestroy method.

BeaconService中断开。假如它们在进程中测距或监听,它们会被停止。一般会调用onDestroy函数。


setRangingListener

public void setRangingListener(BeaconManager.RangingListener listener)

Sets newranging listener. Old one will be discarded.旧的会被忽略

Parameters:

listener - Newlistener.


setMonitoringListener

public void setMonitoringListener(BeaconManager.MonitoringListener listener)

Sets newmonitoring listener. Old one will be discarded.

Parameters:

listener - Newlistener.


setErrorListener

public void setErrorListener(BeaconManager.ErrorListener listener)

Sets newerror listener. Old one will be discarded.

Parameters:

listener - Newerror listener.


setForegroundScanPeriod

public void setForegroundScanPeriod(long scanPeriodMillis,
                                    long waitTimeMillis)

Changesdefaults scanning periods when ranging is performed. Default values:scanPeriod=1s, waitTime=0s

默认值为:scanPerid=1swaitTime=0s

Parameters:

scanPeriodMillis - Howlong to perform Bluetooth Low Energy scanning?

ScanPeridMillis-多久进行一次BLE扫描

waitTimeMillis - Howlong to wait until performing next scanning?

WaitTimeMillis-当下一次扫描前等待多久


setBackgroundScanPeriod

public void setBackgroundScanPeriod(long scanPeriodMillis,
                                    long waitTimeMillis)

Changesdefaults scanning periods when monitoring is performed. Default values:scanPeriod=5s, waitTime=25s

Parameters:

scanPeriodMillis - Howlong to perform Bluetooth Low Energy scanning?

waitTimeMillis - Howlong to wait until performing next scanning?


startRanging

public void startRanging(Region region)
                  throws RemoteException

Startsranging given range. Ranging results will be delivered to listener registeredviasetRangingListener(RangingListener).If given region is already ranged, this is no-op.

开始对给出的区域进行测距。测距结果会传递给通过setRandingListenerRangingListener)注册的接口。假如给定的区域已经被测距了,这会是空操作。

Parameters:

region - Regionto range.

Throws:

RemoteException - Ifcommunication with service failed.


stopRanging

public void stopRanging(Region region)
                 throws RemoteException

Throws:

RemoteException


startMonitoring

public void startMonitoring(Region region)
                     throws RemoteException

Throws:

RemoteException


stopMonitoring

public void stopMonitoring(Region region)
                    throws RemoteException

Throws:

RemoteException

com.estimote.sdk 
Interface BeaconManager.ErrorListener

Enclosing class:

BeaconManager


public static interface BeaconManager.ErrorListener

Callback to be invoked when any error happened while performinglow energy scanning.


Method Summary

 void

onError(Integer errorId) 
          Error identifiers are defined in 
BeaconService class with ERROR_ prefix.

BeaconService类中以ERROR_前缀定义的错误标识。

 

Method Detail

onError

void onError(Integer errorId)

Erroridentifiers are defined in BeaconService class with ERROR_ prefix.

com.estimote.sdk 
Interface BeaconManager.MonitoringListener

Enclosing class:

BeaconManager


public static interface BeaconManager.MonitoringListener

Callback to be invoked when beacons are discovered in a region.


Method Summary

 void

onEnteredRegion(Region region, List<Beacon> beacons) 
           

 void

onExitedRegion(Region region) 
           

 

Method Detail

onEnteredRegion

void onEnteredRegion(Region region,
                     List<Beacon> beacons)

Parameters:

region - Regionthat was monitored.

被监测的区域

beacons - Listof beacons that triggered onEnteredRegion event. This list may not reflect allbeacons around that are matching given region.

触发onEnteredRegion事件的beacons列表。这个列表可能不会反应所有的在匹配区域中的beacons


onExitedRegion

void onExitedRegion(Region region)

com.estimote.sdk 
Interface BeaconManager.RangingListener

Enclosing class:

BeaconManager


public static interface BeaconManager.RangingListener

Callback to be invoked when beacons are ranged.


Method Summary

 void

onBeaconsDiscovered(Region region, List<Beacon> beacons) 
          Tells listener what beacons are currently in range.

告诉监听者beacons当前在范围中。

 

Method Detail

onBeaconsDiscovered

void onBeaconsDiscovered(Region region,
                         List<Beacon> beacons)

Tellslistener what beacons are currently in range. The list of beacons can be empty.List of beacons is sorted by accuracy.

Beacons的列表可能是空的。Beacons的列表以精确度排序。

Parameters:

region - Regionthat was used for ranging.

beacons - Listof beacons sorted by accuracy.

com.estimote.sdk 
Interface BeaconManager.ServiceReadyCallback

Enclosing class:

BeaconManager


public static interface BeaconManager.ServiceReadyCallback

Callback to inform client when service is ready to use.


Method Summary

 void

onServiceReady() 
           

 

Method Detail

onServiceReady

void onServiceReady()

com.estimote.sdk 
Class Region

java.lang.Object
  com.estimote.sdk.Region

All Implemented Interfaces:

Parcelable


public class Region
extends Object
implements Parcelable

Defines a region based on device's proximity to a beacon. Regionis defined by proximity UUID, major and minor numbers of targeting beacons. Allof those can be nulls which means wildcard on that field.

定义一个基于设备和一个beacon相邻距离的区域。区域以UUIDmajorminor匹配多个目标beacons定义。所有都可以为空,这意味着匹配所有的地点。

Region's identifier is introduced similarly to CLBeaconRegion'sidentifier to uniquely identify region. You can use this identifier in the appto differentiate regions.

区域的标识和CLBeaconRegion的标识符相似,用来唯一的识别区域。你可以在app中用这个标识去区别区域。

This mimics CLBeaconRegion fromiOS.


Nested Class Summary

static class

Region.State 
          Describes current location relationship with region bounds.

描述当前位置和区域边界的关系。

 

Nested classes/interfaces inherited from interface android.os.Parcelable

Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>

 

Field Summary

static Parcelable.Creator<Region>

CREATOR 
           

 

Fields inherited from interface android.os.Parcelable

CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE

 

Constructor Summary

Region(String identifier, String proximityUUID, Integer major, Integer minor) 
           

 

Method Summary

 int

describeContents() 
           

 boolean

equals(Object o) 
           

 String

getIdentifier() 
           

 Integer

getMajor() 
           

 Integer

getMinor() 
           

 String

getProximityUUID() 
           

 int

hashCode() 
           

 String

toString() 
           

 void

writeToParcel(Parcel dest, int flags) 
           

 

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait

 

Field Detail

CREATOR

public static final Parcelable.Creator<Region> CREATOR

Constructor Detail

Region

public Region(String identifier,
              String proximityUUID,
              Integer major,
              Integer minor)

Parameters:

identifier - Aunique identifier for a region. Cannot be null.

proximityUUID -Proximity UUID of beacons. Can be null. Null indicates all proximity UUIDs.

major - Majorversion of the beacons. Can be null. Null indicates all major versions.

minor - Minorversion of the beacons. Can be null. Null indicates all minor versions.

Method Detail

getIdentifier

public String getIdentifier()

Returns:

Region'sunique identifier. Cannot be null.

区域的唯一标识,不能为空


getProximityUUID

public String getProximityUUID()

Returns:

ProximityUUID of targeting beacons.

目标beaconsUUID


getMajor

public Integer getMajor()

Returns:

Majorversion of targeting beacons.


getMinor

public Integer getMinor()

Returns:

Minorversion of targeting beacons.


toString

public String toString()

Overrides:

toString in class Object


equals

public boolean equals(Object o)

Overrides:

equals in class Object


hashCode

public int hashCode()

Overrides:

hashCode in class Object


describeContents

public int describeContents()

Specifiedby:

describeContents ininterface Parcelable


writeToParcel

public void writeToParcel(Parcel dest,
                          int flags)

Specifiedby:

writeToParcel ininterface Parcelable

com.estimote.sdk 
Enum Region.State

java.lang.Object
  java.lang.Enum<Region.State>
      com.estimote.sdk.Region.State

All Implemented Interfaces:

SerializableComparable<Region.State>

Enclosing class:

Region


public static enum Region.State
extends Enum<Region.State>

Describes current location relationship with region bounds.


Enum Constant Summary

INSIDE 
          Inside given region.

在给定区域的内部

OUTSIDE 
          Outside given region.

在给定区域的外部

 

Method Summary

static Region.State

valueOf(String name) 
          Returns the enum constant of this type with the specified name.

用指定名字返回枚举常量。

static Region.State[]

values() 
          Returns an array containing the constants of this enum type, in the order they are declared.

返回一个包含枚举类型的常量数组,以它们声明的顺序。

 

Methods inherited from class java.lang.Enum

clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

 

Methods inherited from class java.lang.Object

getClass, notify, notifyAll, wait, wait, wait

 

Enum Constant Detail

INSIDE

public static final Region.State INSIDE

Insidegiven region.


OUTSIDE

public static final Region.State OUTSIDE

Outsidegiven region.

Method Detail

values

public static Region.State[] values()

Returnsan array containing the constants of this enum type, in the order they aredeclared. This method may be used to iterate over the constants as follows:

for (Region.State c : Region.State.values())
    System.out.println(c);

Returns:

an arraycontaining the constants of this enum type, in the order they are declared


valueOf

public static Region.State valueOf(String name)

Returnsthe enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enumconstant in this type. (Extraneous whitespace characters are not permitted.)

这个字符串必须完全匹配一个用来声明这种类型的枚举常量的标志。(无关的空格串不被允许)

Parameters:

name - thename of the enum constant to be returned.

Returns:

the enumconstant with the specified name

Throws:

IllegalArgumentException - ifthis enum type has no constant with the specified name

假如没有枚举常量和指定名字匹配。

NullPointerException - if theargument is null

假如参数为空

com.estimote.sdk 
Class Utils

java.lang.Object
  com.estimote.sdk.Utils

public class Utils
extends Object

Grab bag of utilities.


Nested Class Summary

static class

Utils.Proximity 
          Defines distance relationship between beacon and the device.

定义beacon和设备的距离关系。

static interface

Utils.RestartCompletedListener 
          Interface used to notify called that Bluetooth stack has been restarted.

当蓝牙栈被重启时来通知的接口

 

Constructor Summary

Utils() 
           

 

Method Summary

static Beacon

beaconFromLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) 
          Parses 
scanRecord to look for manufacturer specific data, verifies that and constructs Beacon.

分析scanRecord去查找厂商特定的数据,验证它并构造Beacon

static double

computeAccuracy(Beacon beacon) 
          Returns distance in meters based on beacon's RSSI and measured power.

基于beaconRSSI值和实测功率返回以米为单位的距离。

static Utils.Proximity

computeProximity(Beacon beacon) 
           

static boolean

isBeaconInRegion(Beacon beacon, Region region) 
          Returns true if beacon matches the region.

假如beacon匹配区域返回true

static int

normalize16BitUnsignedInt(int value) 
          Normalizes integer to be unsigned 16-bit integer from range (1, 65535).

从区域中将整形转化成无符号16位整形。

static String

normalizeProximityUUID(String proximityUUID) 
          Normalizes proximity UUID by making it lowercase and in format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.

同过将UUID全部小写并且以”XXXXXXX-XXX..”的形式将UUID正常化

static int

parseInt(String numberAsString) 
          Parses string to integer.

将字符串转化成整形

static Utils.Proximity

proximityFromAccuracy(double accuracy) 
          Computes 
Utils.Proximity based on distance in meters.

基于以米为单位的距离计算邻近关系。

static void

restartBluetooth(Context context, Utils.RestartCompletedListener listener) 
          Restarts Bluetooth stack on the device.

重启设备的蓝牙栈。

 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

Utils

public Utils()

Method Detail

beaconFromLeScan

public static Beacon beaconFromLeScan(BluetoothDevice device,
                                      int rssi,
                                      byte[] scanRecord)

Parses scanRecord to lookfor manufacturer specific data, verifies that and constructs Beacon.

Parameters:

device -Bluetooth device found by BluetoothAdapter.

通过BluetoothAdapter发现的蓝牙设备

scanRecord -Bluetooth advertisement data.

蓝牙广播的数据

rssi -Current RSSI between devices.

设备间当前的rssi

Returns:

Constructed Beacon or null if scanRecord couldnot have been parsed.

构造Beacon或者当scanRecord不能被转换时为空。


normalizeProximityUUID

public static String normalizeProximityUUID(String proximityUUID)

Normalizesproximity UUID by making it lowercase and in formatXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX. Validates if there are 32 characters (notcounting dashes).


isBeaconInRegion

public static boolean isBeaconInRegion(Beacon beacon,
                                       Region region)

Returnstrue if beacon matches the region. That is region's proximity UUID, major,minor matches beacon's ones. Or if region uses wildcard for any of thoseproperties.

beacon匹配区域的时候返回真。这意味着区域的UUIDmajorminor匹配beacon,或者区域用那些属性的通配符。


computeAccuracy

public static double computeAccuracy(Beacon beacon)

Returnsdistance in meters based on beacon's RSSI and measured power. Returns -1 whencannot compute accuracy.


proximityFromAccuracy

public static Utils.Proximity proximityFromAccuracy(double accuracy)

Computes Utils.Proximity based on distance in meters. Currentdistance ranges:

·        immediate: 0 - 0.5m

·        near: 0.5m - 3.0m

·        far: 3.0m - ...

Parameters:

accuracy -Distance in meters.

Returns:

Proximitybetween device and beacon.


computeProximity

public static Utils.Proximity computeProximity(Beacon beacon)

parseInt

public static int parseInt(String numberAsString)

Parsesstring to integer. If string cannot be parsed, returns 0.

Parameters:

numberAsString - Stringto be parsed.

Returns:

Integervalue or 0 if string cannot be parsed.


normalize16BitUnsignedInt

public static int normalize16BitUnsignedInt(int value)

Normalizesinteger to be unsigned 16-bit integer from range (1, 65535).

Parameters:

value - Aninteger value.

Returns:

Normalizedunsigned 16-bit integer.


restartBluetooth

public static void restartBluetooth(Context context,
                                    Utils.RestartCompletedListener listener)

RestartsBluetooth stack on the device.

Never invokethis method without user's explicit consent that Bluetooth on the device isgoing to be restarted.

Parameters:

context -Context.

listener -Listener to be invoked when Bluetooth stack is restarted.

com.estimote.sdk 
Enum Utils.Proximity

java.lang.Object
  java.lang.Enum<Utils.Proximity>
      com.estimote.sdk.Utils.Proximity

All Implemented Interfaces:

SerializableComparable<Utils.Proximity>

Enclosing class:

Utils


public static enum Utils.Proximity
extends Enum<Utils.Proximity>

Defines distance relationship between beacon and the device.


Enum Constant Summary

FAR 
          Far away.

IMMEDIATE 
          Immediate vicinity.

NEAR 
          Relatively close.

UNKNOWN 
          Proximity could not be determined.

 

Method Summary

static Utils.Proximity

valueOf(String name) 
          Returns the enum constant of this type with the specified name.

static Utils.Proximity[]

values() 
          Returns an array containing the constants of this enum type, in the order they are declared.

 

Methods inherited from class java.lang.Enum

clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

 

Methods inherited from class java.lang.Object

getClass, notify, notifyAll, wait, wait, wait

 

Enum Constant Detail

UNKNOWN

public static final Utils.Proximity UNKNOWN

Proximitycould not be determined.


IMMEDIATE

public static final Utils.Proximity IMMEDIATE

Immediatevicinity.

紧邻


NEAR

public static final Utils.Proximity NEAR

Relativelyclose.

相对近


FAR

public static final Utils.Proximity FAR

Faraway.

很远

Method Detail

values

public static Utils.Proximity[] values()

Returnsan array containing the constants of this enum type, in the order they aredeclared. This method may be used to iterate over the constants as follows:

for (Utils.Proximity c : Utils.Proximity.values())
    System.out.println(c);

Returns:

an arraycontaining the constants of this enum type, in the order they are declared


valueOf

public static Utils.Proximity valueOf(String name)

Returnsthe enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enumconstant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:

name - thename of the enum constant to be returned.

Returns:

the enumconstant with the specified name

Throws:

IllegalArgumentException - ifthis enum type has no constant with the specified name

NullPointerException - if theargument is null

com.estimote.sdk 
Interface Utils.RestartCompletedListener

Enclosing class:

Utils


public static interface Utils.RestartCompletedListener

Interface used to notify called that Bluetooth stack has beenrestarted.


Method Summary

 void

onRestartCompleted() 
           

 

Method Detail

onRestartCompleted

void onRestartCompleted()

com.estimote.sdk.connection 
Interface BeaconConnection.ConnectionCallback

Enclosing class:

BeaconConnection


public static interface BeaconConnection.ConnectionCallback

Callback used to indicate state of the connection to the beacon.

指定和beacon连接状态的回调函数


Method Summary

 void

onAuthenticated(BeaconConnection.BeaconCharacteristics characteristics) 
          Invoked when connection to beacon is established.

当和beacon的连接建立时调用

 void

onAuthenticationError() 
          Invoked when there was a problem within authentication to the beacon.

当和beacon的验证出现错误时调用错误

 void

onDisconnected() 
          Connection was closed to the beacon.

当和beacon的连接断开时。

 

Method Detail

onAuthenticated

void onAuthenticated(BeaconConnection.BeaconCharacteristics characteristics)

Invokedwhen connection to beacon is established.

Parameters:

characteristics -Beacon's characteristics.

Beacon的特征


onAuthenticationError

void onAuthenticationError()

Invokedwhen there was a problem within authentication to the beacon.


onDisconnected

void onDisconnected()

Connectionwas closed to the beacon. Can happen when beacon is out of range.

com.estimote.sdk.connection 
Interface BeaconConnection.WriteCallback

Enclosing class:

BeaconConnection


public static interface BeaconConnection.WriteCallback

Callback used to indicate status of updating beaconcharacteristic.

指向更新beacon 特征状态调用的回调函数


Method Summary

 void

onError() 
           

 void

onSuccess() 
           

 

Method Detail

onSuccess

void onSuccess()

onError

void onError()

com.estimote.sdk.connection 
Class BeaconConnection

java.lang.Object
  com.estimote.sdk.connection.BeaconConnection

public class BeaconConnection
extends Object

Establishes connection to the beacon and reads itscharacteristics.

建立和beacon的连接并且读取它的特征。

Exposes methods to change beacon's UUID, major, minor,advertising interval and broadcasting power values. You can only change thosevalues only if there is established connection to beacon.

用来改变beaconUUIDmajorminor,广播间隔和广播功率值得暴露函数。只有当连接到beacon时你才能改变那些值。

It is very important to close() connection when it is not needed.

当不需要时关闭连接很重要。

Usage:

用法:

   BeaconConnection connection = new BeaconConnection(context, beacon, new BeaconConnection.ConnectionCallback() {
     @Override public void onAuthenticated(BeaconConnection.BeaconCharacteristics chars) {
       Log.d(TAG, "Authenticated to beacon: " + chars);
     }
 
     @Override public void onAuthenticationError() {
       Log.d(TAG, "Authentication Error");
     }
 
     @Override public void onDisconnected() {
       Log.d(TAG, "Disconnected");
     }
   });
 
   connection.authenticate();
 
   // Interact with beacon.
   // You can update characteristics via
   // connection.write* methods
 
   connection.close();

Nested Class Summary

static class

BeaconConnection.BeaconCharacteristics 
          Value object for beacon's characteristics (battery level, broadcasting power, advertising interval, software and hardware version).

Beacon特征的值对象(电池等级,广播能量,广播间隔,软件和硬件版本)

static interface

BeaconConnection.ConnectionCallback 
          Callback used to indicate state of the connection to the beacon.

static interface

BeaconConnection.WriteCallback 
          Callback used to indicate status of updating beacon characteristic.

 

Field Summary

static Set<Integer>

ALLOWED_POWER_LEVELS 
          Allowed values of broadcasting power.

允许的广播功率值。

 

Constructor Summary

BeaconConnection(Context context, Beacon beacon, BeaconConnection.ConnectionCallback connectionCallback) 
           

 

Method Summary

 void

authenticate() 
          Starts connection flow to device with 10s timeout.

开始和设备建立连接流,10秒超时。

 void

close() 
          Closes connection to beacon or cancels in-flight connection flow.

关闭连接,或者取消正在连接的工作流。

 boolean

isConnected() 
          Returns true if connection is successfully established with the beacon.

当和beacon的连接成功建立时返回真。

 void

writeAdvertisingInterval(int intervalMillis, BeaconConnection.WriteCallback writeCallback) 
          Changes advertising interval of the beacon.

改变beacon的广播间隔。

 void

writeBroadcastingPower(int powerDBM, BeaconConnection.WriteCallback writeCallback) 
          Changes broadcasting power of the beacon.

改变beacon的广播功率。

 void

writeMajor(int major, BeaconConnection.WriteCallback writeCallback) 
          Changes major value of the beacon.

改变beaconmajor值。

 void

writeMinor(int minor, BeaconConnection.WriteCallback writeCallback) 
          Changes minor value of the beacon.

改变beaconminor值。

 void

writeProximityUuid(String proximityUuid, BeaconConnection.WriteCallback writeCallback) 
          Changes proximity UUID of the beacon.

改变beaconUUID值。

 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

ALLOWED_POWER_LEVELS

public static Set<Integer> ALLOWED_POWER_LEVELS

Allowedvalues of broadcasting power. Higher value means larger broadcasting power.

Constructor Detail

BeaconConnection

public BeaconConnection(Context context,
                        Beacon beacon,
                        BeaconConnection.ConnectionCallback connectionCallback)

Method Detail

authenticate

public void authenticate()

Startsconnection flow to device with 10s timeout.


close

public void close()

Closesconnection to beacon or cancels in-flight connection flow.


isConnected

public boolean isConnected()

Returnstrue if connection is successfully established with the beacon.


writeProximityUuid

public void writeProximityUuid(String proximityUuid,
                               BeaconConnection.WriteCallback writeCallback)

Changesproximity UUID of the beacon.

Parameters:

proximityUuid - Stringrepresentation of the UUID (16 bytes encoded as hex with or without dashes).1616进制编码带或者不带破折号)

writeCallback -Callback to be invoked when write is completed.


writeAdvertisingInterval

public void writeAdvertisingInterval(int intervalMillis,
                                     BeaconConnection.WriteCallback writeCallback)

Changesadvertising interval of the beacon. Interval value will be normalized to fitthe range (50 - 2000 ms).间隔值会正常话去适应区域(50-2000毫秒)

Parameters:

intervalMillis -Advertising interval in milliseconds.

writeCallback -Callback to be invoked when write is completed.

当写完时调用


writeBroadcastingPower

public void writeBroadcastingPower(int powerDBM,
                                   BeaconConnection.WriteCallback writeCallback)

Changesbroadcasting power of the beacon. Allowed values: -30, -20, -16, -12, -8, -4,0, 4. Larger value means stronger power.

允许的值:-30-20-16-12-8-404。更大的值意味刚多的能量。

Parameters:

powerDBM -Broadcasting power to be set.

设置的广播功率

writeCallback -Callback to be invoked when write is completed.

SeeAlso:

ALLOWED_POWER_LEVELS


writeMajor

public void writeMajor(int major,
                       BeaconConnection.WriteCallback writeCallback)

Changesmajor value of the beacon. Major value will be normalized to fit the range (1,65535).

Parameters:

major - Majorvalue to be set.

writeCallback -Callback to be invoked when write is completed.


writeMinor

public void writeMinor(int minor,
                       BeaconConnection.WriteCallback writeCallback)

Changesminor value of the beacon. Minor value will be normalized to fit the range (1,65535).

Parameters:

minor - Minorvalue to be set.

writeCallback -Callback to be invoked when write is completed.

com.estimote.sdk.connection 
Class BeaconConnection.BeaconCharacteristics

java.lang.Object
  com.estimote.sdk.connection.BeaconConnection.BeaconCharacteristics

Enclosing class:

BeaconConnection


public static class BeaconConnection.BeaconCharacteristics
extends Object

Value object for beacon's characteristics (battery level,broadcasting power, advertising interval, software and hardware version).

Those values can be read via BeaconConnection.authenticate() and are delivered asynchronously inConnectionCallback#onAuthenticated(BeaconCharacteristics).

这些值可以通过BeaconConnection.authenticate()读取并且同时传递给inConnectionCallback#onAuthenticatedBeaconCharacteristics


Constructor Summary

BeaconConnection.BeaconCharacteristics(EstimoteService estimoteService, VersionService versionService) 
           

 

Method Summary

 Integer

getAdvertisingIntervalMillis() 
          Returns Advertising interval in milliseconds.

返回毫秒单位的广播间隔

 Integer

getBatteryPercent() 
          Returns Battery level in percent.

返回当前的电池等级

 Byte

getBroadcastingPower() 
          Returns Broadcasting power.

返回广播功率

 String

getHardwareVersion() 
          Returns Revision of hardware.

返回硬件的版本

 String

getSoftwareVersion() 
          Returns Version of operating system.

返回操作系统版本

 String

toString() 
          Human readable description of the characteriscts.

返回可读的特征描述

 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Constructor Detail

BeaconConnection.BeaconCharacteristics

public BeaconConnection.BeaconCharacteristics(EstimoteService estimoteService,
                                              VersionService versionService)

Method Detail

getBatteryPercent

public Integer getBatteryPercent()

ReturnsBattery level in percent.


getBroadcastingPower

public Byte getBroadcastingPower()

ReturnsBroadcasting power. @see BeaconConnection#ALLOWED_POWER_LEVELS


getAdvertisingIntervalMillis

public Integer getAdvertisingIntervalMillis()

ReturnsAdvertising interval in milliseconds.


getSoftwareVersion

public String getSoftwareVersion()

ReturnsVersion of operating system.


getHardwareVersion

public String getHardwareVersion()

ReturnsRevision of hardware.


toString

public String toString()

Humanreadable description of the characteriscts.

Overrides:

toString in class Object

com.estimote.sdk.service 
Class BeaconService

java.lang.Object
  android.content.Context
      android.content.ContextWrapper
          android.app.Service
              com.estimote.sdk.service.BeaconService

All Implemented Interfaces:

ComponentCallbacksComponentCallbacks2


public class BeaconService
extends Service

Don't use this class directly, use it via BeaconManager.


Field Summary

static int

ERROR_COULD_NOT_START_LOW_ENERGY_SCANNING 
          Happens when Bluetooth service for some reason does not want to start low energy scanning.

当蓝牙服务因为某些原因不详开启低功耗扫描时发生

static int

MSG_ERROR_RESPONSE 
          Service sends error.

服务发送错误。

static int

MSG_MONITORING_RESPONSE 
          Service sends monitoring results.

服务发送监测结果。

static int

MSG_RANGING_RESPONSE 
          Service sends ranging results.

服务发送测距结果。

static int

MSG_REGISTER_ERROR_LISTENER 
          Service registers error listener where errors can be send.

服务注册可以接收到错误的错误监听者

static int

MSG_SET_BACKGROUND_SCAN_PERIOD 
          Sets scan periods for monitoring, that is when app is in foreground.

app在前景时设置监测的扫描周期。

static int

MSG_SET_FOREGROUND_SCAN_PERIOD 
          Sets scan periods for ranging, that is when app is in foreground.

。。。测距周期

static int

MSG_START_MONITORING 
          Service starts monitoring region.

服务开始监测区域。

static int

MSG_START_RANGING 
          Service starts ranging region.

服务开始测距区域

static int

MSG_STOP_MONITORING 
          Service stops monitoring region.

服务开始停止监测区域。

static int

MSG_STOP_RANGING 
          Service stops ranging region.

 

Fields inherited from class android.app.Service

START_CONTINUATION_MASK, START_FLAG_REDELIVERY, START_FLAG_RETRY, START_NOT_STICKY, START_REDELIVER_INTENT, START_STICKY, START_STICKY_COMPATIBILITY

 

Fields inherited from class android.content.Context

ACCESSIBILITY_SERVICE, ACCOUNT_SERVICE, ACTIVITY_SERVICE, ALARM_SERVICE, APP_OPS_SERVICE, AUDIO_SERVICE, BIND_ABOVE_CLIENT,BIND_ADJUST_WITH_ACTIVITY, BIND_ALLOW_OOM_MANAGEMENT, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, BIND_IMPORTANT, BIND_NOT_FOREGROUND, BIND_WAIVE_PRIORITY,BLUETOOTH_SERVICE, CAPTIONING_SERVICE, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONSUMER_IR_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE,CONTEXT_RESTRICTED, DEVICE_POLICY_SERVICE, DISPLAY_SERVICE, DOWNLOAD_SERVICE, DROPBOX_SERVICE, INPUT_METHOD_SERVICE, INPUT_SERVICE, KEYGUARD_SERVICE,LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MEDIA_ROUTER_SERVICE, MODE_APPEND, MODE_ENABLE_WRITE_AHEAD_LOGGING, MODE_MULTI_PROCESS, MODE_PRIVATE,MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE, NFC_SERVICE, NOTIFICATION_SERVICE, NSD_SERVICE, POWER_SERVICE, PRINT_SERVICE, SEARCH_SERVICE,SENSOR_SERVICE, STORAGE_SERVICE, TELEPHONY_SERVICE, TEXT_SERVICES_MANAGER_SERVICE, UI_MODE_SERVICE, USB_SERVICE, USER_SERVICE, VIBRATOR_SERVICE,WALLPAPER_SERVICE, WIFI_P2P_SERVICE, WIFI_SERVICE, WINDOW_SERVICE

 

Fields inherited from interface android.content.ComponentCallbacks2

TRIM_MEMORY_BACKGROUND, TRIM_MEMORY_COMPLETE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_RUNNING_CRITICAL, TRIM_MEMORY_RUNNING_LOW,TRIM_MEMORY_RUNNING_MODERATE, TRIM_MEMORY_UI_HIDDEN

 

Constructor Summary

BeaconService() 
           

 

Method Summary

 IBinder

onBind(Intent intent) 
           

 void

onCreate() 
           

 void

onDestroy() 
           

 void

startMonitoring(com.estimote.sdk.service.MonitoringRegion monitoringRegion) 
           

 void

stopMonitoring(String regionId) 
           

 

Methods inherited from class android.app.Service

dump, getApplication, onConfigurationChanged, onLowMemory, onRebind, onStart, onStartCommand, onTaskRemoved, onTrimMemory, onUnbind, startForeground,stopForeground, stopSelf, stopSelf, stopSelfResult

 

Methods inherited from class android.content.ContextWrapper

attachBaseContext, bindService, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission,checkPermission, checkUriPermission, checkUriPermission, clearWallpaper, createConfigurationContext, createDisplayContext, createPackageContext,databaseList, deleteDatabase, deleteFile, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission,enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo,getAssets, getBaseContext, getCacheDir, getClassLoader, getContentResolver, getDatabasePath, getDir, getExternalCacheDir, getExternalCacheDirs,getExternalFilesDir, getExternalFilesDirs, getFilesDir, getFileStreamPath, getMainLooper, getObbDir, getObbDirs, getPackageCodePath,getPackageManager, getPackageName, getPackageResourcePath, getResources, getSharedPreferences, getSystemService, getTheme, getWallpaper,getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isRestricted, openFileInput, openFileOutput,openOrCreateDatabase, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, removeStickyBroadcast, removeStickyBroadcastAsUser,revokeUriPermission, sendBroadcast, sendBroadcast, sendBroadcastAsUser, sendBroadcastAsUser, sendOrderedBroadcast, sendOrderedBroadcast,sendOrderedBroadcastAsUser, sendStickyBroadcast, sendStickyBroadcastAsUser, sendStickyOrderedBroadcast, sendStickyOrderedBroadcastAsUser, setTheme,setWallpaper, setWallpaper, startActivities, startActivities, startActivity, startActivity, startInstrumentation, startIntentSender,startIntentSender, startService, stopService, unbindService, unregisterReceiver

 

Methods inherited from class android.content.Context

getString, getString, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes,registerComponentCallbacks, unregisterComponentCallbacks

 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

MSG_START_RANGING

public static final int MSG_START_RANGING

Servicestarts ranging region. Message contains Region.

消息包含Region

SeeAlso:

Constant Field Values


MSG_STOP_RANGING

public static final int MSG_STOP_RANGING

Servicestops ranging region. Message contains String (region id).

SeeAlso:

Constant Field Values


MSG_RANGING_RESPONSE

public static final int MSG_RANGING_RESPONSE

Servicesends ranging results. Message contains RangingResult.

SeeAlso:

Constant Field Values


MSG_START_MONITORING

public static final int MSG_START_MONITORING

Servicestarts monitoring region. Message contains Region.

SeeAlso:

Constant Field Values


MSG_STOP_MONITORING

public static final int MSG_STOP_MONITORING

Servicestops monitoring region. Message contains String (region id).

SeeAlso:

Constant Field Values


MSG_MONITORING_RESPONSE

public static final int MSG_MONITORING_RESPONSE

Servicesends monitoring results. Message contains MonitoringResult.

SeeAlso:

Constant Field Values


MSG_REGISTER_ERROR_LISTENER

public static final int MSG_REGISTER_ERROR_LISTENER

Serviceregisters error listener where errors can be send.

SeeAlso:

Constant Field Values


MSG_ERROR_RESPONSE

public static final int MSG_ERROR_RESPONSE

Servicesends error. Message contains Integer as error id.

SeeAlso:

Constant Field Values


MSG_SET_FOREGROUND_SCAN_PERIOD

public static final int MSG_SET_FOREGROUND_SCAN_PERIOD

Setsscan periods for ranging, that is when app is in foreground. Message contains ScanPeriodData.

SeeAlso:

Constant Field Values


MSG_SET_BACKGROUND_SCAN_PERIOD

public static final int MSG_SET_BACKGROUND_SCAN_PERIOD

Setsscan periods for monitoring, that is when app is in foreground. Messagecontains ScanPeriodData.

SeeAlso:

Constant Field Values


ERROR_COULD_NOT_START_LOW_ENERGY_SCANNING

public static final int ERROR_COULD_NOT_START_LOW_ENERGY_SCANNING

Happenswhen Bluetooth service for some reason does not want to start low energyscanning. It is good indicator to restart Bluetooth stack.

SeeAlso:

Utils.restartBluetooth(Context,com.estimote.sdk.Utils.RestartCompletedListener)Constant Field Values

Constructor Detail

BeaconService

public BeaconService()

Method Detail

onCreate

public void onCreate()

Overrides:

onCreate in class Service


onDestroy

public void onDestroy()

Overrides:

onDestroy in class Service


onBind

public IBinder onBind(Intent intent)

Specifiedby:

onBind in class Service


startMonitoring

public void startMonitoring(com.estimote.sdk.service.MonitoringRegion monitoringRegion)

stopMonitoring

public void stopMonitoring(String regionId)

com.estimote.sdk.service 
Class MonitoringResult

java.lang.Object
  com.estimote.sdk.service.MonitoringResult

All Implemented Interfaces:

Parcelable


public class MonitoringResult
extends Object
implements Parcelable

Data object for results from ranging.

测距的数据结果对象


Nested Class Summary

 

Nested classes/interfaces inherited from interface android.os.Parcelable

Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>

 

Field Summary

 List<Beacon>

beacons 
          Collection of beacons that triggered ENTER state.

触发进入状态的beacons集合

static Parcelable.Creator<MonitoringResult>

CREATOR 
           

 Region

region 
          Region for which these results are for.

这些结果对应的区域。

 Region.State

state 
          Did we enter or exit the region?

我们是进入还是离开区域

 

Fields inherited from interface android.os.Parcelable

CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE

 

Constructor Summary

MonitoringResult(Region region, Region.State state, Collection<Beacon> beacons) 
           

 

Method Summary

 int

describeContents() 
           

 boolean

equals(Object o) 
           

 int

hashCode() 
           

 String

toString() 
           

 void

writeToParcel(Parcel dest, int flags) 
           

 

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait

 

Field Detail

region

public final Region region

Regionfor which these results are for.


state

public final Region.State state

Did weenter or exit the region?


beacons

public final List<Beacon> beacons

Collectionof beacons that triggered ENTER state.


CREATOR

public static final Parcelable.Creator<MonitoringResult> CREATOR

Constructor Detail

MonitoringResult

public MonitoringResult(Region region,
                        Region.State state,
                        Collection<Beacon> beacons)

Method Detail

equals

public boolean equals(Object o)

Overrides:

equals in class Object


hashCode

public int hashCode()

Overrides:

hashCode in class Object


toString

public String toString()

Overrides:

toString in class Object


describeContents

public int describeContents()

Specifiedby:

describeContents ininterface Parcelable


writeToParcel

public void writeToParcel(Parcel dest,
                          int flags)

Specifiedby:

writeToParcel ininterface Parcelable

com.estimote.sdk.service 
Class RangingResult

java.lang.Object
  com.estimote.sdk.service.RangingResult

All Implemented Interfaces:

Parcelable


public final class RangingResult
extends Object
implements Parcelable

Data object for results from ranging. Consists of range forwhich scanning was made and collection of found beacons in the range.Collection of beacons is sorted by its accuracy.

测距的数据结果对象。由测距组成,开始扫描和在区域内找到的beacons的对象组成。Beacons集合以精确度排序。


Nested Class Summary

 

Nested classes/interfaces inherited from interface android.os.Parcelable

Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>

 

Field Summary

 List<Beacon>

beacons 
          Collection of ranged beacons.

static Parcelable.Creator<RangingResult>

CREATOR 
           

 Region

region 
          Region for which these results are for.

 

Fields inherited from interface android.os.Parcelable

CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE

 

Constructor Summary

RangingResult(Region region, Collection<Beacon> beacons) 
           

 

Method Summary

 int

describeContents() 
           

 boolean

equals(Object o) 
           

 int

hashCode() 
           

 String

toString() 
           

 void

writeToParcel(Parcel dest, int flags) 
           

 

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait

 

Field Detail

region

public final Region region

Regionfor which these results are for.


beacons

public final List<Beacon> beacons

Collectionof ranged beacons.


CREATOR

public static final Parcelable.Creator<RangingResult> CREATOR

Constructor Detail

RangingResult

public RangingResult(Region region,
                     Collection<Beacon> beacons)

Method Detail

equals

public boolean equals(Object o)

Overrides:

equals in class Object


hashCode

public int hashCode()

Overrides:

hashCode in class Object


toString

public String toString()

Overrides:

toString in class Object


describeContents

public int describeContents()

Specifiedby:

describeContents ininterface Parcelable


writeToParcel

public void writeToParcel(Parcel dest,
                          int flags)

Specifiedby:

writeToParcel ininterface Parcelable

com.estimote.sdk.service 
Class ScanPeriodData

java.lang.Object
  com.estimote.sdk.service.ScanPeriodData

All Implemented Interfaces:

Parcelable


public final class ScanPeriodData
extends Object
implements Parcelable

Data object containing values for setting scan periods.

包含设置扫描周期的数据对象


Nested Class Summary

 

Nested classes/interfaces inherited from interface android.os.Parcelable

Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>

 

Field Summary

static Parcelable.Creator<ScanPeriodData>

CREATOR 
           

 long

scanPeriodMillis 
          How long we perform low energy scanning and restarting the scan.

 long

waitTimeMillis 
          How long we wait before starting a new low energy scan.

 

Fields inherited from interface android.os.Parcelable

CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE

 

Constructor Summary

ScanPeriodData(long scanPeriodMillis, long waitTimeMillis) 
           

 

Method Summary

 int

describeContents() 
           

 boolean

equals(Object o) 
           

 int

hashCode() 
           

 String

toString() 
           

 void

writeToParcel(Parcel dest, int flags) 
           

 

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait

 

Field Detail

scanPeriodMillis

public final long scanPeriodMillis

How longwe perform low energy scanning and restarting the scan.


waitTimeMillis

public final long waitTimeMillis

How longwe wait before starting a new low energy scan.


CREATOR

public static final Parcelable.Creator<ScanPeriodData> CREATOR

Constructor Detail

ScanPeriodData

public ScanPeriodData(long scanPeriodMillis,
                      long waitTimeMillis)

Method Detail

equals

public boolean equals(Object o)

Overrides:

equals in class Object


hashCode

public int hashCode()

Overrides:

hashCode in class Object


toString

public String toString()

Overrides:

toString in class Object


describeContents

public int describeContents()

Specifiedby:

describeContents ininterface Parcelable


writeToParcel

public void writeToParcel(Parcel dest,
                          int flags)

Specifiedby:

writeToParcel ininterface Parcelable

com.estimote.sdk.utils 
Class L

java.lang.Object
  com.estimote.sdk.utils.L

public class L
extends Object

L stands for logging.


Constructor Summary

L() 
           

 

Method Summary

static void

d(String msg) 
           

static void

e(String msg) 
           

static void

e(String msg, Throwable e) 
           

static void

enableCrashlyticsLogging(boolean enableCrashlytics) 
           

static void

enableDebugLogging(boolean enableDebugLogging) 
          Enables debug logging of the Estimote SDK.

static void

i(String msg) 
           

static void

v(String msg) 
           

static void

w(String msg) 
           

static void

wtf(String msg) 
           

static void

wtf(String msg, Exception exception) 
           

 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

L

public L()

Method Detail

enableDebugLogging

public static void enableDebugLogging(boolean enableDebugLogging)

Enablesdebug logging of the Estimote SDK.

允许调试EstimoteSDK的日志

Parameters:

enableDebugLogging -Whether enable debug logging.


enableCrashlyticsLogging

public static void enableCrashlyticsLogging(boolean enableCrashlytics)

v

public static void v(String msg)

d

public static void d(String msg)

i

public static void i(String msg)

w

public static void w(String msg)

e

public static void e(String msg)

e

public static void e(String msg,
                     Throwable e)

wtf

public static void wtf(String msg)

wtf

public static void wtf(String msg,
                       Exception exception)

发布了35 篇原创文章 · 获赞 61 · 访问量 16万+

猜你喜欢

转载自blog.csdn.net/cql342624757/article/details/37924543