Android-SDK-Liveness Detection
Preparations
- Register: Please contact ADVANCE Guardian to acquire Account.
- Get accessKey, secretKey
Have a quick look at the Demo
- Install
Guardian-Demo-v1.0.apk
to your Phone. - Login the page and input the verify code that we provided.
Integrate SDK to your project
- unzipping the zip that you download, you will find files as follow:
File/Directory Files | Explanation |
---|---|
liveness | The module of Liveness Detection function |
drawable/light_drawable | Drawable resources of light theme |
drawable/dark_drawable | Drawable resources of dark them |
libaailiveness_v1.0.0.so | different types of so files |
liveness-v1.0.0.aar | aar files, in which liveness detection function was included. |
- Liveness Module is UI module integrated with Liveness Detection function, which can be used in you main project and modified by your actual demand.
- About libaailiveness_v1.0.0.so: aar have x86_64, arm64_v8a, x86 and armeabi-v7a four types of architecture so files. If your project need to depend on other architecture (eg, armeabi), you just copy the .so file to its directory.
-
Import liveness module to you project.
-
Add dependency to liveness module in app project.
-
Add follow codes in app-> build.gradle, Then build the project is OK.
repositories { flatDir { dirs project(':liveness').file('libs') } }
Quick start
- Initialize SDK. There are two types of way to initialize it.
-
No 1: config in code–You could add follow initialization codes in custom application:
GuardianLivenessDetectionSDK.init(this, "your accessKey","your secretKey");
-
No 2: config in Mainifest—You could add configuration in mainfest file:
<meta-data android:name="ai.advance.liveness.accessKey" android:value="your accessKey" /> <meta-data android:name="ai.advance.liveness.secretKey" android:value="your secretKey" />
Then Initialize it in application:
GuardianLivenessDetectionSDK.init(this);
-
PostScript: when these two ways are exist, the first way’s key will be adopted.
- start the liveness detection page:
Liveness detection page not deal with camera permission, please make sure the permission is permitted before enter the page.
startActivity(new Intent(this, LivenessActivity.class));
- liveness module’s code could be modified to meet your demand. More details please refer to [API document Index]
Currently, Chines, English and Indonesian languages/audios are supported in SDK. Meanwhile, two types of UI are available to choose,You could customize your UI by demand.
[API document Index]: Liveness Detection API.html “Look API”
[Demo download site]:https://www.pgyer.com/ZMPt “Download demo”