iPhone has UITableView, what does android have - java

I have an app on the iPhone that is completely table view driven. On android all I see is a static table, how can I create a table that I can populate with data that I requested from the network.

You could use either ListView or GridView. ListView has a method getView which you override to customize ListView item. This very much like (UITableViewCell *)tableView... in iphone, except that you needn't count the height of each cell. If you want to have something like tableView with sections you could use ExpandableListView. Here are links to Android ListView, Android Expandable ListView and Android GridView. There can also be found very useful examples in Android Dev web-site.

You can use GridView or ListView with custom View for row. In both cases you can supply a BaseAdaper (or a subclass of it) through which you can manipulate the data.

If you want the exact grid border like example here you go Android Grid Border... Obviously you can render data dynamically from whatever the source is...

Related

how to show mutiple image in grid like facebook and linked in

I need to show multiple image in grid like example given here.
and also need plus icon while images is more than some certain counts
There are multiple ways to implement it
Two horizontal/vertical LinearLayout
TableLayout with two rows
ConstraintLayout which its children are chained together
GridView
RecyclerView with GridLayoutManager
and more ... :D
Possibly you want to fetch the images dynamically, and there are several collection views: RecyclerView, ListView etc. RecyclerView is common since you can modify the layout(for your case, columns) with various LayoutManagers. Since you haven't provide any code, I cannot help you with that, but here is a guide that might be helpful.
For the plus icon mechanism, you can modify your RecyclerViewAdapter code, limiting the count(in getItemCount()) to a certain number and visible a transculent foreground with '+number' in the ViewHolder code for the last item.

Creating an expandable Recycler View

I have gone through other questions as well, but couldn't figure out something. I want to create a User list using the Expandable RecyclerView. The way I want it to be
My RecyclerView part is all done. Now my question is how can I achieve this expandable RecyclerView part programmatically. And if I can do this using any library which one would be best to use.
You can use this library to achieve expandable recyclerview.
https://github.com/thoughtbot/expandable-recycler-view

What kind of layout and java class should i use for a friend list layout?

I am learning android development and i am kinda stuck here. I want to create a friend list screen like shown in this picture.
What kind of activity should i use? Is there any available resources similar to what i want to achieve?
Thanks!
you can use ListActivity , also check out tutorials on lists, for example:
http://www.androidhive.info/2011/10/android-listview-tutorial/
http://www.vogella.com/tutorials/AndroidListView/article.html
you can find mire tutorials on google.
also you can use a regular Activity class with listView in the layout file
Use list view and custom adapter to populate the list view...
Listview should extend to the bottom but limit it just above the Type a name edit text and button.
Custom list view should contain linear layout horizontal in that include checkbox, Textview and Button
For type a name and Add use linear layout horizontal
Use listView with custom adapter , for array use arrayList<,friends,> sure you have to create friends class, in xml file put ListView then below that button and TextView

Android - Dynamically load content

I have a page in my app where the user can see a news feed (mostly images). How do I display these images (Using a LinearLayout maybe?)? And if so, how do I dynamically increase the size of this scrollable layout as I am scrolling down? (To load more images)
You have to use ListView. From the doc:
A view that shows items in a vertically scrolling list.
you have to provide a ListAdapter to your ListView. Basically the apdater is what fills up the ListView. It is higly customizable. You can simply pass to the adapter your data set or extend the adapter and customize the getView method in order to get the data rapresentation you want.
a tutorial can be found here
Yes you have to use listview, just add the content and notify the adapter.

How to display varying cell layouts with asynchronously updating text and images?

I am working on a remote controlling app for a home automation system. The mobile and the home automation device communicate via WebSockets.
To display the functions of the automation device, I am currently using ListViews and Adapters with a varying cell layout. One adapter is displaying all of the device's functions.
The biggest problem I encountered: Adapters keep calling getView() very often, which triggers my functions to register themselves with my state handle and action dispatcher over and over again.
Please note:
There are about 20 different types of functions, all of them requiring a different cell layout. There are sliders, buttons, state text, ...
The functions have asynchronously updating states.
I need to find a way to display those functions in a ListView or a ListView-like layout.
Can you please help me?
Make sure to implement BaseAdapter.getViewTypeCount() which should return the count for the number of different view types your listView is expected to have for its enteries.
And also implement ListAdapter.getItemViewType(int position) to return an int that identifies a specific view and which view type it will be.
Following the above two recommendations will ensure that your ListView will be efficient and it will guarantee that your getView(...) method is called with the appropriate view type, if there is one already infalted.
That said, if you have a few fixed number of view in your list and they are all different, then consider using LinearLayout in a ScrollView.

Categories

Resources