Skip to content

Instantly share code, notes, and snippets.



Last active Feb 13, 2017
What would you like to do?
LogoBodyModel logoBodyModel = LogoPostBuilder.buildLogoDetectionBody(encodedImage);
Call<LogoResponse> checkImageCall = mService.checkImageLogo(logoBodyModel);
checkImageCall.enqueue(new Callback<LogoResponse>() {
public void onResponse(Call<LogoResponse> call, Response<LogoResponse> response) {
Log.d(TAG, "Got Response");
if(response.body().getResponses() != null &&
response.body().getResponses().get(0).getLogoAnnotations() != null) {
Log.d(TAG, "It's a: " + response.body().getResponses().get(0).getLogoAnnotations().get(0).getDescription());
Log.d(TAG, "With a Score of: " + response.body().getResponses().get(0).getLogoAnnotations().get(0).getScore());
} else {
Log.d(TAG, "Empty response");
textView.setText("No idea!");
public void onFailure(Call<LogoResponse> call, Throwable t) {
Log.e(TAG, "Response Failed");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment