Android

Show the Risk Score SDK in a WebView. No native module is needed.

The flow is documents only, so Android needs nothing beyond a WebView and a file chooser. Requirements: Android 8 (API 26) or later and androidx.webkit:webkit:1.14.0.

  1. Create the session on your backend, exactly as on the web. Return only session_id and client_token to the app. Never ship the API key in an APK.

  2. Load a host page under the origin you registered with Kita. The page is the web quickstart with container set so the flow fills the screen.

    webView.settings.javaScriptEnabled = true
    webView.settings.domStorageEnabled = true
    webView.settings.allowFileAccess = false
    webView.loadDataWithBaseURL("https://app.example.com", hostHtml, "text/html", "UTF-8", null)
  3. Pin navigation to your origin and your Kita host, and refuse everything else in shouldOverrideUrlLoading.

  4. Implement the file chooser. Without it, Choose files does nothing inside a WebView.

    webView.webChromeClient = object : WebChromeClient() {
        override fun onShowFileChooser(view: WebView, callback: ValueCallback<Array<Uri>>, params: FileChooserParams): Boolean {
            pending?.onReceiveValue(null)
            pending = callback
            startActivityForResult(params.createIntent(), PICK_FILES)
            return true
        }
    }
    // in onActivityResult:
    pending?.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, data)); pending = null
  5. Route system Back to kita.back() so Back moves within the flow, and finish the activity when the flow reports it has nothing to go back to.

onSubmitted fires when the borrower finishes. Close the WebView and continue your application flow; processing carries on at Kita.

Sample app

Kita provides a complete sample host, including session resume and the pinned WebView, during onboarding.