Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OkHttp + Picasso + Retrofit

The question is how to combine all these 3 libraries in one project?

  • Make one OkHttpClient to be a background layer for both Picasso and Retrofit.
  • How to make Priority changes like in Volley lib. (for pagination)?
like image 688
Alex Avatar asked May 23 '14 14:05

Alex


1 Answers

In a nutshell:

OkHttpClient okHttpClient = new OkHttpClient();
RestAdapter restAdapter = new RestAdapter.Builder().setClient(new OkClient(okHttpClient)).build();
OkHttpDownloader downloader = new OkHttpDownloader(okHttpClient);
Picasso picasso = new Picasso.Builder(this).downloader(downloader).build();

I do not think it's possible to have priorities with the current version of Retrofit.

like image 126
Catalin Morosan Avatar answered Oct 20 '22 17:10

Catalin Morosan