jeudi 28 avril 2016

How to read USSD Message response in android

i want to store my balance in sqlite database i am successfully dial the USSD

String balance_check="*444";
String encodedHash = Uri.encode("#");
  String ussd = balance_check + encodedHash;
 startActivityForResult(new Intent("android.intent.action.CALL",Uri.parse("tel:" + ussd)), 1);  

Here is onActivityResult function

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == 1) {
    if (resultCode == RESULT_OK) {
            String dd = data.toString();
            Log.d("myussdmessage", data.toString());}}

but I cannot get the string exactly how to do it.I want to store the balance form the dialogue to my database.Can any one suggest me how to do it.

Aucun commentaire:

Enregistrer un commentaire