Originally Posted by Fantasy
So i have a server that is written in C#. And in the server I have a variable. lets call it Timer. that Timer variable has the value of 5. I would like to send that variable from my server to my Android app and display it on the screen.
Now currently the way i'm doing this, is by making my Android app connect to my server through the internet using TCP protocol. and the server sends that piece of data to my Android app. Now my question is.
Is there another way to send that piece of information from my server to my Android app? Lets say for example using SQL or HTTP protocol.
Do you think using TCP protocol is the best way to send that information?
My whole application works like this. The server sends the Timer variable every time it changes to my Android app. which is ever second. The Android app receive this information and display it on the screen. that is the whole project.
Wedge has already answered your question, but I'll just clarify a couple of things about the OSI model
. TCP is a transport layer. SQL and HTTP are application layers. HTTP runs over TCP. What you would have done if you used TCP is created your own application layer protocol that runs atop of TCP. Just as Google Cloud Messaging likely runs atop of TCP.
SQL isn't a networking thing. It's a programming language designed for querying databases. While there are some dialects that can be used to write fully functional applications (eg PL/SQL), SQL wouldn't be appropriate for this kind of project.