0

@nostra13 I download the library https://github.com/nostra13/Android-Universal-Image-Loader

when I run the sample code given on the above link , for most of the images I get READ TIMED OUT ...

I was trying on wifi and the net speed is good and the device was Samsung Galaxy S

Can u help....

leppie
  • 115,091
  • 17
  • 196
  • 297
Aamir Shah
  • 4,473
  • 8
  • 21
  • 28
  • 1
    If this is the error you are getting: `java.net.SocketTimeoutException: Read timed out`, try this answer: http://stackoverflow.com/a/7609506/450534. If not, add the actual stacktrace. – Siddharth Lele Nov 28 '12 at 06:08
  • @SiddharthLele yes its the same problem..... But the thing is that I'm including anything in my code... I just downloaded the sample code from the git-hub and without changing any thing i'm running the downloaded code.... Also i still didn't get how to solve this problem – Aamir Shah Nov 28 '12 at 08:19
  • Show error stacktrace from LogCat. – nostra13 Nov 28 '12 at 19:30
  • @NOSTRA loag cat is at http://pastebin.com/C00Wt0qv All i did is Clicked on ImageList Button and then gave a scroll to the list view.... – Aamir Shah Nov 29 '12 at 12:00

1 Answers1

0

I don't know the specfic's of how Universal Image loader is implemented. But glancing at the github sample code I notice something. It appears that the default sample code isn't recommend to be used in your project as is. So that probably why the sample code doesn't run out of the box. Look for this block of configuration

// DON'T COPY THIS CODE TO YOUR PROJECT! This is just example of using ALL options. Most of them have default values.
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext())
            .memoryCacheExtraOptions(480, 800) // max width, max height
            .discCacheExtraOptions(480, 800, CompressFormat.JPEG, 75) // Can slow ImageLoader, use it carefully (Better don't use it)
            .threadPoolSize(3)
            .threadPriority(Thread.NORM_PRIORITY - 1)
            .denyCacheImageMultipleSizesInMemory()
            .offOutOfMemoryHandling()
            .memoryCache(new UsingFreqLimitedMemoryCache(2 * 1024 * 1024)) // You can pass your own memory cache implementation
            .discCache(new UnlimitedDiscCache(cacheDir)) // You can pass your own disc cache implementation
            .discCacheFileNameGenerator(new HashCodeFileNameGenerator())
            .imageDownloader(new URLConnectionImageDownloader(5 * 1000, 20 * 1000)) // connectTimeout (5 s), readTimeout (20 s)
            .tasksProcessingOrder(QueueProcessingType.FIFO)
            .defaultDisplayImageOptions(DisplayImageOptions.createSimple())
            .enableLogging()
            .build();
// Initialize ImageLoader with created configuration. Do it once on Application start.
imageLoader.init(config);

And modify the following code to use a much longer timeout. Try it and report back if this helped.

  .imageDownloader(new URLConnectionImageDownloader(5 * 1000, 20 * 1000)) // connectTimeout (5 s), readTimeout (20 s)
Jerad
  • 709
  • 5
  • 11
  • I tried this... but still its not working... and btw i'm simply using the example given by the author on git-hub... – Aamir Shah Nov 28 '12 at 08:27