Created
February 27, 2020 14:32
-
-
Save jaydeepw/a4600e8285681e27e87ab1858f6f9d91 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
// Step 1: Integrate the api_sdk as well in app/build.gradle | |
compile ('com.trustvision:tv_api_sdk:1.0.17@aar') { | |
transitive = true | |
} | |
// Step 2: | |
// If the image is in base64, convert it to byte array | |
// use something like below | |
// byte[] decodedString = Base64.decode(base64String, Base64.DEFAULT); | |
// Step 3: Use its method to upload the image. | |
byte[] imageData = new byte[30]; // data of your image from your backend | |
String imageName = "name_of_your_image"; // this can be null | |
TVApi.getInstance().uploadImage(imageData, imageName, null, new TVCallback<TVUploadImageResponse>() { | |
@Override | |
public void onSuccess(TVUploadImageResponse tvUploadImageResponse) { | |
if (tvUploadImageResponse != null) { | |
String imageId = tvUploadImageResponse.getImageId(); | |
// send this imageId to the faceCompare TS SDK method and the other image | |
// that you capured | |
} | |
} | |
@Override | |
public void onError(List<TVApiError> list) { | |
// handle error | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment