Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way to create a data table in android? [closed]

I would like to create a table which is filled by data from DB. I know that it is possible to create a dynamic table using TableLayout but I'm not sure that it's the best solution im my case.
Here is an example of what I want to create(the first table on the page).

like image 353
Arsen Gyulgazyan Avatar asked Aug 06 '15 00:08

Arsen Gyulgazyan


1 Answers

I'll give you my inputs on this.

If your data is limited and you are sure to display all of it in a single screen in a presentable manner, then yes, a TableLayout will suffice.

However, in a real world, flexibility counts so you should always consider the possibility that your data may expand in the future. Keeping that in mind, you should use a ListView or a RecyclerView in this case. Define a base layout for each row of your list or recycler view and then connect the data from your database to this view using a suitable adapter.

For starters: https://developer.android.com/training/material/lists-cards.html

like image 71
androholic Avatar answered Oct 24 '22 09:10

androholic