Reputation: 81
In my android app, I want to dial an ussd code something like -- 1231*0.5# -- the code I'm using is like this
Intent callIntent = new Intent(Intent.ACTION_DIAL); callIntent.setData(Uri.parse("tel:" + Uri.encode( "1231*"+"0.5"+"#")));
And I know that's working because I log it, and I got the right expression, but when the dialer of the phone opens, it erases the dot and shows me this. 1231*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 untouched.
A probable solution to this problem might be answer #2 of this post... How to send a USSD code containing decimal floating point (.)? which 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 is not about the encoding, is about changing the number that the dial Intent is getting.
Upvotes: 0
Views: 386
Reputation: 9315
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.
Upvotes: 0