0
我正在使用estimote sdk工作在Estimote信號燈上,我添加了APP_ID和APP_TOKEN,但仍然無法檢測到。爲什麼在Android上未檢測到Estimote信標?
@Override
public void onCreate() {
super.onCreate();
beaconManager = new com.estimote.sdk.BeaconManager(getApplicationContext());
EstimoteSDK.initialize(getApplicationContext(), Constants.APP_ID, Constants.APP_TOKEN);
beaconManager.setMonitoringListener(new com.estimote.sdk.BeaconManager.MonitoringListener() {
@Override
public void onEnteredRegion(com.estimote.sdk.Region region, java.util.List<com.estimote.sdk.Beacon> list) {
showNotification("Welcome to the shop", "You are in");
}
@Override
public void onExitedRegion(com.estimote.sdk.Region region) {
}
});
}
權限
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
敬請通過我的職位,並建議我一些解決方案。
解決方案
beaconManager.setNearableListener(new BeaconManager.NearableListener() {
@Override
public void onNearablesDiscovered(java.util.List<com.estimote.sdk.Nearable> nearables) {
}
});
beaconManager.connect(new BeaconManager.ServiceReadyCallback() {
@Override
public void onServiceReady() {
scanId = beaconManager.startNearableDiscovery();
}
});
試試這個樣本http://developer.estimote.com/android/tutorial/part -3-ranging-beacon/ – Lingeshwaran
@Lingeshwaran嘿,謝謝我已經嘗試過這個想法,但在他們的UUID是硬編碼的,但我想動態檢測,你能告訴我如何動態檢測這些信標? –
你沒有UUID? – Lingeshwaran