Populate the cell which are visible on screen in table layout - android

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.

Related

Multi-column image grid with dynamic loading in android

I want to load list of images from the server.
1) I prefer if I can use the screen space optimally by adjusting the image columns.
2) User should be able to click each image individually and navigate to the next screen.
3) Further, when the screen first loads, I would like to load few image slots with loading image and replace them when we get the data from the server. It will add additional image slots as well (i.e after replacing first few) based on the data. so that user can see we are waiting for the data.
See below
What I already tried.
1) Using custom list view and adapter approach (http://www.androidhive.info/2012/02/android-custom-listview-with-image-and-text/), I created a layout with two listviews, acting as two columns and loaded images each one separately. Issue is user will see two scrollbars when image list is long. Also cannot adjust the number of columns based on screen size.
2) Same custom list view with, row layout having two imageviews. Issue here is user cannot click individual imageview.
I was not able to replace images to implement the third requirement.
How can I implement this. Are there any resources/controls I can use.
Thanks
Pa
I would probably use a gridview and an adapter for the gridview items. Just load a local image for loading to the imageview of the griditems and replace them with the images from the server

Best Approach for displaying web Services Data in android

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.

Irregular Gridview, first row with one colum, rest id the rows with two columns

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.

Dynamic table content display with AsyncTask

I'm developing for GoogleTV and I have created a dynamic table with 3 columns (using TableLayout), that shows the first 10 results fetched by HTTP from a Website.
As the user starts scrolling through the elements in the table (only rows are selectable, not columns), I want more results (rows) to be fetched and presented instantly (something like Google Reader).
To achieve that I'm using an AsyncTask that fetches more results from the Website, and adds them to the table. The problem is that I find it's behavior a little bit sluggish and unnatural, so I think that I may not be using the right approach.
Is there a better alternative to using TableLayout + AsyncTask? I have chosen TableLayout instead of ListView because I want to display the results in a "table-like" manner so it's easier to absorb the information.
Thanks for the replies.

Showing tabular data in Android

I need to show data from a web service with a limited amount of rows and with different number of columns (2-5 according to the ws call).
I don't know what kind of view is better to use: is it better to use a ListView with a dynamic layout using LayoutInflater or should i use a TableLayout as if it was a html page?
You can either go with Gridlayout that would be with more ease or go with TableLayout.
Using a TableLayout provide more structured and user specific look then ListView, you can make modification as per your need. like adding separators with rows, images ot arrows on the different TableRows. so best will be either Girdview or TableLayout.

Categories

Resources