1

My server database needs to notify the android app when there is insert in a table. For example, when receiving an order I insert it into a SQL Server database. I also want user to get notification in my app about the order. The app is always opened. I use web services to contact with database.

How can I set this up?

4444
  • 3,523
  • 10
  • 27
  • 43

1 Answers1

0

First of all, mysql or other sql servers are not real time databases. You have to notify your client in the same code you insert a record to your database. For this, the best option would be using websockets or push notifications.

So if your application will always be open as you said, you can use both equally. You will just emit the notification to the client(s) just after you inserted the order to database, and they will get it immediately.

For websockets, you can use socket.io. For push notification, i would prefer Google FCM.

abeyaz
  • 2,490
  • 1
  • 14
  • 18