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

16,076

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

Share:
16,076
Admin
Author by

Admin

Updated on June 27, 2022

Comments