Skip to main content

Installation

KraftShade is available on Maven Central and can be easily integrated into your Android project using Gradle.

Requirements

  • Android API level 21 (Android 5.0 Lollipop) or higher
  • Kotlin 1.5.0 or higher
  • OpenGL ES 2.0 support on the target device

Adding Dependencies

You can add KraftShade to your project using one of the following methods:

Gradle (build.gradle.kts)

dependencies {
// Core library
implementation("com.cardinalblue:kraftshade:latest_version")

// Optional: Jetpack Compose integration
implementation("com.cardinalblue:kraftshade-compose:latest_version")
}

Replace latest_version with the current version of KraftShade. You can find the latest version by checking the badges at the top of the GitHub repository or by visiting the Maven Central repository.

Version Catalog (libs.versions.toml)

If you're using Gradle's version catalog feature, add the following to your libs.versions.toml file:

[versions]
kraftshade = "latest_version"

[libraries]
kraftshade-core = { group = "com.cardinalblue", name = "kraftshade", version.ref = "kraftshade" }
kraftshade-compose = { group = "com.cardinalblue", name = "kraftshade-compose", version.ref = "kraftshade" }

Then in your module's build.gradle.kts file:

dependencies {
implementation(libs.kraftshade.core)
// Optional: Jetpack Compose integration
implementation(libs.kraftshade.compose)
}

Setting Up Logging

It's recommended to initialize KraftShade's logging system in your Application class:

class App : Application() {
override fun onCreate() {
super.onCreate()

// Set the log level (DEBUG, INFO, WARNING, ERROR, or NONE)
KraftLogger.logLevel = KraftLogger.Level.DEBUG

// Optionally throw exceptions on errors for easier debugging during development
KraftLogger.throwOnError = true
}
}

Don't forget to register your Application class in your AndroidManifest.xml:

<application
android:name=".App"
...>
<!-- Your application components -->
</application>

Next Steps

Now that you have KraftShade installed, you can: