table alternative in android - android

I have an existing website for which I have to make an Android application. I have something a table with multiple columns(20) on the dashboard of website.
What will be an appropriate option to implement this? The screenshot of the table : https://drive.google.com/file/d/0B6SgMBRKkQ60WHB3bFc4Z2Y2cWM/view?usp=sharing
I had a look at TableLayout, but that might make the app look a little clumsy. Also, I learnt about horizontal ListView. Will that be a better option?

I think you should go with GridLayout.
http://androidexample.com/Grid_Layout_-_Android_Example/index.php?view=article_discription&aid=75&aaid=99
above is reference for GridLayout.
and this is official android blog spot link for GridLayout.
http://android-developers.blogspot.in/2011/11/new-layout-widgets-space-and-gridlayout.html

You can use a custom list view Or a GridView
Good examples to begin are below:
http://androidexample.com/How_To_Create_A_Custom_Listview_-_Android_Example/index.php?view=article_discription&aid=67&aaid=92
http://androidexample.com/Custom_Grid_Layout_-_Android_Example/index.php?view=article_discription&aid=76&aaid=100

Related

android table with more than one column like iOS collectionView

is there a custom UI element on android that will behave like iOS collection view?
[like a grid view, that is scrollable]
or do I have to make a custom table layout custom cells that behave like columns?
here a shot of a UICollectionView for iOS
is there an example for this?
thanks!
Since the previous answer does not reflect performance issues, such as it does not use recycling (which is important for long lists), here is what you are probably looking for:
GridView if your building blocks are all equal in size
http://developer.android.com/guide/topics/ui/layout/gridview.html
or ListView (and a lot of custom logic) if your building blocks have different sizes/widths
http://developer.android.com/guide/topics/ui/layout/listview.html
I don't know the collection view in iOS, but I guess TableLayout is what you are looking for.
https://developer.android.com/reference/android/widget/TableLayout.html
In API14+ there is GridLayout as well.
https://developer.android.com/reference/android/widget/GridLayout.html
Gridview is best replacement of Collection View of IOS. following URL will solve your problem.
http://developer.android.com/guide/topics/ui/layout/gridview.html
This is old, but the Google team have created a widget used in the IO 2014 app that's perfect. It allows for variable column rows and even headers out of the box.
https://github.com/google/iosched/blob/master/android/src/main/java/com/google/samples/apps/iosched/ui/widget/CollectionView.java
You'd have to dig through the source for how it's used, but it's really easy and great to use.
Nowadays RecyclerView is what you're looking for. GridView and others are considered legacy API now. RecyclerView is able to handle these type of layouts more efficiently.

Custom Android GridView

I want to create a GridView like this one:
But, I don't know how! I know how work with Android GridView, but not like this one.
Suggestions of library or any tip will be welcome.
Thanks.
I want to create a GridView like this one
The View you are referring to can quite easily be created without using a GridView. If your components (clothing, bags, shoes etc.) are static, you can use nested LinearLayouts (with weights) inside a ScrollView.
Suggestions of library or any tip will be welcome.
You can try StaggeredGridView: Link
A demo project to get you going: Link

Custom List View With Custom Headers Android

I have to make a custom list view with custom header, ( different text in each headers) and different number of items below each header. I have been going through various section indexing examples but I think they are not relevant much to my answer.
Anybody please suggest me a good means to move around such type of list view in android.
This might be a duplicate of Android Listview with sections
There are lots of different ones out there. One example is: http://w2davids.wordpress.com/android-sectioned-headers-in-listviews which uses: http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09
That one allows you to pass in different array adapters for each section so that you can have different layouts for each section's items.
If you were more clear about what the ones you have seen fail to do that you need it would be easier to offer you something you haven't seen.
There has been lot of thread exists on the Stackoverflow, check:
Android Listview with sections
Android ListView section header
How to draw a section header in Android listview just like the Contacts app did ?
But I am not sure these threads has helpful info, but if you want to read, understand and implement ListView with sections then here is one of the great and detailed article given by Cyril: ListView Tips & Tricks #2: Sectioning Your ListView
For a more complex design with sections in list, you should try this very standard library : https://github.com/emilsjolander/StickyListHeaders.
Other alternatives mentionned are great.
I should mention that the only drawback of this library is a poor mavenization and its absence on central.
Try this tutorial..its very nice and simple
http://www.androidhive.info/2013/07/android-expandable-list-view-tutorial/
There's a very good library for this. I've used in a project or 2 myself. Check it out:
https://code.google.com/p/android-amazing-listview/
Why can't you use expandable list view?
this link might help you: Android Exandable listview tutorial

How to create an info overlay in Android

I am looking for a way to create a short overlay intro of an app to display to first time users. These posts gave me some understanding of how it can be done, but not entirely:
How do I create a help overlay like you see in a few Android apps and ICS?
How to use LayoutInflater / ViewStub for an overlay
I do not understand how to access my elements correctly, since my root layout element is a LinearLayout that includes an Actionbar and a ViewPager instead of containing actual elements.
Are there any frameworks that does this for you?
I think that this library : ShowcaseView is your best option.
As its name implies, it allows you to recreate the Android 4.x showcase view; ie :
.
The documentation of the project explains how to implement it.
Word of advice though : this kind of explanation view is viewed as bad design most of the time : if your application is well designed, you don't need to provide a tutorial to the user, it is supposed to be intuitive.
It can be totally justified in some cases of course, just be sure that :
-your users really need a tutorial.
-it is not because you are doing something opposite to the Android convetions.
Have a look at MaterialShowcaseView. It inherits from ShowcaseView and is up-to-date.

How to realize the layout in android?

data1 hello hi
data2 hello2 hi
data3 hi Hello
I want to konw what should be use,TableLayout?linearLayout or RelativeLayout?Which view realize the layout will more better?I also want to use XML code realize this layout,ask you for help,thank you!
Do you need anything to move around ? Interact with any of the objects?
If you just want something that simple, you can use the TableLayout. If you only need to support ICS (Android 4.0) and later, you can also checkout GridLayout.
LinearLayout is probably not your best choice in terms of performance (will do a lot of calculations for not much). If you have a lot of elements in your table, RelativeLayout is not best either.
You can also check this answer about TableLayout from a Google employee.
IT all depends entrely upon the GUI you want to design, how you want to place your GUI obejcts. The Android official site has a very informative and helpful tutorial on this topic:
http://developer.android.com/guide/topics/ui/declaring-layout.html
http://developer.android.com/guide/topics/ui/declaring-layout.html#CommonLayouts

Categories

Resources