Android Code Snippet [BM] - SMS Gateway

I'm working on a new project that involves sending SMS messages to my clients.

While doing some research, I found online solutions that involved paying a fee per message.

So, I wanted to create an alternative that was cheaper and more manageable.

To do this, I created this little app that creates a REST API within our phone and allows us to send SMS messages to any number we want through our personal numbers.

I hope this help somebody.




Libraries needed for the example:

1752277401879.png

A few on the list may not be needed.



1752277340580.png
 

Attachments

  • SMS Gateway.zip
    16.6 KB · Views: 66

emexes

Expert
Licensed User
Longtime User
That might be pretty handy, because I was just about to do something similar using sms-to-email forwarding.
 

Cableguy

Expert
Licensed User
Longtime User
Another option, would be to subscribe to a few e-sims and use 3 or 4 different numbers, managed by the rest api
 
I'm working on a new project that involves sending SMS messages to my clients.

While doing some research, I found online solutions that involved paying a fee per message.

So, I wanted to create an alternative that was cheaper and more manageable.

To do this, I created this little app that creates a REST API within our phone and allows us to send SMS messages to any number we want through our personal numbers.

I hope this help somebody.




Libraries needed for the example:

View attachment 165309
A few on the list may not be needed.



View attachment 165308
When i compile and run , the app exits with "Permission are required, closing the app." message. I do not get the option to allow for permissions. What should I change in following code:

B4X:
Sub Activity_Resume
    For Each permission As String In Array(rp.PERMISSION_SEND_SMS, rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
        rp.CheckAndRequest(permission)
        Wait For Activity_PermissionResult (permission As String, Result As Boolean)
        If Result = False Then
            ToastMessageShow("❌ Permission are required, closing the app.", True)
            Activity.Finish
            Return
        End If
    Next
    ToastMessageShow("✅ All Permissions allowed, opening...", False)
        
    ' Inicializar UI, iniciar servicio o mostrar CRUD
    StartService(SmsGatewayService)

End Sub
 
Top