This is a demo application highlighting how to make internet-based calls with the SIP API. The application uses a walkie-talkie style interface, allowing you to only be heard when the button is pushed down.
The source code for this demo app shows how to accomplish three key things with SIP: Make a call, receive a call, and signal to the Android platform that your app wants to receive incoming SIP calls, so that they can be handled from within the application.
The application includes:
SipSettings
— a PreferenceActivity
that supplies basic settings for SIP
authentication.
IncomingCallReceiver
— a BroadcastReceiver
that listens for incoming SIP calls and passes them to
WalkieTalkieActivity
for handling.WalkieTalkieActivity
— a activity that login to SIP provider and registers the device to
receive incoming SIP, handles incoming calls and makes outgoing calls, managing
UI during the call.If you are developing an application that uses the SIP API, remember that the feature is supported only on Android 2.3 (API level 9) and higher versions of the platform. Also, among devices running Android 2.3 (API level 9) or higher, not all devices will offer SIP support. To ensure that your application can only be installed on devices that are capable of supporting SIP, remember to add the following to the application's manifest before publishing to Android Market:
<uses-sdk android:minSdkVersion="9" />
, which
indicates to Android Market and the platform that your application requires
Android 2.3 or higher. For more information, see API Levels and the
documentation for the <uses-sdk>
element.To control how Android Market filters your application from devices that do not support SIP, remember to add the following to the application's manifest
<uses-feature
android:name="android.hardware.sip.voip" />
, which tells Android
Market that your application uses the SIP API. The declaration should include
an android:required
attribute that indicates whether you want
Android Market to filter the application from devices that do not offer SIP
support. Other <uses-feature>
declarations may also be
needed, depending on your implementation. For more information, see the
documentation for the <uses-feature>
element.For more information about using the SIP API, see the android.net.sip
documentation.
You can find the source code for this sample in your SDK at:
<sdk>/platforms/android-<version>/samples/