Skip to contentSkip to navigationSkip to topbar
Page toolsOn this page
Looking for more inspiration?Visit the

Twilio Verification SDK for Android - Integration guide


Overview

overview page anchor

The following is the high level overview of how the SDK works to simplify the process of validating a phone number within an application running on Android.

Required components

required-components page anchor
Flowchart showing Twilio Verification SDK on a phone, server interaction, and Twilio API connection.
  1. A mobile application with the SDK installed.
  2. A backend service to receive phone numbers from the App and produce a signed JWT
  3. Have access to Twilio Verification API in the backend, have your mobile application's hash configured within Twilio
Flow between app with Twilio SDK, server, and Twilio Verification API.
  1. App requests to the backend to sign the phone number.
  2. Backend transforms phone number into a JWT. The JWT is the phone number, signed with the customer's AUTHY_API_KEY and an expiration time
  3. Backend sends JWT to Android application.
  4. The Android app, with the JWT, starts the verification with the SDK.
  5. Twilio sends a formatted SMS (including a prefix and a hash) to the device.
  6. Twilio Verification SDK reads the SMS in the background and notifies the app. No SMS_READ permission is needed. The app with the provided result will have a verification token that is proof enough that the phone is valid.

This guide implements a sample app from scratch, integrated with the Twilio Verification SDK and supported by a sample token server.

A more complete sample app is also available.

The code can be directly checked out here: Sample app(link takes you to an external page) - Token Server(link takes you to an external page)

Step-by-step integration guides

step-by-step-integration-guides page anchor
  1. Integrating Twilio Verification SDK using the sample backend
  2. Integrating the Twilio Verification SDK with your own backend
  3. Register your app in Twilio Verification API
  4. SDK Reference

Once the SDK is integrated in your app and your backend is capable of generating the JWT, you're good to go.

You can also make use of the Google's sign-in hint, which auto-fills connected phone numbers for the user and reduce the friction even further. Check out the official documentation(link takes you to an external page) or ask our support team for more information on how to use Google's sign-in hint.

The Twilio Verification Sample App implements this feature and is available on GitHub(link takes you to an external page).

Download Authy from the Google Play Store(link takes you to an external page)