Chapter 17

Telephony and SMS

What's in this Chapter?

Initiating phone calls

Reading the phone, network, data connectivity, and SIM states

Monitoring changes to the phone, network, data connectivity, and SIM states

Using Intents to send SMS and MMS messages

Using the SMS Manager to send SMS messages

Handling incoming SMS messages

In this chapter, you'll learn to use Android's telephony APIs to monitor mobile voice and data connections as well as incoming and outgoing calls, and to send and receive short messaging service (SMS) messages.

You'll take a look at the communication hardware by examining the telephony package for monitoring phone state and phone calls, as well as initiating calls and monitoring incoming call details.

Android also offers full access to SMS functionality, letting you send and receive SMS messages from within your applications. Using the Android APIs, you can create your own SMS client application to replace the native clients available as part of the software stack. Alternatively, you can incorporate the messaging functionality within your own applications.

Hardware Support for Telephony

With the arrival of Wi-Fi-only Android devices, you can no longer assume that telephony will be supported on all the hardware on which your application may be available.

Marking Telephony as a Required Hardware Feature

Some applications don't make sense on devices that don't have telephony support. An application that provides reverse-number lookup for incoming calls or ...

Get Professional Android 4 Application Development, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.