三分鐘讓你輕鬆開發 iBeacon
-
Upload
allen-tsai -
Category
Technology
-
view
533 -
download
5
Transcript of 三分鐘讓你輕鬆開發 iBeacon
![Page 1: 三分鐘讓你輕鬆開發 iBeacon](https://reader031.fdocuments.net/reader031/viewer/2022013115/55a928f91a28abb8768b4767/html5/thumbnails/1.jpg)
只要三分鐘讓你輕鬆開發 iBeacon
Allen Tsai
2015.04.01 (三)
什麼只要三分鐘‧‧‧
是不是騙人的啊‧‧‧
聽說今天是愚人節‧‧‧
![Page 2: 三分鐘讓你輕鬆開發 iBeacon](https://reader031.fdocuments.net/reader031/viewer/2022013115/55a928f91a28abb8768b4767/html5/thumbnails/2.jpg)
iBeacon 正在改變我們的生活?
共同參與創新科技革命
![Page 3: 三分鐘讓你輕鬆開發 iBeacon](https://reader031.fdocuments.net/reader031/viewer/2022013115/55a928f91a28abb8768b4767/html5/thumbnails/3.jpg)
通過此 Workshop 你將…
安裝‧使用 Android Studio
巡覽 Estimote 範例專案
認識 Estimote SDK
體驗實際應用
![Page 4: 三分鐘讓你輕鬆開發 iBeacon](https://reader031.fdocuments.net/reader031/viewer/2022013115/55a928f91a28abb8768b4767/html5/thumbnails/4.jpg)
iBeacon 本身屬性值
Estimote 提供資訊
Estimote iBeacon 裝置資訊
![Page 5: 三分鐘讓你輕鬆開發 iBeacon](https://reader031.fdocuments.net/reader031/viewer/2022013115/55a928f91a28abb8768b4767/html5/thumbnails/5.jpg)
Estimote App 應用
靠近時商品時,通知…
附近商品資訊,購買…
查詢商品距離,偵測…
![Page 6: 三分鐘讓你輕鬆開發 iBeacon](https://reader031.fdocuments.net/reader031/viewer/2022013115/55a928f91a28abb8768b4767/html5/thumbnails/6.jpg)
初探 Estimote API
![Page 7: 三分鐘讓你輕鬆開發 iBeacon](https://reader031.fdocuments.net/reader031/viewer/2022013115/55a928f91a28abb8768b4767/html5/thumbnails/7.jpg)
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
![Page 8: 三分鐘讓你輕鬆開發 iBeacon](https://reader031.fdocuments.net/reader031/viewer/2022013115/55a928f91a28abb8768b4767/html5/thumbnails/8.jpg)
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.
![Page 9: 三分鐘讓你輕鬆開發 iBeacon](https://reader031.fdocuments.net/reader031/viewer/2022013115/55a928f91a28abb8768b4767/html5/thumbnails/9.jpg)
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.
![Page 10: 三分鐘讓你輕鬆開發 iBeacon](https://reader031.fdocuments.net/reader031/viewer/2022013115/55a928f91a28abb8768b4767/html5/thumbnails/10.jpg)
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.
![Page 11: 三分鐘讓你輕鬆開發 iBeacon](https://reader031.fdocuments.net/reader031/viewer/2022013115/55a928f91a28abb8768b4767/html5/thumbnails/11.jpg)
iBeacon Demo Project on Android Studio
![Page 12: 三分鐘讓你輕鬆開發 iBeacon](https://reader031.fdocuments.net/reader031/viewer/2022013115/55a928f91a28abb8768b4767/html5/thumbnails/12.jpg)
Estimote Demo App Hands-on
![Page 13: 三分鐘讓你輕鬆開發 iBeacon](https://reader031.fdocuments.net/reader031/viewer/2022013115/55a928f91a28abb8768b4767/html5/thumbnails/13.jpg)
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
![Page 14: 三分鐘讓你輕鬆開發 iBeacon](https://reader031.fdocuments.net/reader031/viewer/2022013115/55a928f91a28abb8768b4767/html5/thumbnails/14.jpg)
觀察‧體會‧生活
創新就在你我身邊
![Page 15: 三分鐘讓你輕鬆開發 iBeacon](https://reader031.fdocuments.net/reader031/viewer/2022013115/55a928f91a28abb8768b4767/html5/thumbnails/15.jpg)
參考資訊
BLE(Bluetooth Low Energy) 簡介
Link
Estimote App for iOS
Link
Estimote App for Android
Link
Estimote Android SDK Document
Link