0

In my android app, I want to dial an ussd code something like -- *123*1*0.5# -- the code i'm using is like this

Intent callIntent = new Intent(Intent.ACTION_DIAL); callIntent.setData(Uri.parse("tel:" + Uri.encode( "*123*1*"+"0.5"+"#")));

And i know that's working cause i Log it, and i got the right expresion, but when the dialer of the phone opens, it erase the dot and show me this. *123*1*05# - YOU CAN SEE THE DOT IS MISSING.

The first it's not an encoding problem , in fact the dot is one of the unreserved characters that UTF-8 leaves untouch.

A probable solution to this problem might be answer #2 of this post... How to send a USSD code containing decimal floating point (.)? wich is overwrite the intent for NEW_OUTGOING_CALL but i tried and didn't work. Does anyone has a solution for this.

Remember the problem it's not about the encoding, is about changing the number that the dial Intent is getting.

Community
  • 1
  • 1

1 Answers1

0

Dot is not a valid character in a tel: scheme intent. It's usually used to separate groups of digits in a phonenumber and I suspect it's stripped out by the dialer before sending as dtmf, even if it's an allowed alphanumeric character for USSD.

JHH
  • 8,567
  • 8
  • 47
  • 91
  • Well the Android Studio help says it's. And besides it's all inside de encode, aIso I tried to encode just de dot, and the bad result remains. As you suspect the dialer is who eat the dot, cause the app send it in the Intent. – Yudel Martínez Mar 30 '17 at 19:10