<pre lang="C#">Dialing a USSD code from a custom activity is straight forward using a DIAL or CALL intent, but listening to the returned result is not due to Android not having proper support for intercepting USSD calls within the platform, but partial though undocumented support exists within the native dialer application.
As a start, look at the PhoneUtils class in the Android source code. The link is for 4.0.3 but I believe this partial support has been present since 2.3.
Specifically, looking at line 217, an intent with the name “com.android.ussd.IExtendedNetworkService” is being composed. So what you need to do is implement your own service that responds to that intent. The service needs to be implemented according to the IExtendedNetworkService.aidl which is a part of the Android framework.
The aidl exposes several functions but the one we care about is the getUserMessage(text) function in that service. The text is the final value returned from the USSD call.
Since the service is binded on by PhoneUtils, then you need to start the service at phone boot up. It also means that any modification to the service will need a phone reboot.
Returning null from getUserMessage will suppress the dialer from showing the USSD result but there’s no way to completely hide the dialer.
You can also use the other functions to change the text shown while the call is in progress.
This doesn’t seem to work on USSD prompts(menus), only on final results.</pre>
I've tried, (14.04 LTS) but screwed up the install somewhere. I can create a project, etc, but when I try to run/debug it crashes on can't find adb or some such. Early days, I'll get it sorted when I have time to chase it down.
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
Has anyone had a chance to work on any Android wear apps?
I'm looking to get a Sony SmartWatch 3, but before I take the plunge I wanted to find out how the dev process works when using an iPhone as your main/sync device. From what I read, it looks like it'd work without issues.
Obv an Android phone would be better, so is it worth buying a junker on ebay just for testing & dev purposes?
Ultimately I want to make apps that will work on Android wear and be handset agnostic.
Hello. Can someone guide me on 'How to create an English Dictionary Application in Android Studio using SQLite. The Application is expected to have features such as
"Auto Complete English Words" and a "Text-To-Speech" feature'. Any help in this regard will be greatly appreciated!!