0% found this document useful (0 votes)
6 views2 pages

Practical 2 Code With Output

The document contains XML and Java code for an Android application layout and main activity. It defines a simple user interface with a TextView displaying a welcome message and sets up the main activity to handle window insets. The layout uses ConstraintLayout for positioning elements on the screen.

Uploaded by

kondvilkarvedant
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)
6 views2 pages

Practical 2 Code With Output

The document contains XML and Java code for an Android application layout and main activity. It defines a simple user interface with a TextView displaying a welcome message and sets up the main activity to handle window insets. The layout uses ConstraintLayout for positioning elements on the screen.

Uploaded by

kondvilkarvedant
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

ACTIVITY_MAIN.

XML

<?xml version="1.0" encoding="u -8"?> [Link]


<[Link]
package [Link]firstprac cal;
xmlns:android="h p://[Link]/apk/res/
import [Link];
android"
xmlns:tools="h p://[Link]/tools"
import [Link] [Link];
xmlns:app="h p://[Link]/apk/res-
import [Link] vity;
auto"
import [Link];
android:id="@+id/main"
import [Link];
android:layout_width="match_parent"
import [Link];
android:layout_height="match_parent"
tools:context=".MainAc vity">
public class MainAc vity extends AppCompatAc vity {
<TextView
android:layout_width="wrap_content"
@Override
android:layout_height="wrap_content"
protected void onCreate(Bundle
android:text="Welcome in Mobile Applica on
savedInstanceState) {
Development World"
[Link](savedInstanceState);
[Link](this);
app:layout_constraintBo om_toBo omOf="parent"
setContentView([Link] vity_main);
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
[Link](findVie
app:layout_constraintTop_toTopOf="parent" />
wById([Link]), (v, insets) -> {
Insets systemBars =
[Link]([Link]
</[Link]>
s());
[Link]([Link] , [Link],
[Link], [Link] om);
return insets;
});
}
}

You might also like