Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Mobile: Quicker way to load large data into table view?

Hi all,

I've got a big list of paired data (ID + Description, hundred of them) needs to be loaded into a table view.

Apperanetly I've used a external sqlite file to store the data and have it populated into a array at the beginning of application. The Array gets saved into the App Properties as a Array of Strings.

At a later stage of the application, I used GetArray from the Properties and run through a FOR loop to create and push each TableViewRows.

The Array of Rows then gets SetData into the TableView.

The performance was fine on the simulator, but I then realized that on the actual iphone device, the delay was a too long for a smooth experience.

I was wondering if any of you have any good practice to share on the situation?

Thanks in advance.

— asked April 20th 2010 by William Xue
  • data
  • iphone
  • mobile
  • sqlite
  • tableview
0 Comments

3 Answers

  • Accepted Answer

    i have the same problem with slowness in tableviews. i'm trying to display about 1500 entries at once, this takes about 30secs on an iPhone 3G and about 10secs on a 3GS while using titanium, however using the the native SDK this entries are displayed almost immediatly on both devices, so i guess it's the tableview implementation of titanium mobile that's causing it

    i got some increase in speed (2-3 secs on the iPhone 3GS) after putting my whole sqlite table as an json-string into the source-code and using this as base for the tableview, however you have to split your json-table into more than one string, as it seems that there is a limit .in the json.decode function. i then joined the results and it worked. this is a dirty hack, but seems to result in faster processing of the tableview

    — answered April 20th 2010 by Christian Sigl
    permalink
    0 Comments
  • Thanks for your answer Christian!

    It seems like a good workaround for now.

    — answered April 20th 2010 by William Xue
    permalink
    0 Comments
  • Thanks for your answer Christian!

    It seems like a good workaround for now.

    — answered April 20th 2010 by William Xue
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.