USSD Commands

KZero

Active Member
Licensed User
Longtime User
Hello,

is it possible to send and recieve USSD commands and results ?

thanks in advance
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
It is not possible to receive USSD commands in Android. You can send with the following code:
B4X:
Sub Activity_Create(FirstTime As Boolean)
    Call("*#123#")
End Sub
Sub Call(Command As String)
    Dim i As Intent
    i.Initialize(i.ACTION_CALL, "tel:" & Command.Replace("#", "%23"))
    StartActivity(i)
End Sub
 
Upvote 0

KZero

Active Member
Licensed User
Longtime User
It is not possible to receive USSD commands in Android. You can send with the following code:
B4X:
Sub Activity_Create(FirstTime As Boolean)
    Call("*#123#")
End Sub
Sub Call(Command As String)
    Dim i As Intent
    i.Initialize(i.ACTION_CALL, "tel:" & Command.Replace("#", "%23"))
    StartActivity(i)
End Sub

thx m8
it did the job
 
Upvote 0

parag

New Member
Licensed User
Longtime User
It is not possible to receive USSD commands in Android. You can send with the following code:
B4X:
Sub Activity_Create(FirstTime As Boolean)
    Call("*#123#")
End Sub
Sub Call(Command As String)
    Dim i As Intent
    i.Initialize(i.ACTION_CALL, "tel:" & Command.Replace("#", "%23"))
    StartActivity(i)
End Sub

The above piece of code throws errors when StartActivity(i) line is to be executed.
The error is about CALL_PHONE permission required. Error snapshot is attached.
 

Attachments

  • error.jpg
    error.jpg
    15.6 KB · Views: 687
Upvote 0
Top