0% found this document useful (0 votes)
13 views7 pages

Practical No 7 Mad

The document contains XML code for two Android layouts: one for a login page and another for student information. The login layout includes fields for username and password, while the student info layout includes fields for student name, contact number, and address. Each layout features TextViews, EditTexts, and a Button for user interaction.

Uploaded by

prasad wadkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views7 pages

Practical No 7 Mad

The document contains XML code for two Android layouts: one for a login page and another for student information. The login layout includes fields for username and password, while the student info layout includes fields for student name, contact number, and address. Each layout features TextViews, EditTexts, and a Button for user interaction.

Uploaded by

prasad wadkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Practical No: 7

Xml code

<RelativeLayout

xmlns:android="http://schemas.android.com/apk/res/an
droid"
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/text2"
android:layout_marginLeft="130dp"
android:layout_marginTop="150dp"
android:layout_marginBottom="152dp"
android:text="Login Page"
android:textSize="30dp"></TextView>

<TextView
android:id="@+id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Username"
android:textSize="20sp"
android:layout_centerVertical="true"
android:layout_marginLeft="90dp" />

<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Enter Username"
android:layout_toRightOf="@id/text1"
android:layout_centerVertical="true"
android:id="@+id/text2"
android:textSize="20sp"
android:inputType="text"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/text3"
android:textSize="20dp"
android:text="Password"
android:layout_below="@id/text2"
android:layout_marginTop="10dp"
android:layout_marginLeft="90dp"/>

<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/text4"
android:textSize="20dp"
android:hint="Enter Password"
android:layout_below="@id/text2"
android:layout_toRightOf="@id/text3"

/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Login"
android:layout_below="@id/text4"
android:layout_centerHorizontal="true"/>

</RelativeLayout>
Output :
2)

Xml code :

<RelativeLayout
xmlns:android="http://schemas.android.com/apk/
res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/text2"
android:layout_marginLeft="130dp"
android:layout_marginTop="150dp"
android:layout_marginBottom="152dp"
android:text="Student Info"
android:textSize="30dp">
</TextView>

<TextView
android:id="@+id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Student Name :"
android:textSize="20sp"
android:layout_centerVertical="true"
android:layout_marginLeft="90dp" />

<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Enter Name"
android:layout_toRightOf="@id/text1"
android:layout_centerVertical="true"
android:id="@+id/text2"
android:textSize="20sp"
android:inputType="text"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/text3"
android:textSize="20dp"
android:text="Contact No :"
android:layout_below="@id/text2"
android:layout_marginTop="10dp"
android:layout_marginLeft="90dp"/>

<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/text4"
android:textSize="20dp"
android:hint="Enter Number"
android:inputType="number"
android:layout_marginLeft="20dp"
android:layout_below="@id/text2"
android:layout_toRightOf="@id/text3"

/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/text5"
android:textSize="20dp"
android:text="Address :"
android:layout_below="@id/text3"
android:layout_marginTop="20dp"
android:layout_marginLeft="90dp"/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/text6"
android:textSize="20dp"
android:hint="Enter Address"
android:inputType="textPostalAddress"
android:layout_marginLeft="20dp"
android:layout_below="@id/text4"
android:layout_toRightOf="@id/text3"

/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Save"
android:layout_below="@+id/text6"
android:layout_marginLeft="150dp"
android:layout_marginTop="20dp">
</Button>
</RelativeLayout>
Output :

You might also like