Cloudike Android Libraries

Cloudike Android Libraries - set android SDK which provides various functions for working with cloud storage. This SDKs is stored in the private maven repo and developed for use with the Cloudike Backend. If you need access, please Contacts Us.

Concept

A total of six libraries are presented. The main Core library and five functional libraries:

  • Core A basic library containing common primitives and functionality that other libraries depend on.

  • Photos A library for working with media storage.

  • Files A library for working with file storage.

  • Document wallet A library for working with encrypted document storage.

  • Contacts - Library for backup contacts.

  • Cleaner - A library for removing local "garbage" resources.

Core Library

The Core library is the foundation upon which other functional libraries are built. The root of this library is the data model, which represents the User-Resource relationship, in which resources depend on users, and users are linked to each other by a Parent-Child relationship.

The general functionality contained in the Core Library is divided into utility and functional.

  • Utility - performs a specific (non-complex) task, such as a network call, formatting a logging string, or writing to a database.

  • Functional - performs a complex task (logging, downloading, session management). Often, this involves a network call and writing to a database.

A number of functional utilities are split between libraries. For example, sharing—the main common methods are concentrated in the Core Library, while specific ones, such as opening a shared file or album link, are located in the Photo Library and File Library.

To implement certain functionality, the user must use functional methods, but they can also use utility methods that seem useful in the context of what they want to accomplish.

Users

Some libraries, such as Photos Library, have many methods that require a user ID as a parameter. This tells the library which user's resource it will be accessing.

Users are divided into different categories, which may be expanded over time. Some of them are associated with specific functionality and are virtual, while others are real users (shared with me). Here are some examples:

  • Main User - the user under which the library user (you) works

  • Family User - a virtual user - the owner or family member

  • Shared User - a user associated with someone else's resource shared with you

Session

A session is the internal lifecycle through which most of the functionality of all libraries operates. To get started, a session must be properly initialized (at application startup) and terminated correctly (when the user logs out). A special component, SessionManager, in the Core Library is responsible for managing sessions.

Implementation

Libraries require 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 build.gradle file.

buildscript {  
repositories {
maven {
url = uri("https://rt.cloudike.com/artifactory/libs-release-local")
credentials {
username = "artifactory_username"
password = "artifactory_password"
}
}
}
}

Then, add a required dependency as shown below. You must use one version for all dependencies.

val version = "version"

dependencies {
// Base library
implementation("com.cloudike.sdk:core:$version")

// Features libraries.
implementation("com.cloudike.sdk:contacts:$version")
implementation("com.cloudike.sdk:cleaner:$version")
implementation("com.cloudike.sdk:documentwallet:$version")
implementation("com.cloudike.sdk:files:$version")
implementation("com.cloudike.sdk:photos:$version")
}

In the application code:

// Build core manager.
val coreContext: CoreContext = CoreManager.build(applicationContext)

// Build libraries.
val documentWalletManager = DocumentWalletManager.build(coreContext)
val cleaner = CleanerManager.build(coreContext, /**/)
val photoManager = PhotoManager.build(coreContext, /**/)
val fileManager = FileManager.build(coreContext, /**/)
val contactManager = ContactManger.build(coreContext, /**/)

val session = coreContext.sessionManager

// Starts session every time when launch your app.
session.start(
reset = false, // if true, then performs the session.stop() procedure at the beginning
baseUrl = "https://my.domain.com/",
accessToken = "Backend access token",
profileId = "user profile id",
userAgent = "my user agent"
)

// Then use features functions with features or core libraries.
// ...

// Stop session after logout
session.stop()

More

More detailed information is stored in the corresponding modules that describe the libraries.

All modules:

Link copied to clipboard

Library for removing local "garbage" resources.

Link copied to clipboard

Library for working with the contact repository.

Link copied to clipboard

A basic library containing common primitives and functionality that other libraries depend on.

Link copied to clipboard

Document Wallet is a library for working with secure storage.

Link copied to clipboard

Library for working with file storage.

Link copied to clipboard

Library for working with cloud photos.