There are many ways but the best way is to use volley https://github.com/mcxiaoke/android-volley
http://arnab.ch/blog/2013/08/asynchronous-http-requests-in-android-using-volley/
Or simply you can use a AsynTask for network calls How to use AsyncTask correctly in Android