Android Question New data in remote database = notification

Oke

Member
Licensed User
Longtime User
I have a database on a hosting server.
How do I make every time new data is inputted into the database, I get an automatic notification ?
 
I have a database on a hosting server.
How do I make every time new data is inputted into the database, I get an automatic notification ?
Firebase Notification. Let's say on the server there is either a running application or a web site that creates the new data. Let's assume that we're talking about a website written in ASP.NET. User clicks on a button on the webpage and a new record has been created.

Now on record created event we can run a code on this web page that will send a notification to the B4A app.
 
Upvote 1
Firebase Notification. Let's say on the server there is either a running application or a web site that creates the new data. Let's assume that we're talking about a website written in ASP.NET. User clicks on a button on the webpage and a new record has been created.

Now on record created event we can run a code on this web page that will send a notification to the B4A app.
Is it possible to check new data from b4a app?
 
Upvote 0
Is it possible to check new data from b4a app?
Implement jRDC2 on your Server and use B4A JRDC2 Client to fetch Data from the jRDC2 on your Server.
 
Upvote 0
If you are using a general shared server solution like around 99% of businesses/people do, then jRDC2 is definitely not the solution for you. In the last I've just set a 60 - 300 seconds ping to check for new data, It's as simple as that.

Most simple website services give you free hosting databases (but no desktop access), so you should define if you have access to the actual desktop. A simple pinging the database every x seconds should suffice.

I can think of lots of solutions, this is just one of many simple solutions that popped into my head. Firebase Notifications is another solutions, but you will have to do a lot of work to get everything working smoothly.

I take it that you're using either MS SQL or MySQL???
To me you've not really described anything, do you need instant notification, or can it be delayed 5 minutes (maybe not)...
 
Upvote 0
If you are using a general shared server solution like around 99% of businesses/people do, then jRDC2 is definitely not the solution for you. In the last I've just set a 60 - 300 seconds ping to check for new data, It's as simple as that.

Most simple website services give you free hosting databases (but no desktop access), so you should define if you have access to the actual desktop. A simple pinging the database every x seconds should suffice.

I can think of lots of solutions, this is just one of many simple solutions that popped into my head. Firebase Notifications is another solutions, but you will have to do a lot of work to get everything working smoothly.

I take it that you're using either MS SQL or MySQL???
To me you've not really described anything, do you need instant notification, or can it be delayed 5 minutes (maybe not)...
yes using MySql,
Can you provide a sample code to ping a server in the B4A app ?
 
Upvote 0
Just use B4XPages with a timer, then just use your usual connect to database routine to check for new data. There are other things that you'll need to do to keep the app running in the background, but this is a good start for you...
 
Upvote 0
Just use B4XPages with a timer, then just use your usual connect to database routine to check for new data. There are other things that you'll need to do to keep the app running in the background, but this is a good start for you...
will it not burden / disrupt the server ?
 
Upvote 0
Just use B4XPages with a timer, then just use your usual connect to database routine to check for new data. There are other things that you'll need to do to keep the app running in the background, but this is a good start for you...
need to do to keep the app running in the background,
how not to be turned off by the system ?
 
Upvote 0
will it not burden / disrupt the server ?
You don't need to download/read all the data every time. Just implement a single-record table on the server with a LastUpdateDateTime or SequentialCounter. Update that whenever an add/change/delete is made to the main data. The remote App can just periodically read & compare that with it's currently stored value and do whatever when it changes.
 
Upvote 0
You don't need to download/read all the data every time. Just implement a single-record table on the server with a LastUpdateDateTime or SequentialCounter. Update that whenever an add/change/delete is made to the main data. The remote App can just periodically read & compare that with it's currently stored value and do whatever when it changes.

thank you sir, i will try
 
Upvote 0
You don't need to download/read all the data every time. Just implement a single-record table on the server with a LastUpdateDateTime or SequentialCounter. Update that whenever an add/change/delete is made to the main data. The remote App can just periodically read & compare that with it's currently stored value and do whatever when it changes.
WHERE DID I SAY DOWNLOAD AND READ ALL THE DATA???
 
Upvote 0
Last edited:
Upvote 0
Back
Top