Push SQL Server Data to Android Device

junaidahmed

Well-Known Member
Licensed User
Longtime User
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.
 

wl

Well-Known Member
Licensed User
Longtime User
You can do this as follows:

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.

Then you should push the data from the server to your Android client: for this you could use C2DM (the push framework of Android): see http://www.b4x.com/forum/basic4andr...cation-c2dm-framework-tutorial.html#post58662

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).

Wim
 
Upvote 0

wl

Well-Known Member
Licensed User
Longtime User
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.

Wim
 
Upvote 0

junaidahmed

Well-Known Member
Licensed User
Longtime User
Thanks for your quick replay,I will try,if any doubt in this regard,pls help me.
Sorry for my bad english
 
Upvote 0

wl

Well-Known Member
Licensed User
Longtime User
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...

Wim
 
Upvote 0

junaidahmed

Well-Known Member
Licensed User
Longtime User
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.
 

Attachments

  • Message.txt
    418 bytes · Views: 353
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…