Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android class ConnectionService

Can anyone just give an example how to implement this abstract class- ConnectionService.my idea is to use TelecomManager to make an outgoing call.

https://developer.android.com/reference/android/telecom/ConnectionService.html#SERVICE_INTERFACE

TelecomManager telecomManager = (TelecomManager)this.getSystemService(Context.TELECOM_SERVICE);
        PhoneAccountHandle accountHandle=telecomManager.getSimCallManager();
        PhoneAccount account=telecomManager.getPhoneAccount(accountHandle);
        telecomManager.registerPhoneAccount(account);

        CharSequence label=account.getLabel();
        ConnectionRequest request = null;

        Connection connection= service.onCreateOutgoingConnection(accountHandle,request);

now i need to know what will be given in the request feild and Connection service how to implement before it..

like image 704
Nini P Suresh Avatar asked Sep 21 '15 10:09

Nini P Suresh


People also ask

What is ConnectionService in android?

android.telecom.ConnectionService. An abstract service that should be implemented by any apps which either: Can make phone calls (VoIP or otherwise) and want those calls to be integrated into the built-in phone app. Referred to as a system managed ConnectionService .

What is android server telecom used for?

server. telecom is a code-related android OS service that establishes connections for calls and manages calls. It has multiple functions, including initiating & receiving calls, managing the phone account, providing video profiles, keeping call logs, and working with the InCallUI app to facilitate these functions.

What is telephony connection service?

Telephony (/təˈlɛfəni/ tə-LEF-ə-nee) is the field of technology involving the development, application, and deployment of telecommunication services for the purpose of electronic transmission of voice, fax, or data, between distant parties.

What is call in android?

android.telecom.Call. Represents an ongoing phone call that the in-call app should present to the user.


1 Answers

It's purpose is not for other apps to place calls. The supported method for doing that is through Intent.ACTION_CALL as stated in the other answer.

There is an API on TelecomManager to place a call, however, that is no different from sending the Intent directly. More information about TelecomManager.placeCall: http://developer.android.com/reference/android/telecom/TelecomManager.html#placeCall

About ConnectionService:

The main purpose of the ConnectionService API is to include third party VoIP calls into the system dialer such that a cellular call and a third-party VoIP call can live side by side and the user can switch between them. VoIP apps that implement this API benefit from this by having their calls treated just like traditional cellular calls including having them show up in the built-in system dialer/in-call UI, the call log, Android Wear support and Android Auto support.

If you were a third party VoIP app that wanted their calls to live side-by-side with traditional cellular calls, then you would:

1) Create an implementation of ConnectionService

2) declare that service within your AndroidManifest.xml file

3) Register a PhoneAccount with your ConnectionService component name

More information: http://developer.android.com/reference/android/telecom/ConnectionService.html

The user is then able to turn on your particular phone account through dialer settings and your connection service is now an option for your user to place and receive phone calls through your own VoIP service.

like image 76
santosc Avatar answered Nov 14 '22 21:11

santosc