Continuing USSD request (Android) -


it known menu driven ussd applications got it's pre defined order of taking parameters in. example
user sends #111# (sri lanka), , gets menu of 12 sub items select sending sub menu number back. may ask select 1 set of sub menu. send number etc. etc. , send pin, send phone number reload (if reloading) send yes(1) no(2) confirm 99 finish ussd event.
have succeeded sending continues signals vb.net phone using nokia asha 501 (using bluetooth outgoing com port) follows.

        strcommand = "at+cusd=1," & chr(34) & "#111#" & chr(34) & ",15" & vbcrlf         comport.write(strcommand)         thread.sleep(5000) 

this bring ussd menu. datareceivedhandler of com port port.datareceived can give if there error returned com not open error dialing ussd.
next send response string contains "ok"

    strcommand = "at+cusd=1," & chr(34) & "1" & chr(34) & ",15" & vbcrlf     comport.write(strcommand)     thread.sleep(5000) 

again check ok etc. works , wanted android. succeeded getting first menu follows.

protected void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     setcontentview(r.layout.activity_main);     button button = (button) findviewbyid(r.id.button1);      button.setonclicklistener(new view.onclicklistener() {         public void onclick(view arg0) {             string encodedhash = uri.encode("#");             call(encodedhash + "111" + encodedhash);         }     }); }  protected void call(string phonenumber) {     try {         startactivityforresult(                 new intent("android.intent.action.call", uri.parse("tel:"                         + phonenumber)), 1);     } catch (exception e) {         view.append("\n here \n " + "\n" + e.tostring() + " hi");//     } } 

so far good.
don't need read response ussd. want send next command "1" same ussd thread giving sleep time of 4/5 seconds. if use same way, brings thread calling number "1"

string encodedhash = uri.encode("#");             call(encodedhash + "1" + encodedhash); startactivityforresult(                 new intent("android.intent.action.call", uri.parse("tel:"                         + phonenumber)), 1); 

tried many things (without lead many documents rotating).
in advance. all cods above taken great places stackoverflow , working.


Comments

  1. Bulk Sms Sender By Ad Technology
    One Time Payment Life Time Use
    Send Sms From Your Pc With Gsm Modem
    Auto Send Random From Your Numbers List
    Easy To Use For Multiply Sending
    Also You Can Send With your Mobile Phone (No need To Have Modem)
    Auto Save Sending Done Or Failed Information
    Show Real Time Information
    Auto Send With Time And Date
    https://www.youtube.com/watch?v=cQtME6mpACQ

    ReplyDelete

Post a Comment

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -