android get date on listview like whatsApp does - android

I need to create a ListView with items that are continuously coming like in WhatsApp .
I want to display ListView with Date as SectionHeader.
I am using ListView from SQLite database using custom Adapter.
Now i need to display date of conversions like date in WhatsAPP
i found 1 link that look like some how usefull but i am not getting how to make it possible with date?
This is Link
Please help me to solve this problem

Use any stick header list view.
For reference you can use this one.
https://github.com/emilsjolander/StickyListHeaders.
and you can customize the section header view xml as your desire even like whatsapp containing date or any other way you want.
If it helps you, mark my ans. as up.

Yes you can do that using the same library what they used in that link you gave.Just try differentiating things with date where they did with alphabats.
Let me know if you need any assistance. Please mark this up if this helps.

Related

Is it possible in Android that each row from the query will create button?

We're making an app that can make surveys which is to be answered, of course.
But i'm not sure if it is possible that, for example, we will display all the list of inserted survey topics
and that in every topic, there'll be 1 button for each, generated individually ( sorry for the term. not really good in English. ) so that they can select it.
I'm also hoping to use it in the list of questions so that they can select from given answers using those buttons.
If it is possible, can you please give me some hints/starting lines how to make it?
Thanks in advance.
I think you need to overview ListView widget of Android first.
It helps to show lists you want.
And after you need to research Adapter you need. It is interface you must implement to use with ListView.

Autocomplete/Autofill Edit Text Android

I am looking to achieve the functionality of an AutocompleteTextView but slightly different. Instead of getting a drop-down list with suggestions i want it to complete the sentence for me.
For example: i type abc and i get completed, with the rest of the text in grey: abc1#etc.etc and then click a button to keep this text or keep writing to filter this even further.
Do you think is is achievable somehow?
I have looked my problem up so far but all the answers i found involved a drop-down list, perhaps i haven't looked deep enough.
Why don't you try to implement a custom view?
Basically, you need to the same things that the AutoCompleteTextView does but instead of displaying N elements into the drop down list you have to add the first option to your EditText.
Have a look at:
TextWatcher in order to see how detect the user input and progress
You can then play with indexes and spannables in order to keep track of the data input by the user and the data that you are suggesting.
One thing that I don't like about this idea is the fact that if you have got:
Germans
Germany
...
You need to type a lot of letters without the possibility to choose something different from the solution that you are providing.
use below example ... i think help you...
http://teamandroid4u.blogspot.in/2012/06/autocompletetextview-example.html

Adding Search Functionality To My Apps Android

I want to add search functionality into my apps, and also I did some research (http://developer.android.com/training/search/index.html) but I don't want to use database/sql. I want it to be something like this (http://www.androidhive.info/2012/09/android-adding-search-functionality-to-listview/) where you put all your search terms in a list of strings.
Question:
How do I implement the function where you click one of those search terms in listview, and the strings of the search term clicked will show up. Or is there any alternative way I can do this?
Comments are appreciated
Probably this might help you..see here
I think you should implement a new adapter rather than using ArrayAdapter. I don't know whether it is possible to do that using ArrayAdapter also.

How can implement search bar in android?

I am working in android. i am trying to display name of university using listView.
my list view is looking like this.
Now i want to add a search bar on the top of this list view. if i press A in search bar then this list view should display all the name of university start with A, if i press some other character then according university name must be displayed.
Please tell me how can implement this. Is any way to make search bar in android. I have seen in iPhone, it works very efficiently in iPhone. Please help me how can make this search bar ?
Thank you in advance...
This may be the long way. but this is just an idea..
I think you have to create a layout xml file with one EditText and ListView. Inside activity you have to listen for textChange in EditText and then probably you have to filter your ListAdapterbased on the text entered by the user and bind it with ListView.
See the complete example here : http://www.androidpeople.com/android-listview-searchbox-sort-items
You can use setTextFilterEnabled(true) on your list view.
I think this may help you to get an idea. http://developer.android.com/resources/tutorials/views/hello-autocomplete.html

How to achieve tags related functionality in android?

friends,
i want to perform functionality same like stackoverflow tags as we do normally creating a question separated by commas in android.
i know we have auto complete text view in android any one suggest me can i use it for multi selection?
or any useful way to achieve this?
any help would be appreciated.
it can be achieve through two ways
i devised my own machanism so may b you people have better approach than me please share too.
1) simple
2) advance
1) in simple we can use autocomplete text view and only use single tag with hard coded values which is limitation.
2) i have used a popup page with a Edittext and add button on top and listview with checkboxes below it.
fixed items i have already loaded into list view with checkboxes so that i could select multiple tags.
and in case of if i want to add my custom tag then i use that edit text above list view and store it in temporary data and
then finally using bundle i show selected values where i want seperated by commas.
thats it.

Categories

Resources