0

I need to communicate with our REST-API. I found the LoopJ AndroidAsyncHttp library, but I am not sure if it is a good idea to use it, because it seems to use the HttpClient which is now deprecated in Android API 22. I found this apache project, but I am not sure if I simply can add this to my project and it will work with AndroidAsyncHttp. Any ideas or alternatives?

Stephane Landelle
  • 6,990
  • 2
  • 23
  • 29
KCD
  • 678
  • 5
  • 20

1 Answers1

2

Android volley library is an excellent solution for http requests:

https://github.com/mcxiaoke/android-volley

It provides three common request types: StringRequest, JsonObjectRequest and ImageRequest but you can write your custom request also. It is easy to learn and you have ton of examples on the web.

Tomislav
  • 3,181
  • 17
  • 20
  • Yes! Definitely is the way to go, as documentation suggests. You can find info on how to use it [here](https://developer.android.com/training/volley/index.html) – Joaquin Iurchuk Jul 01 '15 at 13:18
  • Thanks, this is maybe the solution, although it seems to be used more fore simple calls API -> getJSON -> update UI. My update strategy will look a bit more complicated (I HAVE to query all updates at app start). But I will give it a try. – KCD Jul 02 '15 at 11:01
  • Volley is a piece of crap, you can't even send normal POST requests, instead it needs to be json what you send –  Jun 21 '20 at 15:15