0% found this document useful (0 votes)
11 views4 pages

Mad Practical1 77

Uploaded by

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

Mad Practical1 77

Uploaded by

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

ENROLLMENT NUMBER:IU2141230077 SUBJECT: MAD(CE0628) BATCH: 6CSE-B1

PRACTICAL-3
Aim : Make an Application which shows Constraint Layout, Linear Layout
(Horizontal/Vertical), Relative Layout.

File Name: Activity_main.xml

<?xml version="1.0" encoding="utf-8"?>


<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
tools:ignore="MissingConstraints">

<ImageView
android:id="@+id/imageView"
android:layout_width="148dp"
android:layout_height="249dp"
android:background="@color/black"
android:src="@drawable/img_3"
tools:layout_editor_absoluteX="4dp"
tools:layout_editor_absoluteY="2dp" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:ignore="MissingConstraints">

<TextView
android:id="@+id/textView4"
android:layout_width="match_parent"
android:layout_height="69dp"
android:layout_weight="1"
android:text=" Jenil Kadia"
android:textSize="28sp" />
ENROLLMENT NUMBER:IU2141230077 SUBJECT: MAD(CE0628) BATCH: 6CSE-B1

<TextView
android:id="@+id/textView5"
android:layout_width="match_parent"
android:layout_height="69dp"
android:layout_weight="1"
android:text=" IU2141230077"
android:textSize="28sp" />

<TextView
android:id="@+id/textView6"
android:layout_width="match_parent"
android:layout_height="93dp"
android:layout_weight="1"
android:text=" Indus University"
android:textSize="30sp" />
</LinearLayout>
</LinearLayout>

<RelativeLayout
android:layout_width="411dp"
android:layout_height="482dp"
android:layout_below="@id/linearLayout"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="249dp">

<TextView
android:id="@+id/textView8"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginTop="296dp"
android:layout_marginEnd="172dp"
android:layout_marginBottom="136dp"
android:text="CGPA : 7.9"
android:textSize="26sp" />

<TextView
android:id="@+id/textView2"
android:layout_width="182dp"
android:layout_height="126dp"
android:layout_below="@id/textView8"
android:layout_alignParentEnd="true"
ENROLLMENT NUMBER:IU2141230077 SUBJECT: MAD(CE0628) BATCH: 6CSE-B1

android:layout_marginTop="-80dp"
android:layout_marginEnd="128dp"
android:text="SEMESTER 6"
android:textSize="26sp" />
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

File Name: MainActivity.java

package com.example.myapplication;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
ENROLLMENT NUMBER:IU2141230077 SUBJECT: MAD(CE0628) BATCH: 6CSE-B1

OUTPUT:

Signature of faculty:____________ Date:__________

You might also like