English | Site Directory

Android - An Open Handset Alliance Project

package

android.telephony

Classes | Description

Provides tools to make, receive, and monitor phone calls and phone status. The most important classes and interfaces for SDK developers are IPhone and PhoneNumberUtils.

Important:   If you want to make a call with your phone, you must include the following line in your AndroidManifest.xml file:

<uses-permission id="android.permission.CALL_PHONE" /> 

or else specify that id in the appropriate permission attribute of your activity in the manifest.

Android provides telephony functionality to programmers through a number of services:

  • Android ships with a native Intent receiver that will let you make calls when you send a CALL_ACTION intent with a phone number URI in the tel: scheme.
  • You can use the IPhone interface to dial a number, end a call, check radio on/off state, or turn the radio on or off.
  • You can use DataStateIntentReceiver or PhoneStateIntentReceiver to register for events, or to query phone or data connection information such as:
    • Call state and call state change (IDLE, RINGING, OFF_HOOK)
    • Service states and state change (in service, out of service, emergency only, powered off, roaming, operator name, and so on)
    • Signal strength
    • Voicemail alerts
    • Data connection state (disconnected, connecting, connected)
    • Data activity state (data in, data out, etc)
  • Phone properties, such as SIM serial number, phone and voice mail numbers, IMEI number, and so on. Query the system for constants defined by TelephonyProperties.
  • SMS services exposed by SmsManager let you send and receive SMS data, text, and raw PDU messages.

Build m5-rc15i - 10 Jun 2008 13:54