How to Make a Call


One common requirement I see in specifications is to allow the application to make a phone call. The usual way is to use an intent with Intent.ACTION_CALL.

Here’s an example from com.android.phone.PhoneInterfaceManager
String url = createTelUrl(number);
if (url == null) {
return;
}
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(url));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setClassName(mApp, PhoneApp.getCallScreenClassName());
mApp.startActivity(intent);

createTelUrl is defined in com.android.phone.PhoneInterfaceManager

Don’t forget to add…
<uses-permission id="android.permission.CALL_PHONE"/>

…to your manifest.

Note also that there’s a reported problem on the G1 (RC30) if you wish to send many DTMF tones.

Comments are closed.