[HOW TO] Create a Simple Registration Form in Android

Andorid Develpoment:
Creating a Registration or Sign up Form in Android is easier and simple. Just creating the layout in Android and designing the form is easier. The simple Sign up form example is given below:
Click the New button at the top left side of the Eclipse which is below the File button. Then select the Android Activity and press Next

Select the template from the list. You can select the Blank Activity now and click next.

Now give the Layout Name and Title and press Finish. See the images below to select and create the New Activity process.

Now Go to  res/layout/signup.xml file and open it.
Then paste the code given below and you will get the Simple Sign up form for the Android.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

    xmlns:tools="http://schemas.android.com/tools"

    android:layout_width="match_parent"

    android:layout_height="match_parent"

    tools:context=".RegistrationFormActivity" >



    <LinearLayout

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:layout_alignParentBottom="true"

        android:layout_alignParentLeft="true"

        android:layout_alignParentRight="true"

        android:layout_alignParentTop="true"

        android:orientation="vertical" >



        <TextView

            android:id="@+id/textView1"

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:layout_gravity="center_horizontal"

            android:text="@string/RegistrationForm"

            android:textAppearance="?android:attr/textAppearanceLarge" />



        <TextView

            android:id="@+id/textView2"

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:text="@string/FirstName"

            android:textAppearance="?android:attr/textAppearanceMedium" />



        <EditText

            android:id="@+id/editText1"

            android:layout_width="match_parent"

            android:layout_height="wrap_content"

            android:ems="10"

            android:inputType="textPersonName" >



            <requestFocus />

        </EditText>



        <TextView

            android:id="@+id/textView3"

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:text="@string/LastName"

            android:textAppearance="?android:attr/textAppearanceMedium" />



        <EditText

            android:id="@+id/editText2"

            android:layout_width="match_parent"

            android:layout_height="wrap_content"

            android:ems="10"

            android:inputType="textPersonName" />



        <TextView

            android:id="@+id/textView4"

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:text="@string/Email"

            android:textAppearance="?android:attr/textAppearanceMedium" />



        <EditText

            android:id="@+id/editText3"

            android:layout_width="match_parent"

            android:layout_height="wrap_content"

            android:ems="10"

            android:inputType="textEmailAddress" />



        <TextView

            android:id="@+id/textView5"

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:text="@string/Password"

            android:textAppearance="?android:attr/textAppearanceMedium" />



        <EditText

            android:id="@+id/editText4"

            android:layout_width="match_parent"

            android:layout_height="wrap_content"

            android:ems="10"

            android:inputType="textPassword" />



        <CheckBox

            android:id="@+id/checkBox1"

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:selectAllOnFocus="false"

            android:text="@string/checkbox" />



        <Button

            android:id="@+id/button1"

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:layout_gravity="center_horizontal"

            android:onClick="startsignup"

            android:text="@string/SignUp" />

    </LinearLayout>

</RelativeLayout>

Moreover you may need to give the String Resources. Go to res/values/string.xml file and add the resources.
Now see the Graphical Layout of the Registration Form you have just created.
                                                     
                                                          Hope this Helps!
                                                             RefreshIt
[HOW TO] Create a Simple Registration Form in Android [HOW TO] Create a Simple Registration Form in Android Reviewed by RefreshIt on 4:43:00 PM Rating: 5

2 comments:

Powered by Blogger.