Importing the Knomi S Face SDK to a Project¶
To include Knomi S Face SDK in your application requires three steps:
Update the gradle dependencies and include the AARs in the application lib directory.
- Add or update the filetree line to include searching for AARs. i.e. api fileTree(dir: ‘libs’, include: [‘*.aar’])
- The dependency section of your application’s gradle may look like the following:
dependencies {
api fileTree(dir: 'libs', include: ['*.aar'])
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
api 'com.squareup.okhttp3:okhttp:3.10.0'
api 'androidx.appcompat:appcompat:1.0.0'
api 'com.google.android.material:material:1.0.0'
api 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
}
- Copy the Knomi-S-Face-SDK-release.aar from the Release\knomisclient\libs directory to the libs directory of your application.
- Import Knomi S Face SDK into your application code to start using the FaceLiveness classes.
import com.aware.face_liveness.api.FaceLiveness;
import com.aware.face_liveness.api.exceptions.FaceLivenessException;
import com.aware.face_liveness.api.interfaces.ErrorReporterCallback;