Before setting build.gradle, please download the ARGear SDK library from https://argear.io. You will first need to create an account from the website. The ARGear SDK library (argear.aar) can be found in “Download Free SDK” menu. Once downloaded, place the downloaded ARGear library under the libs directory as shown below.
In order to use ARGear, please note that Android SDK Platform version 6.0 (API level 23) or above should be set. Also, the Application ID must match the Application ID configured in the target ARGear Console project. The build.gradle of your application should be set as shown below.
defaultConfig {
// ARGear Console Project Application ID
applicationId "com.seerslab.argear.sample"
// Android SDK Platform version 6.0 (API level 23) or higher
minSdkVersion 23
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a'
}
}
repositories {
flatDir {
dirs 'libs'
}
}
dependencies {
// To add ARGear library
implementation (name: 'ARGear-release-0.1.0', ext:'aar')
// To add TensorFlow Lite library
implementation 'org.tensorflow:tensorflow-lite:1.14.0'
implementation 'org.tensorflow:tensorflow-lite-gpu:1.14.0'
// To add Retrofit library
implementation "com.squareup.retrofit2:retrofit:2.4.0"
implementation "com.squareup.retrofit2:converter-gson:2.4.0"
implementation "com.squareup.okhttp3:logging-interceptor:3.10.0"
// To add gson library
implementation "com.google.code.gson:gson:2.8.5"
}
2.2 AndroidManifest.xml
The ARGear library requires several permissions for user privacy issues, which includes camera, internet, read and write external storage, and audio. Except audio recording permission, the other permissions are required to be enabled. Depending on your needs, you can selectively allow audio recording permission.
To enable those accessibilities, you should set AndroidManifest.xml as below.
In order to use ARGear, you need to set the API URL and API Key in your application and the package name should be same as Application ID. To do so, first, you need to create a project in ARGear Console (https://console.argear.io). Then, you can check the corresponding API URL and Key from Project Overview > Information.
Below is sample code of an ARGear Sample App.
<Example Configuration Settings of a Sample App>
public static final String API_URL = "https://apis.argear.io";
public static final String API_KEY = "fe49fe8fe8c757e5a4f8d48d";
public static final String SECRET_KEY = "5c3b1c9540b4d76134596fd3e9acb2a1aef55245a9980fdd26064ea6b8c5c48c";
public static final String AUTH_KEY = "U2FsdGVkX1/GtbZ6o6rv2Yu5d3iUvs1iAogzDf47WC1RBZmHQyociXlqrV/DXJ4+yrogIDSI90mEbwcQ8Q0DNw==";