Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8261453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:24:46+00:00 2026-06-08T03:24:46+00:00

Description of the problem: I’m creating a scrollable list of articles with thumbnails that’s

  • 0

Description of the problem:
I’m creating a scrollable list of articles with thumbnails that’s populated by my SQLite database. In general, it’s “working” except being slow:

The images load very slowly… I thought using the “Universal Image Loader” cached the images on the device, and that that would make them appear to just scroll into view if you’d already viewed them (or at least close to that). But – when you drag up/down, none of the images are there, then 3-5 seconds later, the images start popping in (as though it’s re-downloading them)

I’m changing the visibility of the thumbnail boxes on the fly, but that is working flawlessly – they don’t appear to change – they just scroll into view or not, no flashing or anything. (but then the images don’t appear for another few seconds).

I’ve tested by removing my php script after scrolling around… when I scroll back to prev spot, the images don’t show up – making me assume it’s loading from my PHP script EVERY time.

But according to the docs: “UsingFreqLimitedMemoryCache (The least frequently used bitmap is deleted when cache size limit is exceeded) – Used by default”

Details:

In my ArticleEntryAdapter.js I have:

@Override
public View getView(final int position, final View convertView, final ViewGroup parent) {

    // We need to get the best view (re-used if possible) and then
    // retrieve its corresponding ViewHolder, which optimizes lookup efficiency
    final View view = getWorkingView(convertView);
    final ViewHolder viewHolder = getViewHolder(view);
    final Article article = getItem(position);

    // Set the title
    viewHolder.titleView.setText(article.title);

    //Set the subtitle (subhead) or description
    if(article.subtitle != null)
    {
        viewHolder.subTitleView.setText(article.subtitle);
    }
    else if(article.description != null)
    {
        viewHolder.subTitleView.setText(article.description);
    }

    ImageLoader imageLoader = ImageLoader.getInstance();

    imageLoader.displayImage("", viewHolder.thumbView); //clears previous one
    if(article.filepath != null && article.filepath.length() != 0) {
        imageLoader.displayImage(
            "http://img.sltdb.com/processes/resize.php?image=" + article.filepath + "&size=100&quality=70",
            viewHolder.thumbView
            );
        viewHolder.thumbView.setVisibility(View.VISIBLE);
    } else {
        viewHolder.thumbView.setVisibility(View.GONE);
    }

    return view;
}

As far as the images being incorrect – it’s not often, but sometimes while scrolling, I’ll see 2 of the same image, and when I look at the articles, they’re not at all related (ie no chance of actually having the same image) So – I scroll away from it, and back, and it’s no longer the incorrect image.

NOTE: I’m new to Java/Android – you probably already noticed that.

More code per comment-request:

private View getWorkingView(final View convertView) {
    // The workingView is basically just the convertView re-used if possible
    // or inflated new if not possible
    View workingView = null;

    if(null == convertView) {
        final Context context = getContext();
        final LayoutInflater inflater = (LayoutInflater)context.getSystemService
          (Context.LAYOUT_INFLATER_SERVICE);

        workingView = inflater.inflate(articleItemLayoutResource, null);
    } else {
        workingView = convertView;
    }

    return workingView;
}

UPDATE:
My Manifest file has:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

But the cache folder I found is completely empty:

mnt
  -sdcard
    -Android
      -data
        -com.mysite.news
          -cache
            -uil-images
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T03:24:48+00:00Added an answer on June 8, 2026 at 3:24 am

    I was experiencing similar issues with images in list view. Possibly this answer will correct your wrong image problem.

    I just downloaded the sample project with UniversalImageLoader and it exhibits the same behavior you are describing.

    A few notes so far from looking through the source code.

    public static final int DEFAULT_THREAD_POOL_SIZE = 3;
    public static final int DEFAULT_THREAD_PRIORITY = Thread.NORM_PRIORITY - 1;
    public static final int DEFAULT_MEMORY_CACHE_SIZE = 2 * 1024 * 1024; // bytes
    

    This says that at any time there will be three threads downloading and max of 2MB of images. How big are the images you are downloading? Also are you caching to disk? If so, that will be slow.

    To configure some of the basic options in the ImageLoader you will need to pass in to displayImage:

     DisplayImageOptions options = new DisplayImageOptions.Builder()
         .showStubImage(R.drawable.stub_image)
         .cacheInMemory()
         .cacheOnDisc()
         .build();
    

    I would also like you to try these options:

    ImageLoaderConfiguration imageLoaderConfiguration = new ImageLoaderConfiguration.Builder(this)
        .enableLogging()
        .memoryCacheSize(41943040)
        .discCacheSize(104857600)
        .threadPoolSize(10)
        .build();
    
    imageLoader = ImageLoader.getInstance();
    imageLoader.init(imageLoaderConfiguration);
    

    With my testing, the images are on disk, but loading is still slow.

    After extensive testing, I determined the primary issue is that UniversalImageLoader is just slow. Specifically, the ImageLoader and LoadAndDisplayImageTask are holding up the works. I (very quickly) rewrote the LoadAndDisplayImageTask as an AsyncTask and it immediately performed better. You can download the forked version of the code on GitHub.

    Universal Image Loader with AsyncTasks

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Below is the problem description and algorithm that I have written. Is there anything
I am working with sockets. Here are my codes (the description of problem is
Description of problem: I have an updatepanel that works fine in all browsers in
Problem Description: Multi-player Game that works over the some kind of network, in game
Here's a problem description. CONDITIONS: General idea is to read a lot of real
Problem description: I have a POJO object, which is mapped from database. Which having
Problem Description I'm writing module for Android (JAVA) that use native code (C) .
Problem description : I'm trying to define a pl/python aggregator that receives a set
Problem Description I am writing a Java application that lets programmers query for page
Problem Description I have an abstract Paper class that contains common properties of all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.