Reputation: 51
I am running a USSD code to forward calls from an Android application. The problem is the code runs on some older Android version phones but gives an "Invalid MMI Code Connection Problem" error on the recent ones. What is the reason this MMI error comes up?
Upvotes: 1
Views: 11778
Reputation: 88
This means that the USSD command you are sending probably has a format error. The traditional format for USSD from android is *xxx*xx*xxx-xxx-xxx#
The "#" on the end must be uri encoded for the dialler to parse it the intent correctly if you are passing the USSD code through the dialler.
startActivity(new Intent(android.ACTION_CALL, new Uri.fromParts("tel", "*123*4*123456789" + Uri.encode("#"), null));
Alternatively the Uri code for "#" is %23 and passing that to the dialler will also allow for the USSD code to be sent.
It does seem like a lot of effort and that is because google don't currently have any API support for USSD codes, https://code.google.com/p/android/issues/detail?id=1285
Hope this helps
Upvotes: 1