B4J Question Server with automated messaging

kokoroayo

Member
Licensed User
Longtime User
Hi all,
I need help on this one please.
I have an old VB6 application that runs well for my client. It includes an auto reminder for their clients to keep appointments. Appointment reminders are sent via web based bulk SMS service. For this to happen, i created a small app on the server:
1.. All reminders are written in a database table with 'time for delivery'.
2.. The app loops through the database to find list of messages to be sent and their corresponding 'time for delivery'
3.. If 'time for delivery is = current time, then the app posts all the messages for that time via HTTP Post to the SMS service provider's website.
With this, the message server is always on the internet. This has been running very well for years now.

But now the client is having issues with the app due to their relocation to a new place where internet service is very poor.

As a solution, I created an app that writes all messages to a web based db server when ever there is internet access. The next thing is a way to have a script on same server to loop through this table and send the messages from time to time.

I have chosen B4X server as an option that can achieve this since it should be able to run on its own, however, how to achieve the timed loop and send the HTTP message is my problem. The message, I can work around, the loop - i'm lost.

Please help me achieve this.
Thanks in advance.
 

MarkusR

Well-Known Member
Licensed User
Longtime User
in mind i have a arduino or raspberry pi (Mikrocontroller) with GSM / GPRS modem + sim and send the sms direct.
from my isp provider 1&1 i had a usb/surfstick with simcard (until i got my local phone connection) maybe u can connect the old vb6 app via com control to something like that.
https://www.b4x.com/android/forum/t...-the-arduino-with-sms-messages.66770/#content

B4J Server
https://www.b4x.com/android/forum/threads/server-building-web-servers-with-b4j.37172/#content

timed loop
Timer Class Tick Event at any interval

DB
sqllite or mysql

HTTP Messages
okhttputils2 / jhttputils2 get/post
 
Upvote 0

AHilton

Active Member
Licensed User
Longtime User
If all you're doing is having a B4J server running on the server waiting to read the database and send messages, then just set a timer to an interval of your choice in the Main module.

If you're creating a B4J server to handle incoming requests from a client (mobile or desktop) then you'd set up a handler (ala - server.AddHandler()) for those. Then, for your 'timed loop', I'd create a background worker (ala - server.AddBackgroundWorker()) and set a timer in that to do your database lookup and message sending.
 
Upvote 0

kokoroayo

Member
Licensed User
Longtime User
If all you're doing is having a B4J server running on the server waiting to read the database and send messages, then just set a timer to an interval of your choice in the Main module.
Thank you. This is what I want to do. A clue will be appreciated please.
 
Upvote 0

kokoroayo

Member
Licensed User
Longtime User
in mind i have a arduino or raspberry pi (Mikrocontroller) with GSM / GPRS modem + sim and send the sms direct.
from my isp provider 1&1 i had a usb/surfstick with simcard (until i got my local phone connection) maybe u can connect the old vb6 app via com control to something like that.
Thanks brother. The idea is to connect to web servised bulk SMS provider. Ive been able to do some work with the AT commands on the VB6 app but it was more expensive for my client due to cost of sending the message.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

kokoroayo

Member
Licensed User
Longtime User
Thanks Don.
The issue is that the recipients are not neccessarily on Android or any known web platform. We get their mobile phone numbers. Network is either GSM or CDMA technology (with most on voice and text services only). Can Push (firebase) notification work for these too?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Can Push (firebase) notification work for these too?
Firebase Push Notifications are for Android and iOS (i think).
You can probably use a mix if you know which user is on android/ios (send Push) or any other Platform (send a SMS). This may reduce the SMS Provider costs too. Just an idea...
 
Upvote 0

kokoroayo

Member
Licensed User
Longtime User
Firebase Push Notifications are for Android and iOS (i think).
You can probably use a mix if you know which user is on android/ios (send Push) or any other Platform (send a SMS). This may reduce the SMS Provider costs too. Just an idea...
Thank you. Will look around it. That means I have to go a step further by getting notification mode (determined by whether client has smart phone or not, or better still, make a small mobile app just to receive the message for now and let clients download and install on their phone). This will be delivered as an upgrade though. Thanks for this idea.
 
Upvote 0
Top