Introduction

In this article, we are going to see how we can create a number of different Text controls in your Android application. We can configure, style, and manipulate the controls in a variety of ways; we have so many useful attributes we can use within the application to change the style, position, etc.

Learn from the basic text controls to your layout files, generally we have four types of Text Controls in Android:
  1. TextView
  2. EditText
  3. AutoCompleteTextView
  4. MultiCompleteTextView

TextView

TextView controls are usually included as part of your Activity's layout resource file. TextView has an interesting feature which is that it can automatically create a link based on the content of the Text; if the Text is an URL, an e-mail address or a phone number then when the user clicks on the textview the default intent launches whether it is the web browser or the dialer.
The property which we use for the linking is android:autoLink=""
Let's create the application to understand TextView

EditText

EditText is a subclass of the TextView class, it is functionally rich and customizable and enables users to edit text, it is like the TextBox.
Let's create the application to understand EditText
In the above code, you see we use three types of properties autoText, capitalize and password same as android provides many other properties like singleLine etc. But these three are the main which is used with EditText:
  1. autoText : It is used to make the EditText in such a manner that it is able to correct the common spelling mistakes. you will see the effect of autoText property in the below images with the capitalize property of EditText, the possible correct matching spelling will come according to the text which you entered.
  2. capitalize : This is used to specify the capitalization condition of the text. It further have three conditions:

    --characters : When you set capitalize property as characters, then all the characters or words which you enter will show in the upper case.
    characters property in android

    --words : When you set capitalize property as words, then the first character of each words will show in upper case and rest in lower case.
    words property in android

    --none : When you set capitalize property as none, then all the characters or words which you enter will show in lower case.
    none property in android

  3. password : password property is used to make a password type EditText or TextBox. Means the typed characters are displayed as bullets (on Windows) or asterisks.
    password property in android

AutoCompleteTextView

An autocompletetextview is an editable text view that shows completion suggestions automatically while the user is typing. We can show string items in autocompletetextview. So that items will display according to the characters we give.

MultiCompleteTextView

We can override the MultiAutoCompleteTextView and add the needed implementation of the default textview, it works the same way as the AutoCompleteTextView except you can add a Tokenizer that parses the text and allows you to suggest where to start suggesting words.

I will explain in deep about the last two categories of Text control, "AutoCompleteTextView and MultiCompleteTextView", in my next article.

Summary


Hope you like this article. Post your comments and feedback so that I can improve myself.
Thank You........