We have developed Android application to Access SQL Server 2000 Data in Remote using Http Library (Via ASP Script).It works fine and we have got Knowledge of Remote Access.But we would like to Know how to Push SQL Server Data to Android Device for Refreshing Data.Pls help me in this regard.
As soon as there is a data modification (insert / update / delete) in the database you can have SQL Server call some code you can write in (for example C#). This can be accomplished by for example "Notification services" or triggers.
So it works like this:
- SQL server detects a data change and pushes a message to your Android device.
- as soon as your Android device receives this pushmessage it can obtain the new data using the HTTP (as you already seem to use).
C2DM is an Adroid framework for pushing message from a server to your Android device (Android 2.2 or higher).
It works like this:
when your server has a message to be sent to your Android device (eg: "I have new data on the database") your service can do a HTTP request to a Google server: the google server will immediately (give or take a few seconds) send this notification to your device.
On your device your application (written in B4A) is immediately getting this message and so your app can do a request to your server to get the new data.
All this can be used if you want your Android device to obtain the new data in a matter of seconds after new data has been posted on the database: it is called 'push'. You need the C2DM for pushing.
Alternatively you can have your advice check for new data on the server every few minutes. This is called 'poll'. You don't need C2DM for polling.
I am currently also testing some things for another pushing framework. But I tried the C2DM demo Erel wrote in the page I gave and this seems to work.
It is a bit work though:
- apply for an account @ google
- writing the Android app
- writing the code to send the pushing message
- writing a webpage the google server can use to identity your users etc...
I have an message in SQL Server Database Table.I Would like to Push Message from SQL Table to Android Device. I have already registered my gmail account to C2DM.I would like to know how to write HTTP request to a Google server in ASP Code.Pls refer attached asp file and advise.