直接前往內容

最常造訪的網頁

最近瀏覽的網頁

navigation
added in API level 21

android.telecom

The Android Telecom framework is responsible for managing calls on an Android device. This can include SIM-based calls using the Telephony framework, VOIP calls using SIP (e.g. the SipConnectionService), or via a third-party VOIP ConnectionService. Telecom acts as a switchboard, routing calls and audio focus between Connections provided by ConnectionService implementations, and InCallService implementations which provide a user interface for calls.

Android supports the following calling use cases (with increasing level of complexity):

  • Implement the self-managed ConnectionService API - this is ideal for developers of standalone calling apps which do not wish to show their calls within the default phone app, and do not wish to have other calls shown in their user interface. Using a self-managed ConnectionService implementation within your standalone calling app helps you ensure that your app will interoperate not only with native telephony calling on the device, but also other standalone calling apps implementing this API. It also manages audio routing and focus for you.
  • Implement the managed ConnectionService API - facilitates development of a calling solution that relies on the existing device phone application (see getDefaultDialerPackage()) to provide the user interface for calls. An example might be a third party implementation of SIP calling, or a VOIP calling service. A ConnectionService alone provides only the means of connecting calls, but has no associated user interface.
  • Implement the InCallService API - facilitates development of a replacement for the device's default Phone/Dialer app. The InCallService alone does not have any calling capability and consists of the user-interface side of calling only. An InCallService must handle all Calls the Telecom framework is aware of. It must not make assumptions about the nature of the calls (e.g. assuming calls are SIM-based telephony calls), and should not implement calling restrictions based on any one ConnectionService (e.g. it should not enforce Telephony restrictions for video calls).
  • Implement both the InCallService and ConnectionService API - ideal if you wish to create your own ConnectionService based calling solution, complete with its own full user interface, while showing all other Android calls in the same user interface. Using this approach, you must still ensure that your InCallService makes no assumption about the source of the calls it displays. You must also ensure that your ConnectionService implementation can still function without the default phone app being set to your custom InCallService.

Classes

Call Represents an ongoing phone call that the in-call app should present to the user. 
Call.Callback Defines callbacks which inform the InCallService of changes to a Call
Call.Details  
Call.RttCall A class that holds the state that describes the state of the RTT channel to the remote party, if it is active. 
CallAudioState Encapsulates the telecom audio state, including the current audio routing, supported audio routing and mute. 
CallScreeningService This service can be implemented by the default dialer (see getDefaultDialerPackage()) to allow or disallow incoming calls before they are shown to a user. 
CallScreeningService.CallResponse  
CallScreeningService.CallResponse.Builder  
Conference Represents a conference call which can contain any number of Connection objects. 
Conferenceable Interface used to identify entities with which another entity can participate in a conference call with. 
Connection Represents a phone call or connection to a remote endpoint that carries voice and/or video traffic. 
Connection.RttModifyStatus Provides constants to represent the results of responses to session modify requests sent via sendRttRequest()  
Connection.RttTextStream Provides methods to read and write RTT data to/from the in-call app. 
Connection.VideoProvider Provides a means of controlling the video session associated with a Connection
ConnectionRequest Simple data container encapsulating a request to some entity to create a new Connection
ConnectionService An abstract service that should be implemented by any apps which either:
  1. Can make phone calls (VoIP or otherwise) and want those calls to be integrated into the built-in phone app. 
DisconnectCause Describes the cause of a disconnected call. 
GatewayInfo Encapsulated gateway address information for outgoing call. 
InCallService This service is implemented by any app that wishes to provide the user-interface for managing phone calls. 
InCallService.VideoCall Used to issue commands to the Connection.VideoProvider associated with a Call
InCallService.VideoCall.Callback The InCallService extends this class to provide a means of receiving callbacks from the Connection.VideoProvider
PhoneAccount Represents a distinct method to place or receive a phone call. 
PhoneAccount.Builder Helper class for creating a PhoneAccount
PhoneAccountHandle The unique identifier for a PhoneAccount
RemoteConference A conference provided to a ConnectionService by another ConnectionService through conferenceRemoteConnections(RemoteConnection, RemoteConnection)
RemoteConference.Callback Callback base class for RemoteConference
RemoteConnection A connection provided to a ConnectionService by another ConnectionService running in a different process. 
RemoteConnection.Callback Callback base class for RemoteConnection
RemoteConnection.VideoProvider RemoteConnection.VideoProvider associated with a RemoteConnection
RemoteConnection.VideoProvider.Callback Callback class used by the RemoteConnection.VideoProvider to relay events from the Connection.VideoProvider
StatusHints Contains status label and icon displayed in the in-call UI. 
TelecomManager Provides access to information about active calls and registration/call-management functionality. 
TransformationInfo A container class to hold information related to the Assisted Dialing operation. 
VideoProfile Represents attributes of video calls. 
VideoProfile.CameraCapabilities Represents the camera capabilities important to a Video Telephony provider. 
本網站使用 Cookie 儲存你在此指定的語言和顯示選項偏好設定。

掌握有關 Android 開發人員的最新消息和實用訣竅,協助你製作最受歡迎的 Google Play 內容。

* 必填欄位

訂閱成功!

在 WeChat 上追蹤 Google Developers

你要以瀏覽這個網站嗎?

你要求以顯示這個網頁,但你為此網站指定的語言偏好設定為

是否要變更語言偏好設定並改用瀏覽網站?稍後如要變更語言偏好設定,請利用位在每個網頁最下方的語言選單來調整設定。

你的 API 層級必須達 以上才能存取這個級別

本說明文件已隱藏,因為你為該文件選取的 API 層級為 。使用左側導覽列上方的選取工具即可變更說明文件的 API 層級。

如需進一步瞭解如何為應用程式指定 API 層級的相關資訊,請參閱 Supporting Different Platform Versions (支援不同的平台版本) (英文)。

Take a short survey?
Help us improve the Android developer experience. (April 2018 — Developer Survey)