0

In my app I download from the net some data I need to arrange in a table way. I already know dimensions: about 26 rows and 6 columns, anyway data can change across subsequent calls so I have to create this table in a dynamic way.

As it is a table I though using a TableLayout (never used before), on the other hand I could simply use a list view, using for the single item a 6 elements linear layout with horizontal orientation.

ListView intrigues me because it is an adapter view (I think I'll store this data in a sqllite db, later) so populating it is quite simple and straightforward, anyway I don't know if it is the best for my problem.

What is your opinion?TableLayout, ListView or other?

Phate
  • 6,066
  • 15
  • 73
  • 138
  • Do you require horizontal scroll for each row? Because data may not be completely visible on small devices. – Vishal Vyas Sep 27 '12 at 16:12
  • Well data is mainly numbers, at most 2 digits, so I guess horizontal space is more than enough!:) – Phate Sep 27 '12 at 16:18

2 Answers2

1

When it comes to performance, I think you should use ListView because ListView support Recycling of view and you can check this and this post for more detail regarding Recycling of view.

Hope it helps :)

Community
  • 1
  • 1
Vishal Vyas
  • 2,571
  • 1
  • 22
  • 39
0

A ListView is a collection of layouts that are automatically displayed one below the other. The developer adds new items through a piece of code in the Activity. An example is the address book where you have lots of contacts one after the other.

A TableView on the other hand is defined in the layout file and does not only need to contain elements below or above each other but can also arrange elements on the left or on the right. A TableView is exactly what it says: A table with rows and columns.

here's a similar question that might answer what you want to know

Community
  • 1
  • 1
Hip Hip Array
  • 4,665
  • 11
  • 49
  • 80