This project is the boilerplate of REST API based Android SDK/library. The example of one REST API based SDK is Microsoft Cognitive Face SDK.
Users can use it as follows:
SystangoRestClient systangoRestClient = new SystangoRestClient("{{API_KEY}}");
systangoRestClient.feature1Method("value1", this);
where value1
is the parameter from user and this
is the callback
@Override
public void onFeature1Response(SampleResponse sampleResponse) {
if (sampleResponse.getError() != null) {
//Use sampleResponse here
String sampleField = sampleResponse.getBaseField();
} else {
//Handle error case here
Toast.makeText(this, sampleResponse.getError(), Toast.LENGTH_LONG).show();
}
}
The example of SDK usage is demonstrated in ExampleActivity.