Custom dictionary for EditText - android

Is it possible to create a custom dictionary for an edittext? In other words, can I create a custom list and have the edittext only suggest names from that list? I don't need it popping up useless word suggestions when the user is inputting specific names of people.

Please refer to this link.
https://developer.android.com/resources/samples/SearchableDictionary/index.html
They would have implemented content provider to provide a custom input to the quicksearch. You can try taking a similar approach where in you can make a query and update the result when a user enters each alphabet in your EditText box.

Use AutoCompleteTextView and provide your dictionary in the adapter.
http://developer.android.com/guide/topics/ui/controls/text.html

Related

AutoFill EditText Android

I'm trying to create a search bar like.
I have to use a particular autofill, infact I can't use a dropdowns menu.
For example if I write Noce the edittext will have to suggest Nocera in the same editText, like this.
but if the user write something else the pointer have to the end of the typed text (in this case Noce) and the hint have to disappear.
Is there some library that allows me this?
Thanks for the help.
There's this library that will fulfill some of your requirement called Auto Fill EditText
Finally I have solved this using two EditText in the same position. The first one is a normal editable EditText, the second one is not editable from the user but is used to show the hints programmatically.

Using MultiAutoCompleteTextview which stores ids

In my app, I want to use a MultiAutoCompleteTextview to get an effect like Facebook mentioning. After I type '#', I want to get a dropdown list from which to select a person. This will show the person's name in the MACTextView.
"Went to the cinema with John Doe"(What the user sees)-> "Went to the cinema with
[person:245]"(What I need to store)
How can I accomplish this? I know how to query my database and how to use the MultiAutoCompleteTextview. I just need help with differentiating between what's shown and what's stored.
I solved this by using Linkedin's spyglass library. This provides a mention edittext which is very customizable. It works by setting spans for the mentions. When saving, I used getSpan() and replaced the spans with my tags.

How to display word dictionary with custom keypad in android

I have successfully created a custom key pad in my application but i am unable to find out how to display a dictionary of words like android default keypad which appear at the top whenever we type.
1st you need to take an AutoComplete TextView
Afterwards , you need to follow this example:
Creating a Search Interface
In this example the ListView's Data-Source is being changed when the text is entered in Search Bar.You need to change the Data-Source of AutoComplete TextView as the user enters different texts.
I hope this will solve your problem.

What is the difference between text field types

I am new to android. I was stuck on a problem but I finally solved it.
I was using a TextField instead of CompleteTextViewField so whats the difference between these two and when should I use each one of them?
Thanks
Neither of those classes you mention (TextField, CompleteTextViewField) exist. Do you mean EditText and AutoCompleteTextView? I think the documentation explains it pretty well:
[AutoCompleteTextView is] An editable text view that shows completion suggestions automatically while the user is typing. The list of suggestions is displayed in a drop down menu from which the user can choose an item to replace the content of the edit box with.
That is, use it rather than a normal EditText if you have a set of common autocompletions for what gets entered in the box. The docs also link to a full sample that shows how to populate that list of suggestions with an Adapter.

What UI components are used to add a list to the bottom of an EditText?

I have an EditText and an ArrayList of Strings. When the user starts typing some characters into the EditText I want to show a list of what the user might be typing.
I can do the String comparison and the rest, but I am wondering what UI objects I should use for this?
You probably want an AutoCompleteTextView.
Hi you can use AutoCompleteTextView for this .Follow links below
AutocompleteTextview
Developer link for AutocompleteTextview

Categories

Resources