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 8849597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:41:35+00:00 2026-06-14T12:41:35+00:00

I have a problem with downloading images from internet. Problem is that images are

  • 0

I have a problem with downloading images from internet.
Problem is that images are downloading every other.
Problem occur when program is running on android <= 2.2.
Downloading are about 50 images with resolution 320×200

Code fragment:

public class DownloadOfferImages extends AsyncTask<List<ImageOfferData>, Bitmap, Void> {

    private InputStream inputStream;
    private BufferedInputStream buffer;

    @Override
    protected Void doInBackground(List<ImageOfferData>... offer) {
        for(int i = 0 ; !isInteruppted() && i < offer[0].size() ; i++) {
            if(offer[0].get(i).getImage() == null)
                downloadImage(offer[0].get(i));
        }
        return null;
    }

    private void downloadImage(ImageOfferData offerData) {
        try {
            download(offerData);
        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (OutOfMemoryError e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                closeStreams();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

    private void download(ImageOfferData offerData) throws MalformedURLException, OutOfMemoryError, IOException {
        URL imageUrl = new URL(offerData.getImageURL());
        URLConnection connection = imageUrl.openConnection();
        inputStream = connection.getInputStream();
        buffer = new BufferedInputStream(inputStream);
        Bitmap image = BitmapFactory.decodeStream(buffer);
        buffer.close();
        offerData.setImage(image);
        publishProgress(image);
    }

    /*
     * [rest of code]
     * 
     * 
     * */

}
  • 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-14T12:41:37+00:00Added an answer on June 14, 2026 at 12:41 pm

    I strongly recommend the wonderful Async Image Loader library:

    Examples included in README. Find it on github:

    https://github.com/nostra13/Android-Universal-Image-Loader

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

Sidebar

Related Questions

I have a problem downloading and putting in ImageView image that is downloaded from
I have folowing problem. I use curl for downloading images from server. I generating
I am building a Java applet that involves downloading images among other resources from
I am working on an application that downloads images from a url. The problem
I have this kind of problem where I want to download some images that
I have bunch of images from dozen or so sources and I am downloading
I have a problem that when dowloading a image from flickr.com,the python function urllib.urlretrieve()
Hi guys. I have a problem when downloading large size images.It's very strange, while
I have a problem downloading particular file types by WebClient. So there are no
I have a problem when downloading a large file (around 400mb) with a web

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.