留下您的信息数据库更改Android的时您的、数据库、信息、Android

2023-09-06 01:06:24 作者:合拍相处

我有一个SQL Server数据库,当有在表格中插入我想通知Android应用程序。

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

例如,当订单接收,我把它插入到一个SQL Server数据库。我也希望用户得到通知我有关订单的应用程序。该应用程序始终打开。我使用的Web服务与数据库联系。

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 opened. I use web services to contact with database.

我不想请求表每10秒左右。有没有其他办法?

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

推荐答案

您可以使用谷歌的云信息服务,了解如何设置服务器的这里。

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

例如:如果你正在使用PHP然后同时插入或更改你可以把通知GCM给定的潜水任何数据。否则,你可以在SQL和呼叫系统服务设置触发器来通知GCM

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