2016-09-19 10 views
0

私はEstimoteビーコンで推定値sdkを使用しています。私は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(); 
     } 
    }); 
+0

http://developer.estimote.com/android/tutorial/partこのサンプルを試してみてください-3-ranging-beacons/ – Lingeshwaran

+0

@Lingeshwaranちょっとありがとう私はこれが欲しいと思ったが、彼らのUUIDはハードコードされているが、私は動的に検出したい、これらのビーコンを動的に検出する方法を教えてもらえますか? –

+0

あなたはUUIDを持っていませんか? – Lingeshwaran

答えて

0

UUIDとモニタにする必要がマイナー、メジャーを使用してみてください:

// 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)); 
    } 
    }); 
関連する問題