Cleaner Library
Library for removing local "garbage" resources.
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.
Requirements
Minimum API level 21 or later.
Uses Jetpack (AndroidX).
Installation
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 as shown below:
// Add these lines to your project level gradle file
repositories {
maven {
url "https://rt.cloudike.com/artifactory/libs-release-local"
credentials {
username = "${artifactory_username}"
password = "${artifactory_password}"
}
}
}
// Add these dependencies to your application level gradle file
dependencies {
implementation 'com.cloudike.sdk.cleaner:{{cloudike_version}}'
implementation 'com.cloudike.sdk:photos:{{cloudike_version}}'
implementation 'com.cloudike.sdk:core:{{cloudike_version}}'
}Initialization
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 dependencies of the cleaner library in the specified sequence.
override fun onCreate() {
super.onCreate()
// ...
// Initialize core first because Cleaner SDK and Photo SDK uses it
val coreManager = CoreManager.build(applicationContext)
// Optionally
// initRxErrorHandler()
// Then, build the photo library as the Cleaner SDK uses it
val photoManager = PhotoManager.build(
coreManager = coreManager,
competitionMode = PhotoManager.CompetitionMode.INTEGRATION,
competitorPackageName = "com.cloudike.NO_COMPETITOR_APP",
enablePeriodicScans = true
)
// Build cleaner library
val cleaner = CleanerManager.build(coreManager)
// ...
}If you need to use the custom parameters ``SSL Socket Factory`` and ``Trust Manager``, use the following #.
Stage 2. Preparation for work.
After user has logged in, it is necessary to call #:
val sessionManager: SessionManager = coreManager.sessionManager
sessionManager.start(
baseUrl = "",
accessToken = "",
profileId = "",
userAgent = ""
)