留下您的信息数据库更改Android的时 [英] Get notified when database change Android

查看:130
本文介绍了留下您的信息数据库更改Android的时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个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

这篇关于留下您的信息数据库更改Android的时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆