TechTrue® Android SDK  

V1.3.7

Android SDK for TechTrue®'s face recognition
Introduction

This documentation regards to the Android AAR library container TechTrue's Face Recognition software.

Begin

To begin with the SDK, see br.com.techmag.ttface.TTFaceRecognitionService.

Device authentication

To be able to use this SDK, you must have an application key registered at TechTrue's platform. Then, you must add this key to your app using one of the following options:

Using a text file

Using a file inside your app's root folder:

This file must contain only the application key and must be named as app_key.txt, like the example below:

XXXXXXXXXX-XXXXXXXXXX-XXXXXXXXXX

One can use the following snippet to programmatically set the application key into the SDK:

try {
OutputStreamWriter outputStreamWriter =
new OutputStreamWriter(ctx.openFileOutput("app_key.txt", Context.MODE_PRIVATE));
outputStreamWriter.write("XXXXXXXXXX-XXXXXXXXXX-XXXXXXXXXX");
outputStreamWriter.close();
}
catch (IOException e) {
Log.e("Exception", "File write failed: " + e.toString());
}

Using a string resource

Using Android's string resources, registered to your app, like the example below:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_key">APP-KEY</string>
</resources>

This file is usually placed at res/values/*.xml inside your app's project.

Exception

If the device cannot be authenticated, SDK instance will be null and the instantiation method will throw an exception with br.com.techmag.ttface.TTErrorCodes.TTFACEAPI_E_DEVICENOTACTIVATED.

The authentication flow requires internet connection for the app's first-time execution. After the first run, no internet requests will be done as long as the app is not uninstalled.