January 17, 2021
Hot Topics:

Exploring Android SDK Support for SIP

  • By Lauren Darcey & Shane Conder
  • Send Email »
  • More Articles »

The SIP APIs introduced in Android 2.3 (API Level 9) enable developers to write all sorts of new applications. SIP is the driving protocol behind VoIP (Voice over IP) softphone applications (Skype-style).

What Is Session Initiation Protocol (SIP)?

Session Initiation Protocol, or SIP, is a protocol for text, voice and video communication over the network. SIP communication operates very similarly to the HTTP request and response model.

For more of the technical details, you might want to check out Webopedia's SIP page or peruse the RFC-3261 standard. Be aware that the SIP API takes care of most of the details. As with any protocol, having some familiarity helps, though.

Why Would I Use the Android SIP API?

SIP can be used to build applications that include voice calling, with little additional effort. Imagine creating a shopping application with a direct calling feature. Without leaving the app. Without using any of the users minutes or even requiring that they're on a phone (tablet, TV?). Or an app with voice support provided inside the app itself. Imagine easily adding voice chat to a game. Or a news reader where readers can connect and discuss what they're reading. It can be used to turn just about any Android device -- or app -- into a smart-softphone, as it were.

The SIP APIs will likely become more popular and more widely used as Android devices grow beyond smartphone markets and traditional telephony features are not always guaranteed on a given device (e.g. tablets, TVs, etc.).

What Android Devices Support SIP?

The SIP APIs were not introduced until Android 2.3, so you'll want to target only devices running API Level 9 or higher in your application's Android manifest file.

<uses-sdk android:minSdkVersion="9" />

That said, not all devices have SIP capabilities; only a subset do. Therefore, you'll need to add a filter in your Android manifest file to specify that SIP is required by your application (and thus will be filtered appropriately by the Android Market).

<uses-feature android:name="android.hardware.sip.voip" />

At minimum, you'll also need to add two permissions to your application in order to access SIP device features and the internet in general:

<uses-permission android:name="android.permission.USE_SIP" />
<uses-permission android:name="android.permission.INTERNET" />

If your application uses the SIP APIs to make audio calls, you'll likely also need the following permissions for working with audio on the device:

<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

Programmatically, you should also check at runtime before using any SIP and VoIP device features using the SipManager.isVoipSupported() and the SipManager.isApiSupported() static methods.

Originally published on https://www.developer.com.

Page 1 of 2

This article was originally published on August 30, 2011

Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Thanks for your registration, follow us on our social networks to keep up-to-date