Last active
February 13, 2017 18:19
-
-
Save zurche/247be5c89ba5eb87a1f0652142d9943e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
LogoBodyModel logoBodyModel = LogoPostBuilder.buildLogoDetectionBody(encodedImage); | |
Call<LogoResponse> checkImageCall = mService.checkImageLogo(logoBodyModel); | |
checkImageCall.enqueue(new Callback<LogoResponse>() { | |
@Override | |
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!"); | |
} | |
} | |
@Override | |
public void onFailure(Call<LogoResponse> call, Throwable t) { | |
Log.e(TAG, "Response Failed"); | |
t.printStackTrace(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment