I have to display web Services Data Either in Tabular form or in Grid form.Where rows and columns of the grid view dynamically increase or decrease.
Every column must have an header.
All the things including header ,images ,no of rows and columns of Grid view can change either product wise or Number of No of item wise.
Means There are No. of product and a Product have No. of Item and its properties.All these thing i have to display either in Grid view or in table view.Where header, images of product or item,and No. of rows and columns can change Dynamically.
What would be the best way to implement this.Does the custom Adapter for displaying the a dynamic table would be helpful.
Please Guide me.New In Stack Over Flow.
Related
I'm trying to develop a 3 column gridview and I need advices.
2 columns data coming from database and 3rd column is a delete button.
Data is stored in sqlite and columns like following;
1-Name: name of the product(string)
2-Type(Picture): type picture of the product, there are 10 pictures(type1.gif,type2.gif,...type10.gif)
3-Delete: It is a button or imagebutton which will delete the data from sqlite db.
Can you give a sample project link or tell me which one is better for performance and less code, gridview or listview?
As a suggestion,
you can create a list view, there you need to create a custom layout for the each row. This custom layout consist with textview (product name) , imageview (for the image) and a button. Once you click a certain button , you can get the product name/id from the respective model and delete the corresponding row from the database.
Use view holder patterns for this, and use lazy loader or similar technique to load the rows into the list (if total rows count is much larger).
This would be a the one of easy/efficient way to do this and you can easily find the code from google.
I'm trying to implement an irregular gridview for my Android app. I've defined the gridview to show 2 columns but I need to show just 1 column at the first row. Is it possible using a DataAdapter?
I don't think you can accomplish this with a gridview. The adapter simple provides the data, but the view decides how to lay it out. If your requirements allow you to make the number of columns constant, then maybe you can use the gridlayout instead. I'm thinking you could try to do you layout like the google currents app.
Gridview and ListView are super useful if you have 1000's of items since it reuses views as it scrolls. If you have lots a items in your grid, then I would probably try to use the GridView or ListView to accomplish your goal. Maybe you have to get your requirement changed. Another option is to use a ListView, but sub-divide each row into 2 columns.
I have a program that I would like to display the name and house number of a group of people. This information is being picked up from a web server and is all sorted (xml format) but I wanted it to be displayed in a ListView with the two different pieces of information in a single list item. When getting the information from the server there may be 3 people there may be 30 so a list view where it extends with the amount of information there is is essential. Any ideas?
You would create a ListView and set your own customized ListAdapter that will display the two pieces of information you need in a single list item
Consider using an ExpandableListView it allows you to have custom "sub-data" under each list item.
Let's say i have a 100 rows*100 columns table layout containing button for each cell. It means 10000 buttons. As the data for each cell is taken through a web request which is not possible for 10000 cells. So i want to populate the data for only those cell which are visible on screen. Is it possible to have data visible only for those cell which are currently visible on screen.
Thanks for help
You should use GridView. Also if you will get the images from the web you should get them asynchronously and I would reccomend using DroidFu WebImageView. Here is the DroidFu Google project.
I am building one app which is a copy of a website.
In that website they showed some bulk of data in a table view (with multiple rows and columns)
I want to show the same bulk of data in android mobile.
But the problem is which widget will be reliable to show large amount of data (like table). And which widget will give efficient and professional look.
Please suggest some widget or views
For a static (predefined/known)
content you can use TableLayout,
as in this example,
For dynamically populate the table
you should use a GridView
(considering as an option the
ListView as well: if you don't
have many columns, an proper item
renderer would be more efficient).