SmilePass is a face detection and autoselfie SDK for Android. This repo is the sample which demonstrate how to use SmilePass Face SDK in your app.
SmilePass Face SDK can be used:
- To detect whether an image capture is a live person or a still image or video; called liveness detection.
- To detect face of a person.
- To capture a person's image automatically.
- To detect different gestures of a person i.e. smilepass, blink, wink.
The minimum Android SDK version required to use this SDK is 22
.
This guide is a quick start to add SmilePass Face SDK to an Android app. Android Studio is the recommended development environment for building an app with the SmilePass Face SDK for Android.
Your application needs an API key to access the features of SmilePass Face SDK. You can use it with any of your applications that use SmilePass Mobile SDKs and Cloud APIs. It supports an unlimited number of users. To get an API key, Contact SmilePass.
Add SmilePass Face SDK to your project. To do this, add the following dependency in your app level build.gradle file-
implementation 'com.smilepass.mobilesdk:facesdk:{latest-version}'
The latest version can be found at the top of this file. You can find all versions directly from Bintray.
If gradle is unable to resolve library, please add repositories section in build.gradle-
repositories {
maven {
url "https://dl.bintray.com/smilepass-ltd/maven"
}
}
Add android.permission.INTERNET
permission in your application's AndroidManifest.xml
.
Add following meta-data tag inside <application></application>
tag of your application's AndroidManifest.xml
-
<meta-data
android:name="com.google.android.gms.vision.DEPENDENCIES"
android:value="face" />
Initialize Face SDK with a valid API Key by calling following method-
AutoSelfie.init("{{API_KEY}}", this);
The second argument of init()
method is callback listener. Implement OnApiKeyValidatedListener
and override following method-
@Override
public void onApiKeyValidated(boolean isValidated, String params) {
// your code here
}
You are all set to use the cutting-edge face detection features of SmilePass.
For the detailed information on how to configure different options in SmilePass Face SDK, read our detailed documents-
The core of this library is developed using Google Vision.
SmilePass Face SDK sample application is licensed with the SmilePass License. For more details, see LICENSE.