Twilio Programmable Voice SDK for Android allows you to add voice-over-IP (VoIP) calling into your native Android applications.
For step-by-step instructions to get up and running with the Android SDK for Programmable Voice, check out the Quickstart on Github.
To make sure your app is ready for Android 11 please visit this page.
When using the Voice Android SDK with Twilio Regions, please make sure the SDK version is updated to at least 6.1.0
Developer tools and configuration options for Programmable Voice can be found in the Programmable Voice Dashboard. Use the Console to create TwiML apps, update push credentials, view logs, and much more.
The Programmable Voice Android SDK supports armeabi-v7a
, arm64-v8a
, x86
, and x86_64
architectures, as well as emulator images for these architectures.
The SDK supports Android API Level 21 (lollipop) and higher.
Voice Android SDK uses TLS 1.2 for secure communications.
To build the associated Quickstart project you will need Android Studio with installed SDK Platform for API Level 21, as well as the supporting libraries.
To install the latest Programmable Voice Android SDK add the following configuration to your build.gradle
file:
_10allprojects {_10 repositories {_10 mavenCentral()_10 }_10}_10_10dependencies {_10 // The Voice SDK resides on Maven Central_10 implementation 'com.twilio:voice-android:5.7.2'_10}
The SDK source and target compatibility is now set to Java 8. Starting with Voice Android SDK 5.4.1, the SDK is no longer binary compatible with applications that target Java 7. In order to use this and future releases, developers must upgrade their applications to target Java 8. Follow the snippet below for reference:
_10android {_10 compileOptions {_10 sourceCompatibility 1.8_10 targetCompatibility 1.8_10 }_10}
In order to target Android API level 21 or later, you will need to ensure that your application requests runtime permissions for microphone access. To do this, perform the following two steps:
First, add the following to your Android Manifest file:
_10<uses-permission android:name="android.permission.RECORD_AUDIO"/>
Second, request microphone permissions from within your application code:
_10ActivityCompat.requestPermissions(this,_10 new String[]{Manifest.permission.RECORD_AUDIO}, MIC_PERMISSION_REQUEST_CODE);_10}
See the Official Android Documentation for more details.
Starting with the Programmable Voice Android SDK 3.2.0 release, the SDK requires an updated set of ProGuard rules. The following snippets provide the correct ProGuard rules based on the release used by your application.
_10# Twilio Programmable Voice_10-keep class com.twilio.** { *; }_10-keep class tvo.webrtc.** { *; }_10-dontwarn tvo.webrtc.**_10-keep class com.twilio.voice.** { *; }_10-keepattributes InnerClasses
_10# Twilio Programmable Voice_10-keep class com.twilio.** { *; }_10-keep class org.webrtc.** { *; }_10-dontwarn org.webrtc.**_10-keep class com.twilio.voice.** { *; }_10-keepattributes InnerClasses
These rules ensure that the Programmable Voice library is not removed by ProGuard.