APP Communication with Web Server

3

I'd like to know how best to make my mobile / android application communicate with a web server (apache / php, for example) to receive / send data.

The idea is to have my mobile application from time to time consult the web server to get data, I thought at first to do via Http Request (GET) getting the result in JSON format, but my question is if this is the best way to do it. I know it could be via Web Service as well.

There are only these two "talk" (http / webservice) options?

Or is there some other model, such as via sockets on a particular port to be faster?

I await your tip.

    
asked by anonymous 10.03.2015 / 18:21

1 answer

5

You can use the official Google library for this, Volley . It is very easy to implement and there are several examples (besides official documentation).

Together with Volley , I recommend using OkHttp , which improves and optimizes your requests along with Volley .

  • Volley

Official documentation for Volley

A nice tutorial in Portuguese that can help you

  • OkHttp

Official site of OkHttp

A reference to how to use Volley + Okhttp

    
10.03.2015 / 18:28