Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
494 views
in Technique[技术] by (71.8m points)

sql - 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...