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?
In the MainActivity. The NotificationManager. notify() method is used to display the notification. The Intent class is used to call another activity (NotificationView.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With