3.1 Installation and Dependencies

VYou-SDK for Android

The VYou SDK provides two modules, the core module that provides an API to interact directly with the backend and authenticate your users; and the UI module, in which you will have developed the interface to interact with dynamic forms, such as registration or profile. Those modules are structured as follows

VYou-Core

Install

In order to install the VYou-Core SDK in your Android application you’ll need to add the following dependency inside your application-level build.gradle file

implementation "io.github.apiumhub:vyou-core:1.0.2

Also, if you don’t have mavenCentral() as a repository, you should add it to your project-level build.gradle file

allprojects {
    repositories {
        mavenCentral()
        ...
    }
}

Setup

You’ll need to include to your AndroidManifest the following permissions, to allow the SDK to perform network operations.

<uses-permission android:name="android.permission.INTERNET" />

There are a few parameters that you need to provide to the SDK in order to make it work properly. They must be provided via AndroidManifest’s <meta-data>, and are read autommatically by the SDK when needed. Those parameters are the following:

<meta-data
android:name="vyou_client_id"
android:resource="@string/VYOU_CLIENT_ID"
android:value="string" />
<meta-data
android:name="vyou_redirect_uri"
android:resource="@string/VYOU_REDIRECT_URI"
android:value="string" />
<meta-data
android:name="vyou_url"
android:resource="@string/VYOU_URL"
android:value="string" />
<meta-data
android:name="google_client_id"
android:resource="@string/GOOGLE_CLIENT_ID"
android:value="string" />
<meta-data
android:name="facebook_app_id"
android:resource="@string/FACEBOOK_APP_ID"
android:value="string" />

Our proposed approach for including all of this data is adding them via build.gradle such as:

resValue "string", "VYOU_CLIENT_ID", "8XxbGzbBAAbapQ9t*******KDw9h0KBWQYvT2P67T42lAlrZrG7KWg"
resValue "string", "VYOU_REDIRECT_URI", "vyouapp://com.vyouapp.auth"
resValue "string", "VYOU_URL", "<https://test.vyou-app.com:8380>"
resValue "string", "GOOGLE_CLIENT_ID", "975381680954-klti62p4c***ti9tikbglf.apps.googleusercontent.com"
resValue "string", "FACEBOOK_APP_ID", "83431****8440"

This allows you to setup those values by environment read them from any external file (such as local.properties) in case you need to.

Once you have all of those values in place, the last thing you need to do is initialize the SDK along with your application. In order to do that, you need to call the following method in your Application class

VYou.initialize(this)
Scroll to Top