Verdict Capture Android Integration
There is no separate Android library. A native Android app sends photos to the Verdict Capture REST API with OkHttp or Retrofit, opens a hosted inspection link in Custom Tabs for guided vehicle inspections, or, if it is built with React Native or Flutter, uses our SDK for that framework.
Quick Start
1. Install
// app/build.gradle.kts: no Verdict Capture artifact, only standard libraries.
dependencies {
implementation("com.squareup.okhttp3:okhttp:4.12.0") // REST calls
implementation("androidx.browser:browser:1.8.0") // Custom Tabs for hosted inspections
}
// AndroidManifest.xml
// <uses-permission android:name="android.permission.INTERNET" />2. Use
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.MultipartBody
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody.Companion.toRequestBody
import org.json.JSONObject
import java.io.IOException
private val http = OkHttpClient()
// POST /api/v1/verify with the photo as multipart form data.
// Blocking: call it off the main thread, e.g. withContext(Dispatchers.IO) { ... }.
fun verifyPhoto(jpeg: ByteArray, policy: String, apiKey: String): JSONObject {
val body = MultipartBody.Builder()
.setType(MultipartBody.FORM)
.addFormDataPart("policy", policy)
.addFormDataPart("image", "photo.jpg", jpeg.toRequestBody("image/jpeg".toMediaType()))
.build()
val request = Request.Builder()
.url("https://verdictcapture.com/api/v1/verify")
.header("X-API-Key", apiKey)
.post(body)
.build()
http.newCall(request).execute().use { response ->
val json = JSONObject(response.body!!.string())
if (!response.isSuccessful) throw IOException("Verdict Capture " + response.code + ": " + json.optString("error"))
return json
}
}
// val result = verifyPhoto(jpegBytes, "scooter_parking", apiKey)
// if (result.getBoolean("is_compliant")) endRide() else show(result.getString("feedback"))Features
Plain HTTPS
One multipart POST to /api/v1/verify with an X-API-Key header, from OkHttp, Retrofit or Ktor. No Verdict Capture library or repository to add.
Hosted Guided Inspections
Open a signed inspection link in Custom Tabs. Framing guides, retakes, camera access and submission run on our page, with no camera code in your app.
Signed Results on Your Backend
verification.completed and inspection.submitted webhooks arrive signed at your server, so a decision never depends on what the device reports.
Keys Stay Server-Side
For inspections, your backend creates the session with your API key and the app receives only an expiring capture link.
Cross-Platform SDKs
Building with React Native or Flutter? Those SDKs add a camera scanner with retry guidance, an offline queue and a native guided inspection screen.
Same API Everywhere
The request and response are identical from Android, iOS, a browser or a server, so one backend integration serves every client.
Code Examples
Requirements
- Android 5.0 (API 21) or later (OkHttp 4)
- INTERNET permission; CAMERA permission if your app captures the photo
- A Verdict Capture API key; for inspections it stays on your backend
- An HTTPS return_url verified as an App Link if the hosted inspection should return to your app
Frequently Asked Questions
Add Photo Verification to Your Android App
Get an API key and send your first verification from Kotlin today.
Other ways to integrate
Mobile SDKs, server-side HTTP examples, the REST API, webhooks, and no-code automation platforms.