Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get notified when database change Android

I have a SQL Server database and when there is insert in a table I want to notify the Android app.

For example, when order receives, 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 open. I use web services to contact with database.

I don't want to request the table every 10 seconds or so. Is there any other way?

like image 600
Misha Akopov Avatar asked Mar 07 '14 05:03

Misha Akopov


People also ask

What is notify method in Android?

In the MainActivity. The NotificationManager. notify() method is used to display the notification. The Intent class is used to call another activity (NotificationView.


1 Answers

You can use Google Cloud messaging service, see how to set server here.

Example: if you are using PHP then while inserting or changing any data you can push to notify GCM to the given dives. or else you can set triggers in SQL and call system services to notify GCM.

like image 97
Vikas Rathod Avatar answered Sep 19 '22 13:09

Vikas Rathod