Version: Next

Getting Started

Before you begin

This SDK is stored in the private maven repo and developed for use with the Cloudike Backend. If you need access, please Contacts Us


  • Minimum API level 21 or later


To enable library in your app, you should add a link to our private repository in the application-level Gradle file (usually app / build.gradle). Then, add a dependency for the libraries cloudikefiles and cloudikelog as shown below:

// ...
repositories {
// ...
maven {
url ""
credentials {
username = "${artifactory_username}"
password = "${artifactory_password}"
// ...
dependencies {
implementation "com.cloudike.cloudikefiles:cloudikefiles:2.2.0"
implementation "com.cloudike.cloudikelog:cloudikelog:1.2.2"


Initialization is performed in two stages.

Stage 1. Initialize library#

The best place for the first stage is the method Application.onCreate(). The first step is to initialize the library Logger. Optionally, you can implement initRxErrorHandler() to log errors that occur in RxJava2.

class App: Application() {
private lateinit var fileManager: FileManager
override fun onCreate() {
// ...
// Initialize logger first because Files SDK uses it
// Optionaly
// initRxErrorHandler()
// Initialize library
fileManager = FileManager.manager
// ...

Lastly, initialize the contacts library using the method FileManager.initInstance().

If you need to use the custom parameters SSL Socket Factory and Trust Manager, use the following guide.

Stage 2. Preparation for work.#

After user has logged in, it is necessary to call FileManager.prepareToWork() for work:

baseUrl = "Base URL of the backend",
token = "Authentication token received during user login",
profileId = "User profile id",
userAgent = "User agent string",
deviceId = "Unique device id"

Optionally: initialization of the RxJava2 error handler

To log errors that occur in RxJava2, it is advisable to initialize the handler:

private fun initRxErrorHandler() {
RxJavaPlugins.setErrorHandler(Consumer { exception ->
var e: Throwable? = exception
if (e is UndeliverableException) {
e = e.cause
if (e is OnErrorNotImplementedException) {
// error received by observer that does not provide onError handler
if (e.cause != null) {
e = e.cause
if (e is IOException || e is SocketException) {
// fine, irrelevant network problem or API that throws on cancellation
Logger.main().i("RxErrorHandler", "Exception caught", e)
if (e is InterruptedException) {
// fine, some blocking code was interrupted by a dispose call
Logger.main().i("RxErrorHandler", "Exception caught", e)
if (e is NullPointerException ||
e is IllegalArgumentException ||
e is UnsupportedOperationException) {
// that's likely a bug in the application
Logger.main().e("RxErrorHandler", "Exception caught", e)
.uncaughtException(Thread.currentThread(), e)
if (e is IllegalStateException) {
Logger.main().e("RxErrorHandler", "Exception caught", e)
// that's a bug in RxJava or in a custom operator
.uncaughtException(Thread.currentThread(), e)
"Undeliverable exception received, not sure what to do", e)


Our SDK uses the following dependencies:

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$KOTLIN_VERSION"
implementation 'androidx.appcompat:appcompat:1.2.0'
// RxJava
implementation "io.reactivex.rxjava2:rxjava:2.2.19"
implementation "io.reactivex.rxjava2:rxkotlin:2.4.0"
implementation "io.reactivex.rxjava2:rxandroid:2.1.1"
// Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.6.4'
implementation 'com.squareup.retrofit2:converter-gson:2.6.4'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.6.4'
implementation 'com.squareup.okhttp3:okhttp:3.14.9'
implementation 'com.squareup.okhttp3:logging-interceptor:3.14.9'
// ASD
implementation "com.cloudike.cloudikelog:cloudikelog:$CLOUDIKELOG_VERSION"