1

I'm parsing an XML file, and extract it to an array with 504 length. Each item in array contains three fields of short String.

The problem occurs when I'm trying to populate the list with array content. Log Cat shows logs like this many times:

WAIT_FOR_CONCURRENT_GC blocked 9ms

GC_CONCURRENT freed 202K, 8% free 10694K/11527K, paused 12ms+13ms, total 52ms

As I searched, it means that a lot of objects are being created and they need a lot of memory

I reviewed my code and got to the conclusion that this happens in time of creating list. In consequence the performance is too low to use the app on a real device that has 1024MB RAM.

Are there any optimized ways to render large lists in android?

Does this improve the performance, If I extract xml to Database, then make the list?

Community
  • 1
  • 1
Ata Iravani
  • 2,146
  • 7
  • 29
  • 40
  • Just an Idea, could be an encoding problem when dealing with XML try using these classes: XmlPullParser and XmlSerializer or maybe you need to do it on a worker thread. – user2288580 Jun 26 '16 at 17:30

1 Answers1

1

The best solution would be to reimplement the the ArrayAdapter, there is already a similar question here. Edit: This video from Google I/O 2010 it will give you an idea on how ListViews work.

Community
  • 1
  • 1
DormeoES
  • 101
  • 8
  • I watched the video, helped me a lot – Ata Iravani Jul 21 '14 at 10:54
  • This solution you suggested is so advanced, but also useful. I decided to split my large list into smaller lists, so that when I'm trying to make objects out of them, I do not lose performance. – Ata Iravani Jul 21 '14 at 11:03