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

  • Home
  • SEARCH
  • 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 4108398
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:38:56+00:00 2026-05-20T21:38:56+00:00

I’m having a little problem with an app I’m working on. The app shows

  • 0

I’m having a little problem with an app I’m working on. The app shows a gallery that shows between 1 and 70+ pictures (one at a time), all downloaded from the web.

At first I save a low resolution picture and after I finish downloading all low res pictures, I start downloading the high resolution ones and replacing them.

The problem comes when I start downloading the high dpi ones. After some are downloaded I get a memoryOutOfBoundsException (which can be expected).


To solve that kind of problem in android I’ve seen four options:

1.- Using androids Cache Manager.

This is limited to Web Views (So I can’t use them).

2.- Loading the hi res picture every time the user passes thru a picture.

That will make the bad resolution picture appear every time the user changes the picture until the high resolution one (which is loading on the background) gets downloaded and switched. Making the application look bad.

3.- Creating some kind of RAM cache that can hold like 5 pictures and use something like the second method.

In this case, I’ll try to have, in the ram, the 5 hi res pictures nearest to the one that is being showed (either downloaded or being downloaded) so that the app can show hi res pictures for the ones that are near the selected one without having to download them after the user gets to see the low res picture.

4.- Creating a personal Cache Manager

In this case I’ll create a personal cache manager that saves the pictures on the SD card and uses those pictures on the gallery. This also brings one problem, I’ll depend on the user having an SD card on the device. For solving the problem of the files staying on the device after the app is deleted (If the app gets deleted), I’ll just delete all the files on the onDestroy() method of the app (I don’t mind loading them again).


In my opinion, the best option is the fourth. Method, which forces me to depend on the user having an SD card.

Now my questions.

Is there any other way of solving my problem?

Is there another kind of memory on the device than can be used to evade the dependency of the SD card?. Following the question. Is it recommended to use that kind of memory or does using it bring other problems?. (Also, a tutorial about it wold be apreciated.)

Do users usually have SD cards or is the fourth option the worst one?

Thank you in advance.

  • 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-20T21:38:58+00:00Added an answer on May 20, 2026 at 9:38 pm

    I would write my own cache manager. If the user can only load pictures to the left and right in the list, I’d keep those three in memory if possible and shift every time the user navigates to a new picture. I’m not sure if that’s how your app works, but that’s one way of doing it. If you can’t predict your user’s next choice, maybe have a revolving cache and experiment with how many you can hold in memory at once (not knowing the best, worst and average case of your file sizes, I can’t really speak much on that).

    You may know this already, but it’s always worth mentioning. When you’re working with Bitmaps, any time you’re done with one…really done with it (such as flushing it from your cache), call it’s recycle method. That seems to be the quickest and most widely accepted way of reclaiming that memory for the system.

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

Sidebar

Related Questions

I'm having a little problem and I don't see why, it's easy to go
I'm having a little problem with the following: When I execute this line: echo
I’m having a little Architecture problem. In my project I have a Business Logic
I'm having a little bit of a problem scaling my images to a properly
I'm having a little bit of trouble understanding what the problem is here. I
I'm having a little bit of trouble making a sticky form that will remember
Im having a little problem on handling touches in my apps. I set my
I have been working on a Windows Mobile app for a little while now
First off, I'm working on an app that's written such that some of your
im having a little problem with the Google API maps, i was wondering if

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.