Hi there, we are working on a project to collect telemetry data. In its final shape we want to send signals or push json data to the web when the telemetry value go higher or lower than threshold. For now, we just want to display the data in the app. We have a working code without errors. I see that the data is uploaded to the cloud and visible in the dashboard but not in the app. Perhaps you may know what is wrong with the code?
private BeaconManager beaconManager;
public double temperature;
public double ambientLight;
public Vector magnetometer;
public DeviceId deviceId;
public boolean motionState;
public double pressure;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_estimote_test);
EstimoteSDK.initialize(this, "####", "####");
EstimoteSDK.enableDebugLogging(true);
beaconManager = new BeaconManager(this);
beaconManager.setTelemetryListener(new BeaconManager.TelemetryListener() {
@Override
public void onTelemetriesFound(List<EstimoteTelemetry> telemetries) {
for (EstimoteTelemetry tlm : telemetries) {
temperature = tlm.temperature;
ambientLight = tlm.ambientLight;
magnetometer = tlm.magnetometer;
deviceId = tlm.deviceId;
motionState = tlm.motionState;
pressure = tlm.pressure;
}
}
});
telemetry();
}
public void telemetry() {
TextView a = findViewById(R.id.temperature);
a.setText(String.valueOf(temperature));
TextView b = findViewById(R.id.ambientLight);
b.setText(String.valueOf(ambientLight));
TextView c = findViewById(R.id.magnetometer);
c.setText(String.valueOf(magnetometer));
TextView d = findViewById(R.id.deviceId);
d.setText(String.valueOf(deviceId));
TextView e = findViewById(R.id.motionState);
e.setText(String.valueOf(motionState));
TextView f = findViewById(R.id.pressure);
f.setText(String.valueOf(pressure));
}
@Override
protected void onStart() {
super.onStart();
beaconManager.connect(new BeaconManager.ServiceReadyCallback() {
@Override
public void onServiceReady() {
beaconManager.startTelemetryDiscovery();
}
});
}
@Override
protected void onResume() {
super.onResume();
SystemRequirementsChecker.checkWithDefaultDialogs(this);
}