J junaidahmed Well-Known Member Licensed User Longtime User Jan 14, 2012 #1 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.
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.
W wl Well-Known Member Licensed User Longtime User Jan 14, 2012 #2 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
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
J junaidahmed Well-Known Member Licensed User Longtime User Jan 14, 2012 #3 I am not clear for above link.can u explain in brief ? Upvote 0
W wl Well-Known Member Licensed User Longtime User Jan 14, 2012 #4 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
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
J junaidahmed Well-Known Member Licensed User Longtime User Jan 14, 2012 #5 Thanks for your quick replay,I will try,if any doubt in this regard,pls help me. Sorry for my bad english Upvote 0
Thanks for your quick replay,I will try,if any doubt in this regard,pls help me. Sorry for my bad english
W wl Well-Known Member Licensed User Longtime User Jan 14, 2012 #6 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
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
J junaidahmed Well-Known Member Licensed User Longtime User Jan 17, 2012 #7 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 Message.txt 418 bytes · Views: 561 Upvote 0
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.
W wl Well-Known Member Licensed User Longtime User Jan 17, 2012 #8 It could be helpful if Erel would provide the source code of the java console app he wrote to send messages (you could easily decompile it, I guess Anyway: the API can be found at Google: Android Cloud to Device Messaging Framework - Google Projects for Android (especailly section "How the Application Server Sends Messages") Wim Upvote 0
It could be helpful if Erel would provide the source code of the java console app he wrote to send messages (you could easily decompile it, I guess Anyway: the API can be found at Google: Android Cloud to Device Messaging Framework - Google Projects for Android (especailly section "How the Application Server Sends Messages") Wim