只要三分鐘讓你輕鬆開發 iBeacon
Allen Tsai
2015.04.01 (三)
什麼只要三分鐘‧‧‧
是不是騙人的啊‧‧‧
聽說今天是愚人節‧‧‧
iBeacon 正在改變我們的生活?
共同參與創新科技革命
通過此 Workshop 你將…
安裝‧使用 Android Studio
巡覽 Estimote 範例專案
認識 Estimote SDK
體驗實際應用
iBeacon 本身屬性值
Estimote 提供資訊
Estimote iBeacon 裝置資訊
Estimote App 應用
靠近時商品時,通知…
附近商品資訊,購買…
查詢商品距離,偵測…
初探 Estimote API
Type Function Name Function Description
String getMacAddress() Return MAC address of the beacon.
int getMajor() Return Major version of the beacon.
int getMeasuredPower() Return Measured power of the beacon (in dBm).
int getMinor() Return Minor version of the beacon.
String getName() Return Device friendly name (this name is advertised by the beacon).
String getProximityUUID()Return Proximity UUID of the beacon in format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX (all lowercases).
int getRssi()Return Received Signal Strength Indication at the moment of scanning.
com.estimote.sdk
Class Beacon
com.estimote.sdk.connection
Class BeaconConnection.BeaconCharacteristics
Type Function Name Function Description
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.
com.estimote.sdk
Class Utils
Type Function Name
static doublecomputeAccuracy(Beacon beacon)
Returns distance in meters based on beacon's RSSI and measured power.
static booleanisBeaconInRegion(Beacon beacon, Region region)
Returns true if beacon matches the region.
static voidrestartBluetooth(Context context, Utils.RestartCompletedListener listener)
Restarts Bluetooth stack on the device.
com.estimote.sdk.connection
Class BeaconConnection
Function Name
void:writeAdvertisingInterval(int intervalMillis, BeaconConnection.WriteCallback writeCallback)Changes advertising interval of the beacon.
void:writeBroadcastingPower(int powerDBM, BeaconConnection.WriteCallback writeCallback) Changes broadcasting power of the beacon.
void:writeMajor(int major, BeaconConnection.WriteCallback writeCallback) Changes major value of the beacon.
void:writeMinor(int minor, BeaconConnection.WriteCallback writeCallback) Changes minor value of the beacon.
void:writeProximityUuid(String proximityUuid, BeaconConnection.WriteCallback writeCallback) Changes proximity UUID of the beacon.
iBeacon Demo Project on Android Studio
Estimote Demo App Hands-on
private static final String ESTIMOTE_PROXIMITY_UUID = "B9407F30-F5F8-466E-AFF9-25556B57FE6D";private static final Region ALL_ESTIMOTE_BEACONS =
new Region("regionId", ESTIMOTE_PROXIMITY_UUID, null, null); private BeaconManager beaconManager = new BeaconManager(context);
// Should be invoked in #onCreate.beaconManager.setRangingListener(new BeaconManager.RangingListener() {
@Override public void onBeaconsDiscovered(Region region, List<Beacon> beacons) { Log.d(TAG, "Ranged beacons: " + beacons);
} });
// Should be invoked in #onStart.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); }
}});
// Should be invoked in #onStop.try {
beaconManager.stopRanging(ALL_ESTIMOTE_BEACONS);}catch (RemoteException e) {
Log.e(TAG, "Cannot stop but it does not matter now", e);}
// When no longer needed. Should be invoked in #onDestroy.beaconManager.disconnect();
快速上手操作
iBe
ac
on
觀察‧體會‧生活
創新就在你我身邊
參考資訊
BLE(Bluetooth Low Energy) 簡介
Link
Estimote App for iOS
Link
Estimote App for Android
Link
Estimote Android SDK Document
Link