How to use Android FaceAI SDK?
Perform the following tasks to implement the EnxFaceAIAndroid SDK:
Maven
Use the supported Maven version for integrating the Android FaceAI SDK with your application and make necessary modifications to your app-level gradle file to download the SDK.
- Edit the build.gradle file for your project and add the following code snippet to the allprojects.repositories section of the file:
allprojects {repositories {maven {url "https://dl.bintray.com/enablex/maven"}}}
- Modify the build.gradle file for your module and add the following code snippet to the dependencies section of the file:
implementation 'XYZ'
Permissions
Define the permissions in the AndroidManifest.xml file as shown below.
<uses-permission android:name="android.permission.CAMERA"/><uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/><uses-permission android:name="android.permission.RECORD_AUDIO"/><uses-permission android:name="android.permission.INTERNET" /><uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/><uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/><uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/><uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/><uses-permission android:name="android.permission.BLUETOOTH"/><uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
Features
Define the features in the AndroidManifest.xml file as shown below.
<uses-feature android:name="android.hardware.camera"/><uses-feature android:name="android.hardware.camera.autofocus"/><uses-feature android:glEsVersion="0x00020000" android:required="false"/>
Note: You must enable FaceAI while defining a room for the facial expression analysis to work. To enable it, use the following setting in JSON Payload to create Room:
{ "settings": {"facex": true;}}