Adeel Aslam
Adeel Aslam

Reputation: 1294

Android Displaying data on gridview

I have some data in my data base and i want to display it in android phone.I want to display my data on Grid-view because there is continuous variation in my data therefore i want to display in android like asp.net gridivew.Please anyone help me to do this or any example code to do this

Upvotes: 0

Views: 3156

Answers (2)

Prabhjot Singh
Prabhjot Singh

Reputation: 526

You need to have two things for the Gridview:

  1. Use Gridview component in a layout.

  2. Inflate the elements in a getView method and set elements position by position to the Gridview items.

You can follow this link to understand it:

http://android-coding.blogspot.in/2011/09/simple-gridview-example.html

Upvotes: 2

karn
karn

Reputation: 6033

You are on the right track as you have decided yo use a dynamic view for your varying data. You can use any one of the dynamic view(list view, grid view, gallery, etc) depending on the kind of data you need to display.
If you are not familiar with these dynamic views then you should first go through some tutorials on implementation of these views. First try with a basic program for understanding the concepts. Once you are clear with the concepts then all you need to do is to replace the underneath data with the data fetched from the data base. There are lots of tutorial available on net. Here are some links:

Feel free to discuss in case there is any doubt.

Upvotes: 0

Related Questions