API

Common

Getting Started
Errors and Codes

User

Register
Login
Get User Profile
Update Profile
Upload Avatar
Reset Password
Logout
Get Public User Profile

User Token

List Tokens
Add Token
Delete Token
Set Default Token
Verify Token
Reset Verification

User vAtom

Get vAtoms by IDs
Get vAtom Inventory
Search vAtoms
Get Actions
Perform Actions
Trash vAtom

User Activity

Get My Threads
Get My Thread Messages
Send Message

Map

Geo Discover vAtoms
Geo Discover vAtom Groups

Update Stream

Web Socket

Face Infrastructure

Face View Registration
Vatom View
Face Selection Procedure

Getting Started

App Registration

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:

  1. App ID: A unique identifier that identifies your app in our system.
  2. Publisher domain: A unique domain that represents your project or organization. On this publisher domain you have sufficient rights to create templates, register faces and action, and emit vAtoms.

Overview

The Android SDK makes integration with the BLOCKv platform easy. It handles a number of operations on your behalf, including:

  • Wrapping API endpoints,
  • Parsing JSON to native Java models,
  • Managing OAuth2 tokens, and
  • Interacting with the web socket.

Requirements

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.

Install and configure the SDK

Add the BLOCKv maven repository and Kotlin plugin to the root-level build.gradle file:

build.gradle

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):

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:

AndroidManifest.xml

<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:

Imports

import io.blockv.core.Blockv

Configure your BLOCKv integration

Next create an instance of the BLOCKv SDK

Configuration example

    // ...
    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

©2020 BLOCKv
Info