locked
Best Android library for caching images RRS feed

  • Question

  • User101220 posted

    Hi Guys, I need a library to load images async and cache them when loaded. I'm searching for the best Xamarin Android Library and I found Picasso and other free projects. Can someone suggest me which is the best?

    Thanks :)

    Thursday, May 19, 2016 7:25 AM

Answers

  • User183364 posted

    Yes you can use Picasso from https://components.xamarin.com/view/square.picasso and additionally you may look at https://github.com/luberda-molinet/FFImageLoading.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, May 19, 2016 8:49 AM
  • User15966 posted

    If you want to do it with FFImageLoading, here is the wiki page that explains callbacks: https://github.com/luberda-molinet/FFImageLoading/wiki/API#callbacks

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, May 19, 2016 2:44 PM

All replies

  • User183364 posted

    Yes you can use Picasso from https://components.xamarin.com/view/square.picasso and additionally you may look at https://github.com/luberda-molinet/FFImageLoading.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, May 19, 2016 8:49 AM
  • User101220 posted

    Ok thanks. :) I also need to subscribe to the event of "image load finished"...for example when I load image into an image view and I wanna to do something after loading. Is there a way to do this using Picasso?

    Thursday, May 19, 2016 9:33 AM
  • User15966 posted

    If you want to do it with FFImageLoading, here is the wiki page that explains callbacks: https://github.com/luberda-molinet/FFImageLoading/wiki/API#callbacks

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, May 19, 2016 2:44 PM
  • User101220 posted

    Ok thanks to all, I'm using Picasso now and I understood how to manage callbacks ;)

    Monday, May 23, 2016 1:44 PM
  • User246723 posted

    @RiccardoBadini said: Ok thanks to all, I'm using Picasso now and I understood how to manage callbacks ;)

    What made you choose Picasso over FFImageLoading? Do you have any pros-cons comparison?

    Monday, August 29, 2016 12:43 PM
  • User221588 posted

    I tried both Picasso and FFImageLoading. In Picasso, downloaded images disappear when I scroll back up. Suggest FFImageLoading which is faster and cache friendly. Tried FFImageLoading in listview to load around 50 images. Its working great. Refer https://forums.xamarin.com/discussion/58341/ffimageloading-plugin-fast-and-memory-friendly-image-loader-ios-android-forms-windows

    Wednesday, April 12, 2017 9:38 AM
  • User316229 posted

    I need some urgent help. I want to call a function in picasso library after image has been load but did not find some hint. How to do this? This is java code and i want to implement in Xamarin. Picasso.with(getContext()) .load(url) .into(imageView, new com.squareup.picasso.Callback() { @Override public void onSuccess() {

                        }
    
                        @Override
                        public void onError() {
    
                        }
                    });
    
    Thursday, June 8, 2017 4:36 AM
  • User258468 posted

    I actually really like Akavache. I use it for all my mobile caching needs including it's built in image request / caching.

    Thursday, June 8, 2017 8:30 PM
  • User237535 posted

    @MAmmar said: I need some urgent help. I want to call a function in picasso library after image has been load but did not find some hint. How to do this? This is java code and i want to implement in Xamarin. Picasso.with(getContext()) .load(url) .into(imageView, new com.squareup.picasso.Callback() { @Override public void onSuccess() {

                        }
    
                        @Override
                        public void onError() {
    
                        }
                    });
    

    Using the callback is exactly the same as the one override .into(imgView, () => { /*Success*/ }, () => { /*Error*/ } Unfortunately there are no error messages to help you solve issues.

    If you do want to use the callback, you have to create a new Class extending to Java.Lang.Object, Square.Picasso.ICallback Like so:

    public class PicassoCallback : Java.Lang.Object, Square.Picasso.ICallback
    {
        private Action Success;
        private Action Error;
        public picassocallback(Action success, Action error)
        {
            Success = success;
            Error = error;
        }
    
        public void OnError()
        {
            Error?.Invoke();
        }
    
        public void OnSuccess()
        {
            Success?.Invoke();
        }
    }
    

    Then you use it like this:

    .into(imgView, new PicassoCallback(() =>
    {
        //Success
    }, () =>
    {
        //Error
    });
    

    Just use the override and don't go through all the trouble of creating an extra class just for the same outcome.

    Friday, April 20, 2018 8:18 PM
  • User367610 posted

    An absolutely essential thing...... Thanks !!!

    Monday, April 23, 2018 5:09 PM
  • User367610 posted

    An absolutely essential thing...... Thanks !!!

    Monday, April 23, 2018 5:09 PM
  • User368472 posted

    @cwphilli said: I actually really like Akavache I use it for all my mobile caching needs including it's built in image request / caching.

    Hi, I read the read me document for Akavache at github and could see that it has not got its full documentation there. Could you please point any proper implementation of Akavache for Xamarin.Android/IOS. I would like to use it for image cacheing and also for cacheing objects received via http requests for certain amount of time. Thank you

    Sunday, November 25, 2018 5:21 AM
  • User319139 posted

    help

    please code in c# :( !!!!

    Glide.with(this) .load(GlideActivityA.FOXPICURL) .centerCrop() .dontAnimate() .listener(new RequestListener() { @Override public boolean onException(Exception e, String model, Target target, boolean isFirstResource) { supportStartPostponedEnterTransition(); return false; } @Override public boolean onResourceReady(GlideDrawable resource, String model, Target target, boolean isFromMemoryCache, boolean isFirstResource) { supportStartPostponedEnterTransition(); return false; } }) .into(imageView);

    Friday, May 3, 2019 4:36 PM