0% found this document useful (0 votes)
64 views8 pages

Design by Ilias Ahmed Android Apps Devolper: @override

The document contains code for an Android application that manages a library. It includes Java code for a Home activity class that displays a toast message and starts a Login activity after a 2 second delay. It also includes XML layout files for the Home, Login, and student registration screens. The Login class contains a button click listener that starts a RegistrationForm activity when clicked.

Uploaded by

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

Design by Ilias Ahmed Android Apps Devolper: @override

The document contains code for an Android application that manages a library. It includes Java code for a Home activity class that displays a toast message and starts a Login activity after a 2 second delay. It also includes XML layout files for the Home, Login, and student registration screens. The Login class contains a button click listener that starts a RegistrationForm activity when clicked.

Uploaded by

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

Homepage.

com
Design by ilias ahmed android apps devolper

package com.example.androidapps.librarymanagement;

import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Toast;

public class Home extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);

new Handler().postDelayed(new Runnable() {


@Override
public void run() {
Toast.makeText(Home.this,"Hello",Toast.LENGTH_SHORT).show();
Intent intent = new Intent(Home.this,Login.class);
startActivity(intent);
}
},2000);
}
}
<?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:orientation="vertical"
android:background="#0b0b0b"
tools:context=".Login">

<TextView
android:id="@+id/Welcome"
android:text="Welcome to Library"
android:textSize="30dp"
android:textAlignment="center"
android:textStyle="bold"
android:fontFamily="serif"
android:textColor="#e4d658"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

<LinearLayout
android:id="@+id/layoutuid"
android:layout_below="@id/Welcome"
android:orientation="horizontal"
android:layout_marginTop="50dp"
android:layout_marginLeft="30dp"
android:layout_marginRight="50dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/Email"
android:hint="Email"
android:textColorHint="#ffffff"
android:textSize="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:id="@+id/layoutpass"
android:layout_below="@id/layoutuid"
android:orientation="horizontal"
android:layout_marginTop="10dp"
android:layout_marginLeft="30dp"
android:layout_marginRight="50dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<EditText
android:id="@+id/Password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Password"
android:textColorHint="#ffff"
android:textSize="20dp" />
</LinearLayout>

<Button
android:id="@+id/SignIn"
android:layout_width="133dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignStart="@+id/layoutuid"
android:layout_marginBottom="234dp"
android:fontFamily="serif"
android:text="Sign In"
android:textColor="#000000"
android:textSize="20dp"
android:textStyle="bold" />

<Button
android:id="@+id/SignUp"
android:layout_width="156dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="118dp"
android:fontFamily="serif"
android:text="Join Library"
android:textColor="#000000"
android:textSize="20dp"
android:textStyle="bold" />

<Button
android:id="@+id/ForgetPass"
android:layout_width="154dp"
android:layout_height="wrap_content"
android:layout_alignEnd="@+id/layoutuid"
android:layout_alignParentBottom="true"
android:layout_marginBottom="225dp"
android:fontFamily="serif"
android:text="Forget Password?"
android:textColor="#000000"
android:textSize="20dp"
android:textStyle="bold" />

</RelativeLayout>

<?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"
tools:context=".Home">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:src="@drawable/capture" />

</RelativeLayout>
Activity.xml
<?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:orientation="vertical"
android:background="#0b0b0b"
tools:context=".Login">

<TextView
android:id="@+id/Welcome"
android:text="Welcome to Library"
android:textSize="30dp"
android:textAlignment="center"
android:textStyle="bold"
android:fontFamily="serif"
android:textColor="#e4d658"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

<LinearLayout
android:id="@+id/layoutuid"
android:layout_below="@id/Welcome"
android:orientation="horizontal"
android:layout_marginTop="50dp"
android:layout_marginLeft="30dp"
android:layout_marginRight="50dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/Email"
android:hint="Email"
android:textColorHint="#ffffff"
android:textSize="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:id="@+id/layoutpass"
android:layout_below="@id/layoutuid"
android:orientation="horizontal"
android:layout_marginTop="10dp"
android:layout_marginLeft="30dp"
android:layout_marginRight="50dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<EditText
android:id="@+id/Password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Password"
android:textColorHint="#ffff"
android:textSize="20dp" />
</LinearLayout>

<Button
android:id="@+id/SignIn"
android:layout_width="133dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignStart="@+id/layoutuid"
android:layout_marginBottom="234dp"
android:fontFamily="serif"
android:text="Sign In"
android:textColor="#000000"
android:textSize="20dp"
android:textStyle="bold" />

<Button
android:id="@+id/SignUp"
android:layout_width="156dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="118dp"
android:fontFamily="serif"
android:text="Join Library"
android:textColor="#000000"
android:textSize="20dp"
android:textStyle="bold" />

<Button
android:id="@+id/ForgetPass"
android:layout_width="154dp"
android:layout_height="wrap_content"
android:layout_alignEnd="@+id/layoutuid"
android:layout_alignParentBottom="true"
android:layout_marginBottom="225dp"
android:fontFamily="serif"
android:text="Forget Password?"
android:textColor="#000000"
android:textSize="20dp"
android:textStyle="bold" />

</RelativeLayout>

Student.xml

========================\

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


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<EditText
android:textColor="#000"
android:textSize="20sp"
android:hint="ID"
android:id="@+id/ID"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<EditText
android:textColor="#000"
android:textSize="20sp"
android:hint="Email"
android:id="@+id/Email"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<EditText
android:textColor="#000"
android:textSize="20sp"
android:hint="Sec"
android:id="@+id/Sec"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<EditText
android:textColor="#000"
android:textSize="20sp"
android:hint="Name"
android:id="@+id/Name"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

</RelativeLayout>

Login.java

package com.example.androidapps.librarymanagement;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class Login extends AppCompatActivity {

Button SignUp;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);

SignUp=findViewById(R.id.SignUp);

SignUp.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent signupIntent = new Intent(Login.this, RegistrationForm.class);
startActivity(signupIntent);
}
});
}
}

manifest

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


<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.androidapps.librarymanagement">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".Login">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

</intent-filter>
</activity>
<activity android:name=".Home">

<intent-filter>

<category android:name="android.intent.category.LAUNCHER" />


</intent-filter>

</activity>
</application>

You might also like