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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:27:44+00:00 2026-05-24T23:27:44+00:00

I have an Android Gallery widget that displays several ImageViews with pictures from the

  • 0

I have an Android Gallery widget that displays several ImageViews with pictures from the web. The images are stored as jpgs, and get converted to bitmap before added to the ImageViews. Each jpg is 8kb. I’m not doing any scaling on the images.

When I use the gallery with 1 or 2 pictures, it works fine, scrolling is smooth, etc. With 3, it starts to get a little choppy, and at 5 or 10 pictures the application is pretty much unusable.

Does anyone have any ideas as to why the performance is so bad? Does anyone have suggestions for alternatives? Thank you-

@elevine: my method to construct bitmap from jpg url:

private Bitmap getBitmapFromURL(String input) throws IOException {
        URL url = new URL(input);
        URLConnection conn = url.openConnection();
        conn.connect();
        InputStream is = conn.getInputStream();
        BufferedInputStream bis = new BufferedInputStream(is);
        Bitmap bm = BitmapFactory.decodeStream(bis);
        bis.close();
        is.close();
        return bm;
    }

This is my getView method from my ImageAdapter. I’m beginning to suspect this is where my problem lies… Am I grabbing the images way too many times? Thanks for your help!

public View getView(int position, View convertView, ViewGroup parent) {
            ImageView imageView = new ImageView(mContext);

            Bitmap bm;
            try {
                imageView.setImageBitmap(getBitmapFromURL(urls.get(position)));
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

            //mageView.
            imageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
            imageView.setLayoutParams(new Gallery.LayoutParams(100,100));
            return imageView;
        }
  • 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-05-24T23:27:45+00:00Added an answer on May 24, 2026 at 11:27 pm

    If you are calling getBitmapFromURL from your Activity, then it might be blocking the UI thread. Make sure this code runs on a separate Thread or inside an AsyncTask. You may also want to cache the Bitmaps inside a WeakHashmap. Check for the image inside the cache before grabbing it from the network.

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

Sidebar

Related Questions

I have an Android app that pulls in images from the Web. However when
i wish to have an android gallery that will host images of varying aspect
So I'm trying to build a gallery that displays images from a folder on
I have android app . i should pass the data from android to web
I have a gallery that shows the images of some playing cards. Each card
I am using the gallery widget to display images: <Gallery android:id=@+id/gallery android:layout_width=fill_parent android:layout_height=fill_parent android:layout_above=@+id/viewonline
I have button of pick image from android gallery in one activity name DrawingActivity.
I have an Android Gallery ImageAdapter implementation for getView() that looks as follows: public
I have noticed that some Android applications adds a new Wallpaper-gallery to the Wallpaper-chooser.
I am relatively new to Android Animation and Gestures. I have 15 images that

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.