Before you get started, please create a free developer account.
Once registered, upgrade your developer account to a vAtom publisher account. This will allow you to create app configurations, and importantly, generate an App ID to begin development.
Two important pieces of information you will need after registering as a publisher are:
The Android SDK makes integration with the BLOCKv platform easy. It handles a number of operations on your behalf, including:
The BLOCKv SDK is dependant on Kotlin, if your version of Android Studio < 3.0 you will need to install it. Go to File | Settings | Plugins | Install JetBrains plugin… and then search for and install Kotlin. If you are looking at the "Welcome to Android Studio" screen, choose Configure | Plugins | Install JetBrains plugin… You'll need to restart the IDE after this completes.
Add the BLOCKv maven repository and Kotlin plugin to the root-level build.gradle
file:
buildscript {
ext.kotlin_version = '1.2.61'
//...
dependencies {
//...
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
//...
repositories {
//...
maven {
url "https://maven.blockv.io/artifactory/BLOCKv"
}
}
}
Next, add the Kotlin plugin and following dependencies to your module Gradle file (usually the app/build.gradle
):
apply plugin: 'kotlin-android' //This should be at the top of the file.
// ...
//
dependencies {
// ...
implementation 'io.blockv.sdk:face:3.0.1'
// Make sure android Studio version is > 3.0 or include the Kotlin Plugin
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version'
}
Finally, add the following uses-permission
element to the manifest:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
To access the BLOCKv SDK in your application code, import the class:
import io.blockv.core.Blockv
Next create an instance of the BLOCKv SDK
// ...
protected void onCreate(Bundle savedInstanceState) {
//BLOCKv instance should be maintained as a singleton
Blockv blockv = new Blockv(this,"Your app id");
}
Note: We recommend you use Dagger 2 or any similar library for your singleton management of the BLOCKv SDK