Android Estimote sdk 无法扫描除 estimote 之外的其他信标

标签 android android-bluetooth ibeacon-android estimote

我试图在 android 中使用 estimote sdk 查看信标,但没有运气!我可以看到所有的 estimote 信标,但所有其他信标都不起作用(fobo 信标等)我正在使用 fobo 信标的 uuid在 Region 构造函数中,我可以在 logcat 中看到蓝牙可以看​​到设备,但 estimode sdk 没有将其作为信标收集!知道为什么会这样吗?我正在发布以下代码:

 private static final String FOBO_PROXIMITY_UUID = "00158800-587d-2206-d52b-fb6d6e2f0001";
 private static final Region FOBOBEACONS = new Region("rid", FOBO_PROXIMITY_UUID , null, null);
 public void BeaconManager(){
    beaconManager = new com.estimote.sdk.BeaconManager(this);
    beaconManager.setBackgroundScanPeriod(5000, 30000);
    beaconManager.setForegroundScanPeriod(7000, 5000);



    beaconManager.setRangingListener(new com.estimote.sdk.BeaconManager.RangingListener() {

        @Override
        public void onBeaconsDiscovered(final Region arg0, final List<Beacon> arg1) {
            // TODO Auto-generated method stub
            runOnUiThread(new Runnable() {
                  @Override
                  public void run() {
                    // Note that beacons reported here are already sorted by estimated
                    // distance between device and beacon.
                      int test=0;
                      if(arg1.size()<=0){
                          Toast.makeText(MainActivity.this, "No beacon found",
                                  Toast.LENGTH_SHORT).show();
                      }else{

                          for (int i = 0; i < arg1.size(); i++) {
                              String beac=arg1.get(i).getProximityUUID();
                              Toast.makeText(MainActivity.this, "I found a beacon with UUID; "+beac,
                                      Toast.LENGTH_SHORT).show();  
                        }


                      }



                   // adapter.replaceWith(beacons);
                  }
                }); 
        }

    });
    connectToService();

}

  private void connectToService() {
    beaconManager.connect(new com.estimote.sdk.BeaconManager.ServiceReadyCallback() {
      @Override
      public void onServiceReady() {
        try {
          com.estimote.sdk.utils.L.enableDebugLogging(true);
          beaconManager.startRanging(FOBOBEACONS);

        } catch (RemoteException e) {
          Toast.makeText(MainActivity.this, "Cannot start ranging, something terrible happened",
              Toast.LENGTH_LONG).show();
        }
      }
    });
  }

最佳答案

我是 Wojtek Borowicz,我是 Estimote 的社区传播者。实际上,Estimote SDK 不支持来自其他供应商的 Beacon - 这就是您无法检测到它们的原因。

干杯。

关于Android Estimote sdk 无法扫描除 estimote 之外的其他信标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23086490/

相关文章:

Android相机 Intent 在拍摄肖像时保存图像风景

android - Android 中的自定义适配器

java - Android:BluetoothSocket 接收自己的输出

android - 如何在android中通过蓝牙向配对设备发送短信?

android - 蓝牙低功耗 (BLE) 设备与华为手机的连接问题

android - ListView不使用ArrayAdapter在 fragment 中显示数据

android - 如何通过 ViewModel 从 Fragment 观察 Repository LiveData

Android信标库——多区域监控

android - 估计信标安全

android - 如何在不使用任何库的情况下检测android中的IBeacon