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

Pra 10 EX

The document contains XML layout files for two Android applications, one for a social networking app and another for a student registration app. Both layouts feature a logo, input fields for username and password, a login button, and a 'Forgot Password?' text. The Java code for the MainActivity class is included for both applications, which sets the content view to the respective layout.

Uploaded by

sammedmohare465
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)
12 views4 pages

Pra 10 EX

The document contains XML layout files for two Android applications, one for a social networking app and another for a student registration app. Both layouts feature a logo, input fields for username and password, a login button, and a 'Forgot Password?' text. The Java code for the MainActivity class is included for both applications, which sets the content view to the respective layout.

Uploaded by

sammedmohare465
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

Pra:10

Ex:Q.1

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


<RelativeLayout 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="#495B8F"
android:padding="20dp"
tools:context=".MainActivity">

<TextView android:id="@+id/logo"
android:layout_width="match_parent"
android:layout_height="80dp"
android:text="F A C E B O O K"
android:gravity="center"
android:textSize="40sp"
android:textStyle="bold"
android:layout_marginTop="40dp"
android:textColor="@android:color/white"/>

<EditText
android:id="@+id/username"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_below="@id/logo"
android:layout_marginTop="30dp"
android:background="@android:color/white"
android:fontFamily="monospace"
android:hint="Email or phone number"
android:padding="10dp"
android:textSize="22sp" />

<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_below="@id/username"
android:background="@android:color/white"
android:fontFamily="monospace"
android:hint="Password"
android:padding="10dp"
android:layout_marginTop="20dp"
android:textSize="22sp" />

<Button android:id="@+id/btnLogin"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_below="@id/password"
android:layout_marginTop="30dp"
android:text="Log In"
android:background="#6D9ADD"
android:textColor="@android:color/white"
android:textSize="18sp"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="Forgot Password?"
android:textColor="@android:color/white"
android:layout_below="@id/btnLogin"
android:layout_marginTop="10dp"
android:textSize="16sp"/>

</RelativeLayout>

package com.example.socialnetworkingapp;
import android.support.v7.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);
}
}
Q.2

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


<RelativeLayout 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:padding="20dp"
tools:context=".MainActivity">

<TextView android:id="@+id/logo"
android:layout_width="match_parent"
android:layout_height="80dp"
android:text="R C P P"
android:gravity="center"
android:textSize="40sp"
android:textStyle="bold"
android:layout_marginTop="40dp"/>

<EditText
android:id="@+id/username"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_below="@id/logo"
android:layout_marginTop="30dp"
android:background="@android:color/white"
android:fontFamily="monospace"
android:hint="Enrollment number"
android:padding="10dp"
android:textSize="22sp" />

<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_below="@id/username"
android:background="@android:color/white"
android:fontFamily="monospace"
android:hint="Password"
android:padding="10dp"
android:layout_marginTop="20dp"
android:textSize="22sp" />
<Button android:id="@+id/btnLogin"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_below="@id/password"
android:layout_marginTop="30dp"
android:text="Log In"
android:background="#6D9ADD"
android:textColor="@android:color/white"
android:textSize="18sp"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="Forgot Password?"
android:layout_below="@id/btnLogin"
android:layout_marginTop="10dp"
android:textSize="16sp"/>

</RelativeLayout>

package com.example.studentregistrationapp;
import android.support.v7.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);
}
}

You might also like