0

I want to establish a connection between client and server in my app. I query this problem on website, it supply two solutions:

  1. Use the Apache HttpClient lib
  2. Use the Java SDK HttpConnection class.

I wonder which one usually be used in common apps. Can they establish a safe or high-efficiency connection? If they can't finish the purpose, do I need use java socket to finish it by myself? Are there any existing libs now?

Sorry for that,this is my first time to use stackoverflow:),I just want to find a method of establishing a safe and high-efficiency connection,I don't want to compare httpclient with HttpConnection, which is better.

CrystalJake
  • 897
  • 2
  • 10
  • 18
  • What do you use the connection for? Retrieve data via an url? Retrieve an webpage? etc – RvdK May 22 '13 at 09:36
  • Safe as in reliable or safe as in secure? – Scorpio May 22 '13 at 09:38
  • connection for downloading application data or image from url – CrystalJake May 22 '13 at 09:44
  • reliable and high-efficiency,not for secure data operation – CrystalJake May 22 '13 at 09:45
  • check: [URLConnection or HTTPClient : Which offers better functionality and more efficiency?](http://stackoverflow.com/questions/9551058/urlconnection-or-httpclient-which-offers-better-functionality-and-more-efficie) and this one answer your question: [**Which client is best?**](http://android-developers.blogspot.in/2011/09/androids-http-clients.html) – Paresh Mayani May 22 '13 at 09:56

2 Answers2

0

Take a look at volley. It was recent released by google.

bogdan
  • 782
  • 3
  • 7
0

At the recent Google IO, Ficus Kirkpatrick had a talk on Volley, which included good examples on when to use, and especially when to not use. It might be relevant for you?

I'm unsure if the talk slides are available anywhere, but you can clone the codebase from here.

Cheers,

Anders R. Bystrup
  • 15,729
  • 10
  • 59
  • 55