Android NOT autoComplete or spinner - android

I have related input text fields in my android application.
The user first enters a parent value (using autocomplete text)
for the related child text entry i have tried a spinner and autocomplete text.
the spinner shows existing values, which is a good start, however i need the user to be able to enter new values as well. Once the user adds a new value this will be incorporated in the drop down list on subsequent views of the screen.
the user may not know all available values so autocomplete doesnt satisfy my requirements as you have to know what is already in the list for it to assist you.
i feel spinner is the best starting point for my child text entry field.
How do i enable text entry into a spinner?
whats the "Best" solution for this problem?

Related

Integrating Google search to an Android EditText

Even a Snippet of an android code to Integrate Google Search into an Edit text will be really useful, according to my requirement i don't want the google search data or whatever but only the dropdown so that it will b easier for people to type and don't have to waste time :)
You can see about the componenent is AutoCompleteTextView
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.

Robotuim - selecting text fields by index solo.enterText

We are trying to write a test for an Native Android App and this has been driving me nuts.
solo.enterText(6, "100");
solo.enterText(7, "200");
solo.enterText(8, "300");
solo.enterText(9, "400");
all work fine, but once the index goes over 10 it fails to find any of the fields.
solo.enterText(10, "500");
solo.enterText(11, "600");
It also seems a little crazy to be counting the text fields and from within UIAutomator Viewer it does not seem to provide the true index number.
Is there a way to select the text field by resource id or the field name instead of the index number?
thanks for your help
Try this:
EditText editText
=(EditText)getActivity().findViewById(R.id.editText);
mSolo.enterText(editText,"500");
using R file and id resourse should be easier to test editText
My guess is that if you look at the screen you will only be able to see 10 edit text boxes and the edit texts with index 10+ are off the screen and inside a list view so they do not actually exist to robotium, you will need to scroll before you can input text but then the indexs will be off so you will have to compensate. The alternative is to find the edit texts by a different means like id or a tag or to find them as a child of the listview row that they are in.
If you can confirm it is because its in a list view i can find some code to help you.

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.

Android: Autocomplete for multiple input

For my app, I'm trying to get the autocomplete suggestion box to pop up for multiple inputs in the textbox.
For example, let's say the input is "Alice, Bob, Charlie". The user begins to type in "Alice" and selects the name from the suggestions, updating the text view with "Alice, ". Then the user types in "Bob" and the suggestion box pops up again, so the user clicks the name and the text view updates to "Alice, Bob, ". And so on.
The default AutoCompleteTextView in Android doesn't seem to support that kind of functionality of having the suggestions box pop up for each input, only for the first input. How do I go about having the suggestion box pop up for each input?
OK, I figured it out, had to use MultiAutoCompleteTextView instead of AutoCompleteTextView.

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.

Categories

Resources