A Grid view in android is generally used to  represent data in form of grids, i.e., rows and columns, in list view we can display any number of rows but when it comes to displaying both rows and columns we use grid view.

Generally in gallery we see grid views and shopping apps where products are shown using a grid view And again we can use make a customized grid view where we can place a simple image or image with text and description so on…

In this tutorial i will be showing a Grid View with and image view and simple description  text.



Now let’s start making our First Activity

Adding images and description in form of string array’s so that this will get displayed  in form of grid view.





Now design grid view i.e., what are the components to be displayed in list view i am using a image view and and one text view.



Creating a GridViewAdapter :

Here comes our GridViewAdapter where we can set the data into grid view.





Any queries in above tutorial post your comments.

Like and share this tutorial if you like it.

Show Buttons
Hide Buttons
Read previous post:
Android Login And Registration based on MYSQL Database using php Part 2.