Initialization
This section contains the necessary methods to init Biometrid Standard.
In order to use any of the SDK functionalities, the application needs to initialize it first, using the credentials provided during the enrollment on our platform (see prerequisites section above).
BiometridFull.INSTANCE.initialize(
BIOMETRID_API_SERVER_URL,
BIOMETRID_APP,
BIOMETRID_CREDENTIAL,
BIOMETRID_APP_URL,
customHeaders,
this);
Parameter
Description
String BIOMETRID_APP
Application key provided
String BIOMETRID_CREDENTIAL
Credential provided
String BIOMETRID_SERVER_URL
URL credential provided
String BIOMETRID_APP_URL
App URL provided
HashMap<String, String> HashMap
Custom Headers
InitializationCallback callback
Result callback
The method above requires the callback to be linked with an activity to obtain the application Context, however this method is not required. When implementing the InitializationCallback outside of an activity, prefer using the following method:
BiometridFull.INSTANCE.initialize(
BIOMETRID_API_SERVER_URL,
BIOMETRID_APP,
BIOMETRID_CREDENTIAL,
BIOMETRID_APP_URL,
customHeaders,
this,
context);
Parameter
Description
String BIOMETRID_APP
Application key provided
String BIOMETRID_CREDENTIAL
Credential provided
String BIOMETRID_SERVER_URL
URL credential provided
String BIOMETRID_APP_URL
App URL provided
HashMap<String, String> HashMap
Custom Headers
InitializationCallback callback
Result callback
Context context
Context of your app
Implementation example
class ExampleActivity extends AppCompatActivity implements InitializationCallback, InterfaceCallback {
String TAG = getClass().getSimpleName();
String BIOMETRID_API_SERVER_URL = "your server URL";
String BIOMETRID_APP = "your app";
String BIOMETRID_CREDENTIAL = "your credential";
String BIOMETRID_APP_URL = "app URL";
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try{
BiometridFull.INSTANCE.initialize(
BIOMETRID_API_SERVER_URL ,
BIOMETRID_APP,
BIOMETRID_CREDENTIAL,
BIOMETRID_APP_URL,
new HashMap<>(),
this);
} catch (UnableToConnectException e) {
e.printStackTrace();
}
}
@Override
public void initializationCallback(boolean status, @Nullable Errors error) {
Log.d(TAG, "initializationCallback-> status: " + status);
if(error != null) Log.e(TAG, "initializationCallback-> error: " + error.name());
}
@Override
public void processCreated(String processId) {
Log.d(TAG, "Process created -> id: " + processId);
}
@Override
public void processFinished() {
Log.d(TAG, "Process finished");
}
@Override
public void interfaceStarted() {
Log.d(TAG, "Interface started");
}
@Override
public void interfaceClosed() {
Log.d(TAG, "Interface closed");
}
}
Callback params
Parameter
Description
Boolean status
Receive status on initialization
Errors error
Errors associated enum
Was this helpful?