Posted on by & filed under Content - Highlights and Reviews, Programming & Development.

C. Enrique Ortiz is a long-time Mobilist, product dev-guy, and developer advocate who focuses on Mobile & Cloud software. He works at Shango, the Cloud-based Marketplace for IP-based communication services. He also is co-creator of Kloc, helping developers effortlessly create visually awesome and interactive Developer Portfolios.

Enabling voice communication on Android apps is possible via the Session Initiation Protocol (SIP) stack. This protocol originated in 2000 as a signaling protocol in support of Voice over IP (VoIP). With today’s move to IP wireless networks such as LTE, SIP is the core signaling protocol for voice over IP Multimedia Subsystems (IMS). In this post we will explore how to enable voice communication on Android apps by using the Android Session Initiation Protocol (SIP) stack. With the transformation of traditional networks as IP-networks, and the future of voice as a “data app,” expect media-rich and location-aware communication apps, where the smartphone plays a central role in personal communications. This means that developers can now create a new breed of voice communication apps like never before. This post assumes you are somewhat familiar with the Android platform and the Java language.

General Requirements

Note that Android provides support for the SIP API starting with Android 2.3. To take advantage of SIP in your Android apps, you must also have a SIP account to use against a SIP Provider. SIP runs over a wireless data connection, so your device must have a data connection (with a mobile data service or Wi-Fi). In addition, you can only test on a physical device, you can’t test on AVD.

Main SIP classes

Android provides a number of classes and interfaces in support of SIP. Below are the main ones to get started with.

Class Description
SipManager Defines the SIP API (Singleton)
SipProfile Defines a SIP profile account (server, credentials, etc.)
SipAudioCall Handles an Internet audio call over SIP
BroadcastReceiver Listener for incoming calls

Manifest File

When you start with your Android app, be sure to set the proper permissions in the Manifest file; request: 1) INTERNET and 2) USE_SIP permissions:

Initializing the App

Now, be sure to initialize your app. As usual, set the ContentView, your intents and so on. Also, get the SipManager instance:

The SIP Profile

Now you build the SipProfile for your SIP account. Set the password, port, protocols and other information. Set the incoming call Intent, and the registration listeners:

Listening for Incoming Call

To receive calls, set the Incoming Call Receiver, which is a BroadcastReceiver. Once the incoming call is received, the call is answered by the listener:

Initiate a Call

Initiating the call consists of setting up a SIP audio call listener first to handle the call itself when it is established. And of course, an important step is making the call itself:

Some Good Practices

There are a few good practices to keep in mind when developing voice communication apps on Android. The first one is to call SipManager.isVoipSupported() to verify that the device supports VOIP calling. The second one is to call SipManager.isApiSupported() to verify that the device supports the SIP APIs.


In this short post we explored how to enable voice communication on Android apps by using the Android SIP stack. We explored how to set the manifest file, the SIP profile, and how to initiate and listen for calls, as well as some good practices to follow.

For more details about developing Android apps, see the resources below from Safari Books Online.

Not a subscriber? Sign up for a free trial.

Safari Books Online has the content you need

Expert Android gives you advanced techniques for customizing views, controls, and layouts. You’ll learn to develop apps in record time using JSON, Advanced Form Processing, and the BaaS (Backend As A Service) platform Parse. The book also includes extensive coverage on OpenGL, Search, and Telephony. With these advanced and time saving technologies you’ll be able to release compelling mobile applications in Google Play and the Amazon Appstore at a rapid pace.
Embedded Android is for Developers wanting to create embedded systems based on Android and for those wanting to port Android to new hardware, or creating a custom development environment. Hackers and modders will also find this an indispensable guide to how Android works.
Android Cookbook helps you find solutions for working with Android user interfaces, multitouch gestures, location awareness, web services, and device features such as the phone, camera, and accelerometer. You also get useful steps on packaging your app for the Android Market.

About the author

ceo C. Enrique Ortiz is an industry-recognized Mobilist, Author and Blogger. He is a Product Dev-guy at Shango, the Cloud-based Marketplace for IP-based communication services. He is co-founder of Kloc, which helps developers to effortlessly create visually awesome and interactive Developer Portfolios. Create your own Developer Portfolio by visiting and share with others.

Tags: android, Incoming Call Receiver, IP Multimedia Subsystems, KitKat, Session Initiation Protocol, SIP, SIP Provider,

Comments are closed.