SDK integration

Add maven repository

In the settings.gradle add the following to repositories

maven {
    url ""

Add SDK dependencies

Add the following to any module using the SDK

implementation 'privately-sdk:core:1.0.1'
implementation 'privately-sdk:age-estimation-image:1.0.1'

You're good to go!

Perform an age estimation

Setup the app's Manifest

The age estimation views require access to the camera and make use of the auto-focus feature from Android. The permissions need to be added to the app's Manifest to work properly.

<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="" />
<uses-feature android:name="" />

Make sure you have a set of API key and secret

If you haven't created an account yet, visit … to register for a free trial.

Create a view to handle age estimations

Create a layout file and add the VideoAgeEstimationView to it.

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android=""

        android:layout_height="match_parent" />


Authenticate the core SDK

if (!PrivatelyCore.INSTANCE.isAuthenticated()) {
    PrivatelyCore.INSTANCE.authenticate("API key", "secret key", new PrivatelyCore.AuthenticationCallback() {
        public void onSuccess() {
            Log.e(TAG, "Authenticated successfully");

        public void onError(String error) {
            Log.e(TAG, "Error authenticating: " + error);

Register for age estimation callbacks and init the view

VideoAgeEstimationView ageEstimationView = findViewById(;
AgeEstimationImageCore.registerAgeEstimationCallback(new AgeEstimationImageCallback() {
    public void onVideoAgeEstimationResult(AgeEstimationImageResult ageEstimationImageResult) {
        Log.i(TAG, "Got estimate of " + ageEstimationImageResult.getAgeRange());

    public void onImageAgeEstimationResult(AgeEstimationImageResult ageEstimationImageResult) {


The VideoAgeEstimationView handles the recording and estimation of age, the callback is executed when the estimation completes.