Kyaw Min Thu L
Kyaw Min Thu L

Reputation: 547

how to programmatically enter the number into phone application screen in android during conversation

I want to programmatically enter the number into phone application of android phone during conversation by my android program. (like this actions - 1.open dial keypad and 2.typing the number).

For example - when you call the phone number and this phone number has extension phone number for calling to the destination. For eg - (ph no - +6581329445 and ext no - 303) So, firstly you will need to call the phone number(eg - +6581329445 ) and then you will need to press the desire extension no (eg - 303) after picked up the phone by other side(callee).

I would like to do this step by programmatically. Now, I can call to the phone number(eg - +6581329445) from my program and then the callee will picked the phon, after that I will need to put the number of destination extension number(eg - 303) from my program for calling to target destination extension.(likely to dial the destination extension number(eg - 303) in keypad of phone application answering screen during the callee(eg - +6581329445) answering the phone).

Use cases explanation by pictures.

Call to hotel phone no (eg - +6581329445)

enter image description here

Enter the room extension no (eg - 303)

enter image description here

I would like to do step 2 from my program. Is it possible? If it is possible, please give me advice and how to code this step in android programming. Many thanks.

Upvotes: 3

Views: 4902

Answers (1)

Richard Le Mesurier
Richard Le Mesurier

Reputation: 29724

As you know you can ask Android dial a number for you:

   Uri number = Uri.parse("tel:" + numberString);
   Intent dial = new Intent(Intent.ACTION_CALL, number);
   startActivity(dial);

But on stock Android, you cannot interact with the dialer application after you have dialled your number.


However, you can tell the dialer to set a pause between some numbers:

  • either a 2-second pause,
  • or an indefinite wait.

To enter a 2-second pause between numbers, use a "," in the dial string:

  • "6581329445,303" (thanks to @323go)

To wait indefinitely, use a ";" in the dial string:

  • "6581329445;123"

This can be more useful in some situations - it depends on how long the automated answering service will take to allow you to enter the extension.

The indefinite pause is handled by the dialer by popping up a dialog in the dialler app, allowing the user to send the extra numbers.

Upvotes: 4

Related Questions