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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:32:56+00:00 2026-06-08T18:32:56+00:00

I have created a database of objects. Each of these objects contains two strings

  • 0

I have created a database of objects. Each of these objects contains two strings and two bitmaps. When I do a getAllContacts() call to my database, the loading takes quite a while. For me its not a problem, but for the end-users, this would be annoying. When I load an object I set this options to my bitmaps saying:

  BitmapFactory.Options options=new BitmapFactory.Options();
  options.inSampleSize = 8;

Which will shrink the Bitmaps to 1/8 of the original height and width. But still, it takes around 10-15 seconds to load 50 records and fill this into a ListView. Is there any way I can check if the object I try to load is in the memory, also called paging? Or maybe I can load the Bitmaps, when the users presses one of the items in the ListView?

Thanks 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-06-08T18:32:57+00:00Added an answer on June 8, 2026 at 6:32 pm

    The solution:

    So, finally I found a solution to my problem. Instead of getting all of the Bitmaps when I do a getAllContact() call, the bitmap’s is loaded when the user presses a row in the ListView This is whats done in the setOnClickListener method in CustomAdapter for my ListView

    String PCN = cases.get(position).getCaseNumber(); 
    int tempPCN = Integer.valueOf(PCN); 
    tempBitMapArray = dbHandler.getFinger(tempPCN); 
    
    Bitmap left = tempBitMapArray[0]; 
    Bitmap right = tempBitMapArray[1]; 
    
    ByteArrayOutputStream bs1 = new ByteArrayOutputStream();
    left.compress(Bitmap.CompressFormat.PNG, 100, bs1);
    
    ByteArrayOutputStream bs2 = new ByteArrayOutputStream();
    right.compress(Bitmap.CompressFormat.PNG, 100, bs2);
    

    And the getFinger(...) method:

        public Bitmap[] getFinger(int pcn) {
    
        Bitmap[] fingers = new Bitmap[2]; 
    
        String SQLQUERY = "SELECT " + RIGHTFINGER + ", " + LEFTFINGER +" FROM " + TABLE_CASES  + " WHERE " + KEY_ID + "=" + pcn + ";"; 
    
        SQLiteDatabase db = this.getWritableDatabase(); 
    
        Cursor cursor = db.rawQuery(SQLQUERY, null); 
        BitmapFactory.Options options=new BitmapFactory.Options();
            options.inSampleSize = 2;
          if (cursor.moveToFirst()) {
                do {
    
                    byte[] blob1 = cursor.getBlob(cursor.getColumnIndexOrThrow("leftFinger"));
                    Bitmap bmp1 = BitmapFactory.decodeByteArray(blob1, 0, blob1.length, options);
    
                    byte[] blob2 = cursor.getBlob(cursor.getColumnIndexOrThrow("rightFinger")); 
                    Bitmap bmp2 = BitmapFactory.decodeByteArray(blob2, 0, blob2.length, options);
    
                    fingers[0] = bmp1; 
                    fingers[1] = bmp2;
                    return fingers;
    
                   } while(cursor.moveToNext());
          }
          return null; 
    }
    

    I hope this example will give other people a pinpoint in the right direction.

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

Sidebar

Related Questions

I have created these two files: class myDbClass { function dbConnect($db) { $dbhost =
I'm using ASP.NET with C# 2.0. I have created some objects for a database
Let's say I have a database full of Tag objects. Each Tag has an
I have created my database by this sql query: (CREATE DATABASE + DBName +
I have created a database of my movies and another with my actors in
I have created my database, and used cake bake my_project to create my project,
I have created SQL Server database by Visual Studio 2010 Ultimate means in Visual
I have created a MySQL database using MySQL Workbench. It has about 20 tables.
I have created the following database layout, and started coding the application. The more
I have created SQL Server 2008 Database project using visual studio 2010. after build

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.