Chapter 12. 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 SMS (short messaging service) 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 to create social applications using SMS as the transport layer.

At the end of this chapter, you'll use the SMS Manager in a detailed project that involves creating an emergency SMS responder. In emergency situations, the responder will let users quickly, or automatically, respond to people asking after their safety.

TELEPHONY

The Android telephony APIs let your applications access the underlying telephone hardware ...

Get Professional Android™ 2 Application Development 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.