⌘K

Wandkit introduction

Wandkit is a powerful framework designed to enhance your development experience with features such as screen sharing, debugging tools, real-time logging, and seamless integration with Nativeblocks Studio. This document provides a comprehensive guide to installing, configuring, and utilizing Wandkit and its components, including DevKit.


Get Started

Requirements

Ensure your project meets the following requirements:

  • Uses Android API level 26 or higher
  • Uses Jetpack (AndroidX)
  • Initialized Nativeblocks Core SDK

Install Wandkit

Add the Wandkit dependency to your build.gradle file:

implementation("io.nativeblocks:nativeblocks-wandkit-android:1.1.0")

DevKit

DevKit is a core component of Wandkit that provides development functionalities such as keeping the screen active, auto-connecting to the environment, and remote logging. It is specifically designed to work with the Nativeblocks Studio environment.

Initialize DevKit in your application class or via dependency injection. Ensure that DevKit is configured after the Nativeblocks SDK is initialized.

Restrict the usage of DevKit to debug builds to avoid unintended behavior in production:

import android.app.Application
import io.nativeblocks.core.api.NativeblocksManager
import io.nativeblocks.wandkit.DevKit

class MyApplication : Application() {

    override fun onCreate() {
        super.onCreate()

        // Initialize Nativeblocks SDK
        NativeblocksManager.initialize()

        // Configure DevKit
        if (BuildConfig.DEBUG) {
            val devKit = DevKit.Builder()
                .keepScreenOn()
                .autoConnect()
                .enableLogging()
                .build()

            NativeblocksManager.getInstance().wandkit(devKit)
        }
    }
}