You are on page 1of 6

Software Applications for Mobile

Devices
Lab Journal 3

Name: Abdul Rauf


Enrollment No: 01-131182-003
Class: BSE-6A
Lab Instructor: Sir Waleed
Date Submitted: 30th April 2021

DEPARTMENT OF SOFTWARE ENGINEERING

BAHRIA UNIVERSITY
ISLAMABAD CAMPUS
Objective:

Learning about layouts in android applications

Tools Used:

 Snipping Tool
 Android Studio

Evaluation: Signature of Lab Engineer:


Tasks:

Layout.xml code
<LinearLayout 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"
android:paddingLeft="10dip" android:paddingRight="10dip"
android:paddingTop="5dip" android:paddingBottom="5dip"
android:orientation="vertical">

<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="User Name"
android:ems="10" >
<requestFocus />
</EditText>
<EditText
android:id="@+id/password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="Password"
android:inputType="textPassword" />

<Button
android:id="@+id/btnLogin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="Login" />

</LinearLayout>
Layout.xml code
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingRight="16dp"
android:paddingLeft="10dp"
>
<EditText
android:id="@+id/editText1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:hint="Name"
android:ems="10" />
<CheckBox
android:id="@+id/checkBox1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/editText1"

android:text="Male" />
<CheckBox
android:id="@+id/checkBox2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/checkBox1"
android:layout_alignBottom="@+id/checkBox1"
android:layout_centerHorizontal="true"
android:text="Female" />
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/editText1"
android:layout_alignTop="@+id/checkBox2"
android:text="Button" />
</RelativeLayout>

Conclusion:
The given tasks were completed successfully.

You might also like