Chapter 7. Telephony
This chapter covers
- Making and receiving phone calls
- Capturing call-related events
- Obtaining phone and service information
- Using SMS
People use Android devices to surf the web, download and store data, access networks, find location information, and use many types of applications. Android can even make phone calls.
Android phones support dialing numbers, receiving calls, sending and receiving text and multimedia messages, and other related telephony services. In contrast to other smartphone platforms, all these items are accessible to developers through simple-to-use APIs and built-in applications. You can easily leverage Android’s telephony support into your own applications.
In this chapter, we’ll discuss telephony in general and cover terms related to mobile devices. We’ll move on to basic Android telephony packages, which handle calls using built-in Intent actions, and more advanced operations via the TelephonyManager and PhoneStateListener classes. The Intent actions can initiate basic phone calls in your applications. TelephonyManager doesn’t make phone calls directly but is used to retrieve all kinds of telephony-related data, such as the state of the voice network, the device’s own phone number, and other details. TelephonyManager supports adding a PhoneStateListener, which can alert you when call or phone network states change.