Monday 12 November 2012

Drag & Drop elemenets in Text Field




In this chapter we are going to learn about the drag and drop elements in the Text Field.The Above figure shows the following elements.

The different types of Text Fields are the following given bellow.

PlainText
  • It is used for entering plain text.
  • The default code is given bellow.

    <EditText
        android:id="@+id/editText1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <requestFocus />
    </EditText>



Password(numeric)

  • It is used for entering numeric password.
  • The default code is given bellow.
     <EditText
        android:id="@+id/editText1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="numberPassword" >

        <requestFocus />
    </EditText>


Postal Address
  •  It is used for entering the postal address.
  • The default code is given bellow.
    <EditText
        android:id="@+id/editText1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="textPostalAddress" >

        <requestFocus />
    </EditText>


Date
  • It is used for entering date.
  • The default code is given bellow.

       <EditText
        android:id="@+id/editText1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="date" >

        <requestFocus />
    </EditText>



Number(Decimal
  • It is used for entering decimal numbers.
  • The default code is given bellow.
       <EditText
        android:id="@+id/editText1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="numberDecimal" >

        <requestFocus />
    </EditText>


Person Name

  • It is used for entering the person name.
  • The default code is given bellow.
       <EditText
        android:id="@+id/editText1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="textPersonName" >

        <requestFocus />
    </EditText>
  

E-mail
  • It is used for entering e-mail id.
  • The default code is given bellow.
     <EditText
        android:id="@+id/editText1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="textEmailAddress" >

        <requestFocus />
    </EditText>



Multi-line Text

  • It is used for entering multi-line text.
  • The default code is given bellow.
       <EditText
        android:id="@+id/editText1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="textMultiLine" >

        <requestFocus />
    </EditText>
   

Number

  • It is used to enter integer numbers.
  • The default code is given bellow.

       <EditText
        android:id="@+id/editText1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="number" >

        <requestFocus />
    </EditText>
 
AutoComplete Textview

  • It is used as a auto complete text view.
  • The default code is given bellow.


Password

  •   It is used for text password.
  •  The default code is given bellow.
       <EditText

        android:id="@+id/editText1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="textPassword" >

        <requestFocus />
    </EditText>


Phone
  • It is used for entering phone number.
  • The default code is given bellow.
    <EditText
        android:id="@+id/editText1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="phone" >

        <requestFocus />
    </EditText>



Time
  • It is used for entering the time.
  • The default code is given bellow.
      <EditText
        android:id="@+id/editText1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="time" >

        <requestFocus />
    </EditText>


Number(Signed)

  • It is used for entering signed numbers like +,-,*..etc.
  • The default code is given bellow.
      <EditText
        android:id="@+id/editText1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="numberSigned" >

        <requestFocus />
    </EditText>


MultiAuto Complete TextView

  • It is used as a muti purpose auto complete textview.
  • The default code is given bellow.


    <MultiAutoCompleteTextView
        android:id="@+id/multiAutoCompleteTextView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="MultiAutoCompleteTextView" >

        <requestFocus />
    </MultiAutoCompleteTextView>


4 comments:

Unknown said...

Good one to start learning about Android applications.

Unknown said...

Ya its really helpful for beginners

Anonymous said...

easy to understand

Anonymous said...

this much textfields !!!!!!!!!