首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么Estimote信标没有在Android上检测到?

为什么Estimote信标没有在Android上检测到?
EN

Stack Overflow用户
提问于 2016-09-19 08:43:49
回答 1查看 648关注 0票数 0

我正在使用Estimote开发estimote信标,我添加了APP_ID和APP_TOKEN,但仍然无法检测。

代码语言:javascript
复制
@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) {

     }
  });
}

权限

代码语言:javascript
复制
<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"/>

请翻阅我的帖子,并建议我一些解决办法。

溶液

代码语言:javascript
复制
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();
        }
    });
EN

回答 1

Stack Overflow用户

发布于 2017-10-05 10:27:37

尝试使用需要监视的UUID和次要专业:

代码语言:javascript
复制
    // this is were we left off:
    beaconManager = new BeaconManager(getApplicationContext());
   // add this below:
   beaconManager.connect(new BeaconManager.ServiceReadyCallback() {
   @Override
    public void onServiceReady() {
      beaconManager.startMonitoring(new BeaconRegion(
            "monitored region",
            UUID.fromString("B9407F30-F5F8-466E-AFF9-25556B57FE6D"),
            22504, 48827));
    }
   });
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39568864

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档