abhishek
abhishek

Reputation: 1

android database value retrieving

I have a database with three rows and columns.I have managed to insert the data into the table.Now i am trying to retrieve the values in a tabular format in my xml view. How to go about this.

Any help is appreciated.

Thanks.

Upvotes: 0

Views: 258

Answers (1)

Jayy
Jayy

Reputation: 14728

What you're asking for is a fair amount of work, but saying that, it's relatively straight forward.

The problem is, your request is so vague that people are reluctant to help.

One possible solution (although it might not fit what you need) would be:

1) Create a ListActivity 2) Create a custom SimpleCursorAdapter. 3) Create a custom xml view for each row. 4) override SimpleCursorAdapter's getView() to inflate said xml view 5) Override SimpleCursorAdapter's bindView() method to assign values from the cursor to the row.

The questions in my mind which stopped me from trying to code this for you are: 1) Might you want to change the number of columns dynamically? 2) Might you want more flexibility as to how the column widths are decided upon? etc..

A slightly more complex setup would use TableLayout and TableRow.

Upvotes: 1

Related Questions