Android – Make Phone Calls
Peeyush Singhal
Senior Technical Lead at Mphasis Silverline | 7X Mulesoft Certified | 2X Salesforce Certified | Jitterbit Certified
For more visit: Android – Make Phone Calls
Android provides Built-in applications for phone calls, in some occasions we may need to make a phone call through our application. This could easily be done by using implicit Intent with appropriate actions. Also, we can use PhoneStateListener and TelephonyManager classes, in order to monitor the changes in some telephony states on the device.
This chapter lists down all the simple steps to create an application which can be used to make a Phone Call. You can use Android Intent to make phone call by calling built-in Phone Call functionality of the Android. Following section explains different parts of our Intent object required to make a call.
Action to make Phone Call
Intent phoneIntent = new Intent(Intent.ACTION_CALL);
You can use ACTION_DIAL action instead of ACTION_CALL, in that case you will have option to modify hardcoded phone number before making a call instead of making a direct call.
Data/Type to make Phone Call
phoneIntent.setData(Uri.parse(“tel:91-000-000-0000″)); to be continued...