Create “First Android Application” , that will display “CU Android Lab” in the middle of the screen in the Blue color with White background
1. Aim/Overview
of the practical: Create “First Android Application” , that will display “CU Android
Lab” in the middle of the screen in the Blue color with White background
2. Task to be done:
Here
we have to create android project which
will show “CU ANDROID LAB” in text view.
2. Algorithm/Flowchart:
Step 1:Create a blank
project in android studio.
Step 2: Use constraint
Layout
Step 3: Under Constraint
Layout use text view to write.
Step 4: Use
activity_main.xml to change color ,size .
Step 5: Use Image View to
add Image .
Step 6: End.
4. Steps for experiment/practical:
1.XML code:
<?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"
android:background="#CAD5DA"
tools:context=".MainActivity">
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cu_android_lab"
android:textColor="@color/black"
android:textSize="48sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/imageView"
android:layout_width="182dp"
android:layout_height="235dp"
android:layout_marginStart="80dp"
android:layout_marginTop="35dp"
android:layout_marginEnd="80dp"
android:layout_marginBottom="65dp"
app:layout_constraintBottom_toTopOf="@+id/textView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/cu"
android:contentDescription="@string/todo"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
2.String.xml
<resources>
<string name="app_name">first</string>
<string name="cu_android_lab">CU ANDROID
LAB</string>
<string name="todo">TODO</string>
</resources>
3.Color.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_200">#FFBB86FC</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
</resources>
7. Result/Output/Writing Summary:
Comments
Post a Comment