has anyone know how to runs USSD command for checking phone's credit balance (the number is *123#) and get the result (the credit balance) for further processing?? thankss
USSD codes, also colloquially known as "secret codes", are simply codes that are used to unlock hidden actions in your smartphone. Unstructured Supplementary Service Data (USSD) is a user interface protocol that you can use to access hidden features in your smartphone.
This app can be found on your home screen, on the "All Apps" screen, or, on simpler cell phones, on the lock screen. Dial the USSD code. Some start with *, others #, and others *#.
Creating your USSD codeReach out to your provider (MNO or third-party gateway) to request a USSD code allocation. You might be asked to provide a business plan alongside other documentation. Decide what kind of code you'll be using based on your budget and other considerations.
You can use "%23" instead of "#" :
String ussdCode = "*" + "123"+"%23";
startActivity(new Intent("android.intent.action.CALL", Uri.parse("tel:" + ussdCode)));
You should also add permission to your Manifest file:
<uses-permission android:name="android.permission.CALL_PHONE" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With