1

I'm developing a dialer app which I've been testing on my Motorola devices and the emulator images that I download through the SDK manager.

The user either types in the number, or selects it from recent calls or contacts. I then fire off the call like this (the commas are there so that there is a delay before sending the dial tones):

String url = "tel:" + preDial + " ,,, " + postDial;
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(url));
startActivity(intent);

On my phones and the emulator, the phone app displays preDial with its contact name, and inserts it normally into the recent call log. When I tested it on my friend's Samsung Charge, however, it displayed the contents of the url (minus the "tel:" of course). For example if preDial = "15555555555" and postDial = "1111" the phone app would display 15555555555,,,1111 and there would be no corresponding contact name displayed due to the contact not having the number with ,,,1111 appended. This also screws up the call logs as this awkward number with no contact is stored there. I'm assuming this is a function of how Samsung implemented their phone, and I'm hoping there is a way around it.

I can fix the call log by removing LIKE preDial from the call logs, but the issue with how the number displays in the phone app remains. Does anyone know if this is a more widespread issue than Samsung and if there are any ways around it?

Kara
  • 6,115
  • 16
  • 50
  • 57
Eliezer
  • 7,209
  • 12
  • 56
  • 103

2 Answers2

1

I would say it's how Motorola implemented things, cause I never came to idea to use commas in between.. did u simply try without commas? String url = "tel:" + preDial + postDial;

Edit: Check this explanation/advice by @RetoMeier ..

Hope it helped and really hope your UI is better than one in my comment down.. ;)

Cheers

Community
  • 1
  • 1
Ewoks
  • 12,285
  • 8
  • 58
  • 67
  • I need the commas for a delay in sending the dial tones – Eliezer May 22 '12 at 10:44
  • 1
    Why would you need delay?! O.o Before (read last century) commas were used to make delay while connecting tom´, let's say, dial up internet provider.. The purpose was solving eventual wire connectivity issues.. But today?! User will wonder why is dialing with delay, it's not so usual.. Can u elaborate purpose a bit please? p.s. please don't tell me your UI looks like this http://goo.gl/LHWyc – Ewoks May 22 '12 at 11:22
  • lol I can't elaborate on why exactly I need the delay but it is definitely needed and something the user knows about and expects – Eliezer May 22 '12 at 12:21
  • Isn't the delay for extensions? – Mark Duiker Dec 19 '16 at 16:38
0

try something like this,

 String tel = preDial + " ,,, " + postDial;
// it will remove all things except number's
                tel = tel.replaceAll("\\D", "");
                Intent callIntent = new Intent(Intent.ACTION_CALL);
                callIntent.setData(Uri.parse("tel:" + tel));
                startActivity(callIntent);
Maulik J
  • 2,745
  • 19
  • 22
  • 1
    How will this help me with the commas? I need the commas for a delay in sending the dial tones – Eliezer May 22 '12 at 10:45