Node.js
Set up Imports and Constants
Create the main file: MainActivity.kt
At the top of your MainActivity.kt, include the necessary imports:
package com.vonage.verify2.test
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material3.*
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.unit.dp
import kotlinx.coroutines.*
import okhttp3.*
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
import com.google.gson.Gson
import com.google.gson.JsonObject
import java.io.IOException
Below the imports, define some global variables:
const val BACKEND_URL = "http://10.0.2.2:4000" // Use this IP for local testing
Getting Started with Silent Authentication
Silent Authentication takes quite a bit to understand. This tutorial shows you how to build an integration from scratch with Nodejs and Kotlin
Available on:
Steps
1
Introduction2
Before you start3
Initialize the Project4
Create a Simple Express Server5
Setting up Vonage credentials6
Add the Vonage Verify API7
Testing the Backend8
Create New Android Project9
Set up app Android dependencies10
Set up import and constants11
Create Mobile UI12
Networking to Backend13
Testing Full Flow