Created
June 30, 2020 13:13
-
-
Save kayahanbaskeser/8886ca9f996b7abb7e7927372417757f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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