B4J Question Send MMS or SMS

Josias

Member
Licensed User
Longtime User
HI all,

Any suggestions on how I can send a SMS or MMS from a B4J app?

What is needed to do so?

Any software libraries required?

Thanks for looking.
 

lucas555

Member
Licensed User
Longtime User
I use this service.
The price is very low
Exemple:
Sub SMSSend (PhoneNo As String,Message As String)
Dim strTosend As String
    strTosend="CellNumber="& PhoneNo &"&MessageBody="&Message&"&AccountKey=your_account_key"

Dim j As HttpJob
j.Initialize("",Me)
 
j.Postbytes("http://smsgateway.ca/sendsms.aspx?",strTosend.GetBytes("utf-8")  )
Wait For (j) JobDone(j As HttpJob)

If j.Success=True Then
    'do something'   
    j.Release
Else
    'do something'   

    j.Release
End If   
    
End Sub
 
Upvote 0

Jmu5667

Well-Known Member
Licensed User
Longtime User
We wrote our own app in B4A and the B4J app connects to phone using a socket connection. We can send large text messages, and can send about 100 per minute. We did this for our customer base, and it has proved very successful. The other benefit is that it the default SMS app so it can delete messages. If it fully bi-directional, so we can receive inbound SMS messages and forward them to the B4J server app for processing.
 
Upvote 0

Josias

Member
Licensed User
Longtime User
Thnx all, I was thinking of using a mobile phone to send/receive SMS's as SMS's can be for free in Australia (depends on your contract). There are paid services that charge between 3.7c and 11c. I am currently going to run with www.smsbroadcast.com.au. Their initial cost is 3.7c.

I tried Swift SMS Gateway and it also worked without any problem. They are in Canada. Charges aprox 10c.

Erel previously posted the following code, it works beautifully. It requires jHttpUtils2
B4X:
Sub AppStart (Form1 As Form, Args() As String)
   MainForm = Form1
   'MainForm.RootPane.LoadLayout("1") 'Load the layout file.
   MainForm.Show
   Dim j As HttpJob
   j.Initialize("sms", Me)
   j.Download2("http://api.clickatell.com/http/sendmsg", _
     Array As String("user", "xxx", _
       "password", "xxx", _
       "api_id", "xx", _
       "to", "xxx", _
       "text", "xxx"))
End Sub

Sub JobDone(Job As HttpJob)
   Log("Success: " & Job.Success)
   If Job.Success Then
     Log(Job.GetString)
   End If
   Job.Release
End Sub
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0
Top