How is it possible to do USSD requests on Android?
You can intercept the USSD reponse , In order to do that you need to implement IExtendedNetworkService.aidl interface which binds the service with PhoneUtils. It then can intercept any USSD response and you can read that in your app easily .
FYI
https://github.com/alaasalman/ussdinterceptor
How to run USSD commands on android?
You can run USSD codes in Android devices but you would be unable to parse the result in your application. This feature might be added to the Android SDK in the future but for now, you would have to look for an alternative.
USSD can be run using simple Call intents. See Example:
String ussdCode = "*" + "123" + Uri.encode("#");
startActivity(new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + ussdCode)));
as mentioned in the comments phone call permission is also required
<uses-permission android:name="android.permission.CALL_PHONE" /
Call (and get the response for) a USSD Code, in the background?
Android O(API level 26) adds a sendUssdRequest
method to the TelephonyManager
, which also includes a callback for getting the result for the request.
The docs.
Related Topics
Preventing/Catching "Illegalargumentexception: Parameter Must Be a Descendant of This View" Error
Whatsapp Like Collapsing Toolbar
Resources$Notfoundexception: File Res/Drawable/Abc_Ic_Ab_Back_Material.Xml
How to Send Notification to Specific Users with Fcm
Programmatic Screencapture on Mobile Device
Android Replace the Current Fragment with Another Fragment
Taking Screenshot Programmatically Doesnt Capture the Contents of Surfaceview
Text/Design Tab Missing New Android Project on Android Studio Ide
Applying Word Stemming in Searchview for Fetch Data from Firebase Database
Android Device Does Not Show Up in Adb List
How to Change the Background Color Around a Dialogfragment
How to Tell Which App Was Selected by Intent.Createchooser
Broadcast Receiver to Detect Application Start
Android App Crashes with Sigabrt Signal 6 Only While Eclipse Debugging
Set Permission for Getting User's Email Id from Facebook Login