Skip to content

Setapp is an android SDK that lets you change the behavior and appearance of your app without requiring a rebuilt app.

License

Notifications You must be signed in to change notification settings

setapp-io/setapp-android-sdk

Repository files navigation

setapp

Maven Central Build

Setapp is an android application that lets you change the behavior and appearance of your app without requiring a rebuilt app. When using the setapp client library, you call settings with in-app default values that control the behavior and appearance of your app. Then, you can later use the setapp application to override in-app default values for the app. See the project website for documentation.

setapp demo

To set up setapp SDK for Android, you need to add the necessary dependencies to your app.

Dependencies

Setapp is distributed through mavenCentral. To use it, you need to add the following to your project's root build.gradle file

repositories {
    mavenCentral()
}

Add the following to your project's build.gradle file

dependencies {
    debugImplementation "io.setapp:setapp:${setapp_version}"
    releaseImplementation "io.setapp:setapp-noop:${setapp_version}"
}

Please note that our io.setapp:setapp-noop package provides empty implementations.

Usage

For getting value from setapp application just cal one of the following methods.

Get int value

val value: Int = Settings.getInt("YOUR_KEY_HERE", -1)
val value: Int? = Settings.getIntOrNull("YOUR_KEY_HERE")

Get long value

val value: Long = Settings.getLong("YOUR_KEY_HERE", -1L)
val value: Long? = Settings.getLongOrNull("YOUR_KEY_HERE")

Get float value

val value: Float = Settings.getFloat("YOUR_KEY_HERE", -1F)
val value: Float? = Settings.getFloatOrNull("YOUR_KEY_HERE")

Get string value

val value: String = Settings.getString("YOUR_KEY_HERE", "")
val value: String? = Settings.getStringOrNull("YOUR_KEY_HERE")

Get boolean value

val value: Boolean = Settings.getBoolean("YOUR_KEY_HERE", false)
val value: Boolean? = Settings.getBooleanOrNull("YOUR_KEY_HERE")