I got weird problem, My app go into the onTelemetriesFound() function, but the telemetries is empt. Size=0.
I have the SCANID. What the problem? Can anyone help? Thanks!!!
code:
import com.estimote.sdk.EstimoteSDK;
import com.estimote.sdk.BeaconManager;
import com.estimote.sdk.telemetry.EstimoteTelemetry;
import java.util.List;
public class MainActivity extends AppCompatActivity {
private BeaconManager beaconManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
beaconManager = new BeaconManager(this);
beaconManager.setTelemetryListener(new BeaconManager.TelemetryListener() {
private List<EstimoteTelemetry> telemetries;
@Override
public void onTelemetriesFound(List<EstimoteTelemetry> telemetries) {
for (EstimoteTelemetry tlm : telemetries) {
Log.d("TELEMETRY", "beaconID: " + tlm.deviceId +
", temperature: " + tlm.temperature + " °C");
}
}
});
}
@Override
protected void onResume() {
super.onResume();
}
private String scanId;
@Override protected void onStart() {
super.onStart();
beaconManager.connect(new BeaconManager.ServiceReadyCallback() {
@Override
public void onServiceReady() {
scanId = beaconManager.startTelemetryDiscovery();
}
});
}
@Override protected void onStop() {
super.onStop();
beaconManager.stopTelemetryDiscovery(scanId);
}
}