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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:18:22+00:00 2026-06-08T11:18:22+00:00

I recently followed Googles Advice on Bitmap Caching in Android and added my own

  • 0

I recently followed Googles Advice on Bitmap Caching in Android and added my own LruCache from the support library. The LruCache works best if the size of the images in bytes is known to the cache.

The problem ist the getByteCount for bitmaps is only available since Android API Level 11.

How would you guess the size of an bitmap in memory?

  • 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-08T11:18:24+00:00Added an answer on June 8, 2026 at 11:18 am

    From the android.graphics.Bitmap source code:

    public final int getByteCount() {
            // int result permits bitmaps up to 46,340 x 46,340
            return getRowBytes() * getHeight();
        }
    

    Both getRowBytes() and getHeight() are since API Level 1, so you can implement your own own getByteCount() for all versions of Android. At a glance, it appears that getByteCount() was only added for convenience.

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

Sidebar

Related Questions

I recently followed a way of programming for Android using Scala and Eclipse ,
I have recently upgraded an app from Rails 3.0 to 3.1. I have followed
I recently followed a small tutorial on howto install apache on a systems where
I recently followed Scott Hansleman's instructions on setting up SSL locally using IIS Express
I recently followed some instructions with RVM to install ruby-debug and I think it
Recently We started on optimizing a database which never followed any standards. We though
I recently installed xampp, followed the installation. MySQL/apache. (I have same website running on
Okie dokie - IT recently updated my system to lion, fresh install. I followed
Right, hi guys, I recently followed a tutorial http://xnadevelopment.com/tutorials/thestateofthings/thestateofthings.shtml where I wanted to create
I've found today that my recently published app on the Android Market, is not

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.