2

I have to develop sdk for web service for android, should I consider using OkHttp for creating it instead of HttpUrlsConnection? If so what are the benefits of using it?

Christian Gollhardt
  • 16,510
  • 17
  • 74
  • 111
user3584307
  • 106
  • 9
  • if you are in learning phase of these than you should try both but you are working on some project I suggest do not waste you time in these library and try with retrofit or volley. – Ankush Bist Jan 02 '17 at 12:11
  • Already asked [here](http://stackoverflow.com/questions/16902716/comparison-of-android-networking-libraries-okhttp-retrofit-volley) (a similar question) You should go with Retrofit for my experience if you will go calling REST api – MatPag Jan 02 '17 at 12:15
  • OkHttp is always better than HttpUrlConnection. Also check this link to know more - https://medium.com/square-corner-blog/announcing-okhttp-a6497dab6114#.elk9u28n4 – Passiondroid Jan 02 '17 at 12:20

1 Answers1

0

you should try both if you are in learning phase. Libraries would make you work alot easier. But I would list down all the libraries used in making network call.

Retrofit Library - it is very easy to intergrate and fasten the network call Official Link.

Use the peer library Picasso if you are downloading images. Use OkHTTP if you need to do HTTP operations that lie outside of Retrofit/Picasso.

Volley Library - is officially supported by Google Check this

I would recommned you to use Retrofit it is very simple to use and documentation is also very nice.

Pros of Retrofit:

Compared to Volley in this REST API code is brief and provides excellent API documentation and have good support in communities! Very easy to add into the projects. We can use with any serialization library, with error handling.

Tulsi
  • 719
  • 7
  • 15