FINAL
FINAL
1
Student Name: Manohar Chaudhary UID: 21BCS4422
Branch: B.E./CSE Section/Group: 21BCS-FL-603-B
Semester: 6th Date of performance: 26/03/24
Subject Name: MAD LAB Subject Code: 21CSH-355
3. Apparatus/Requirements:
Computer with Android Studio installed and configured, Internet Connection,
Android device for simulation.
4. Script:
MainActivity.java:
package com.example.fragments;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
activity_main.xml:
<androidx.fragment.app.FragmentContainerView
android:id="@+id/fragment1"
android:name="com.example.fragments.Fragment1"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_columnWeight="1"
android:layout_rowWeight="1" />
<androidx.fragment.app.FragmentContainerView
android:id="@+id/fragment2"
android:name="com.example.fragments.Fragment2"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_columnWeight="1"
android:layout_rowWeight="1" />
<androidx.fragment.app.FragmentContainerView
android:id="@+id/fragment3"
android:name="com.example.fragments.Fragment3"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_columnWeight="1"
android:layout_rowWeight="1" />
<androidx.fragment.app.FragmentContainerView
android:id="@+id/fragment4"
android:name="com.example.fragments.Fragment4"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_columnWeight="1"
android:layout_rowWeight="1" />
</GridLayout>
Fragment
Fragment.java:
package com.example.fragments;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
activity_main.xml:
<FrameLayout 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:background="#00FA9A"
tools:context="com.example.fragments.Fragment2">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="My name is Murli \n 21BCS5810" />
</FrameLayout>
5. Observation:
My name is Murli
Hello Everyone 21BCS5810
6. Learning Outcomes: