0

I am developing an android application, I am getting data from an JSON web services, But the loading of images is too slow even I am using ImageLoader, I want loading of data like Android application Of YouTube , It is loading data very fast even on 2G mobile n/w connection.

Pls Help me, how can I do that....

manuell
  • 7,528
  • 5
  • 31
  • 58
Rohit
  • 687
  • 5
  • 22
  • it depends on lot of things like the image sizes which you download etc,,, try with volley library which is having some optimality and can help you!! – Jitesh Upadhyay Feb 11 '14 at 10:31
  • 1) Profile your app to see where the time is spent 2) Optimize the bottlenecks 3) Repeat – laalto Feb 11 '14 at 11:20
  • You can try Picasso library. It's easier to use than Volley and pretty fast and reliable. Check it here - https://github.com/square/picasso – makovkastar Feb 14 '14 at 08:45

1 Answers1

1

Fastest option today is to use Volley.

Watch this Google IO talk: https://developers.google.com/events/io/sessions/325304728

And here is an example: http://cypressnorth.com/mobile-application-development/setting-android-google-volley-imageloader-networkimageview/

Just replace your ImageView by NetworkImageView in your XML like ths:

<com.android.volley.toolbox.NetworkImageView
    android:id="@+id/networkImageView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:scaleType="centerCrop" />

And in your source code (in your adapter), you set the URL like this:

yourNetworkImageViewReference.setImageUrl( "you_url_here" , MyVolley.getImageLoader() );

PS: You will also need the BitmapLruCache class you can find on this post: Android Volley ImageLoader - BitmapLruCache parameter?.

Community
  • 1
  • 1
  • Thanks for your support, I hope that it will help me.... – Rohit Feb 11 '14 at 10:47
  • Thanks, I have read about the volley library, it's really so fast, can you provide me any link from that i can setup volley into my project for loading images – Rohit Feb 12 '14 at 11:21
  • I've added some code example in the answer, together with the BitmapLryCache class. Make sure to follow the full example provided in the first link. – Bitcoin Cash - ADA enthusiast Feb 12 '14 at 20:52