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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:27:35+00:00 2026-06-16T04:27:35+00:00

I’m writing my first android app and coming from the iOS world. I’ve got

  • 0

I’m writing my first android app and coming from the iOS world. I’ve got a rather large query (~100k+ rows) that I’d like to display in a Table View with scrolling.

When I built this very same function in an iPhone app, their version of the tableview had automatic handling of JUST the rows that were on screen. This made the display pretty easy to get working.

From what I can see, It appears that the android tableview is loading the entire result and is massively slowing down.

Is there any built in functionality for the android tableview class that enables some form of “lazy loading” or do I have to write a number of handlers and limits into my query?

For example the pseudocode:

 // Event Method:
 //    tableview "onscroll"
 //        get current table view index
 //        query DB with limit "Number of rows to display", Offset firstRowOnScreen
 //        display each of the values in this "subset"

Currently the display code is:

    EditText editText = (EditText) findViewById(R.id.lookupFoodInfo);
    String message = editText.getText().toString();
    android.util.Log.i("FOOO", message);

    String where = "";
    if (message.trim() != "") {
        where = "WHERE Long_Desc LIKE '%"+message.trim()+"%'";
    }

    String sql = "  SELECT bt.Long_Desc " + 
                " FROM BIG_TABLE bt INNER JOIN OTHER_TABLE ot ON bt.id = ot.fk_id " +
                where +
                " ORDER BY ot.value, bt.long_desc ASC";


    Cursor c = sqdb.rawQuery(sql, null);
    if (c != null) {
        c.moveToFirst();
        while (c.isAfterLast() == false) 
        {
            String data = c.getString(c.getColumnIndex("Long_Desc"));
            TableRow row = new TableRow(getApplicationContext());
            row.setLayoutParams(new LayoutParams(
                    LayoutParams.WRAP_CONTENT));

            TextView b3=new TextView(this);
            b3.setText(data);
            b3.setTextColor(Color.BLUE);
            b3.setTextSize(25);
            row.addView(b3);
            table.addView(row);

            c.moveToNext();
        }
    }
    c.close();
    sqdb.close();
    myDbHelper.close();

something very similar in iOS runs like lightning.

  • 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-16T04:27:37+00:00Added an answer on June 16, 2026 at 4:27 am

    What you’re looking for is a ListView and a CursorAdapter. ListViews have rows which are recycled once they move off screen, so you only have ~ n + 2 (where n is the number of visible rows) instead of one row per item in your database.

    http://developer.android.com/guide/topics/ui/layout/listview.html

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

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I am writing an app with both english and french support. The app requests
I am writing an app for my school newspaper, which is run completely online
I am currently running into a problem where an element is coming back from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.

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.