March 2016
Intermediate to advanced
428 pages
9h 2m
English
As we've seen in previous recipes, we can call the default applications simply by using an Intent. To make a phone call, use Intent.ACTION_DIAL when creating an Intent. You can include a phone number with the setData() method. Here is sample code that will call up the Dialer app with the phone number specified:
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.setData(Uri.parse("tel:" + number));
startActivity(intent);Since your application is not doing the dialing and the user must press the Dial button, you do not need any dialing permissions in your app. The following recipe will show you how to place a call directly, bypassing the Dial activity. (For this, you will need to add a permission.)
Create ...
Read now
Unlock full access