I'd like to know:
- how the android OS detect a incoming call(number) and displays the contact name and gives us a option to attend the call.
- What happens inside the OS when the "END CALL BUTTON" is tapped.
When I searched regarding this I am getting only the Classes and methods to create my own app. Requesting for the explanation.
In Android it is possible to detect call events using the built-in
TelephonyManager
API.TelephonyManager
class provides access to information about the telephony services on the device.Example :
Create a new class called MyCallReceiver
BroadcastReceiver class that will monitor the phone state and whenever there is a change in phone state, the onReceive() method of the BroadcastReceiver will be called.
Add the
READ_PHONE_STATE
permission in your AndroidManifest.xmlCheck this for references : BroadcastReceiver