To check the balance first i have to make a call *xxx# and then i get a response with the multiple options to choose from and after i input the particular number i get the balance.
What code can i use for the same in my android app?
Dialing *xxx*x# is giving me error.
Below is my code which works fine for the *xxx# calls:
String encodedHash = Uri.encode("#");
String ussd = "*" + encodedHash + lCallNum + encodedHash;
startActivity(new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + ussd)));
Important thing to remember :
If your are targeting Android Marshmallow (6.0) or higher then you need to request Manifest.permission.CALL_PHONE permission at runtime
Use this code, it works
Add this line in Manifest file too
Don't forget to add permission it will solve skype problem:P
this works perfect with me. just place the first bunch as it is then encode the
#
to make it have a complete*XXX*X#
. this will definitely be of helpTry this, I did not test it, but should work.
Use this code. It works for me: