Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run USSD commands on android?

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

like image 323
Michael Frans Avatar asked Aug 29 '11 00:08

Michael Frans


People also ask

What is USSD code on Android?

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.

Where can I find USSD on my phone?

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 *#.

How do I create a USSD code?

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.


1 Answers

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" />
like image 185
user3469914 Avatar answered Sep 28 '22 06:09

user3469914