Skip to content

Instantly share code, notes, and snippets.

@kayahanbaskeser
Created June 30, 2020 13:15
Show Gist options
  • Save kayahanbaskeser/d8959159680cf7bae0f4fc703c811d58 to your computer and use it in GitHub Desktop.
Save kayahanbaskeser/d8959159680cf7bae0f4fc703c811d58 to your computer and use it in GitHub Desktop.
HiHealthOptions options = HiHealthOptions.builder().build();
AuthHuaweiId signInHuaweiId = HuaweiIdAuthManager.getExtendedAuthResult(options);
AutoRecorderController controller = HuaweiHiHealth.getAutoRecorderController(context, signInHuaweiId);
controller.getRecords().addOnCompleteListener(new OnCompleteListener<List<Record>>() {
@Override
public void onComplete(Task<List<Record>> task) {
Log.i("AutoRecorderTest","getAllRecords:onComplete");
if (task.isSuccessful()) {
Log.i("AutoRecorderTest","getAllRecords Successfully");
List<Record> result = task.getResult();
if (result == null) {
return;
}
if (result.size() == 0) {
Log.i("AutoRecorderTest","getAllRecords there is no any record exits");
return;
}
for (Record record : result) {
Log.i("AutoRecorderTest","getAllRecords Record : " + record.toString());
}
}
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(Exception e) {
Log.i("AutoRecorderTest","getAllRecords Failed: " + e.getMessage());
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment