Skip to content

Instantly share code, notes, and snippets.

@kayahanbaskeser
Created June 30, 2020 13:13
Show Gist options
  • Save kayahanbaskeser/8886ca9f996b7abb7e7927372417757f to your computer and use it in GitHub Desktop.
Save kayahanbaskeser/8886ca9f996b7abb7e7927372417757f 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);
DataType dataType = DataType.DT_CONTINUOUS_STEPS_TOTAL;
controller.startRecord(dataType).addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(Task<Void> taskResult) {
if (taskResult.isSuccessful()) {
Log.i("AutoRecorderTest","onComplete startRecordByType Successful");
} else {
Log.i("AutoRecorderTest","onComplete startRecordByType Failed");
}
}
}).addOnSuccessListener(new OnSuccessListener<Void>() {
@Override
public void onSuccess(Void result) {
Log.i("AutoRecorderTest","onSuccess startRecordByType Successful");
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(Exception e) {
Log.i("AutoRecorderTest","onFailure startRecordByType Failed: " + e.getMessage());
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment