Blood Finder Application Project Report.

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 95

AN

INTERNSHIP REPORT
ON
BLOOD FINDER APPLICATION SYSTEM
PROJECT
BY
KAMAL ACHARYA
(Tribhuvan University)
Date: 2022/05/25

1|Page
ABSTRACT

Blood Finder is an emergency time app where a user can search for the blood banks as

well as the registered blood donors around Mumbai. This application also provide an

opportunity for the user of this application to become a registered donor for this user have

to enroll for the donor request from the application itself. If the admin wish to make user

a registered donor, with some of the formalities with the organization it can be done.

Specialization of this application is that the user will not have to register on sign-in for

searching the blood banks and blood donors it can be just done by installing the

application to the mobile.

The purpose of making this application is to save the user’s time for searching blood of

needed blood group during the time of the emergency.

This is an android application developed in Java and XML with the connectivity of

SQLite database. This application will provide most of basic functionality required for an

emergency time application. All the details of Blood banks and Blood donors are stored

in the database i.e. SQLite.

This application allowed the user to get all the information regarding blood banks and

blood donors such as Name, Number, Address, Blood Group, rather than searching it on

the different websites and wasting the precious time. This application is effective and

user friendly.

2|Page
OBJECTIVE

 Blood is one of the main need for the human body to live on the earth

 BLOOD FINDER is the application to find the blood at the time of need by the

user

 The main objective of the project is to design and develop a user-friendly

emergency application.

 Easy to use and efficient application

 To develop a platform to search for blood without wasting the users precious time

 The user can search for the particular blood group in the application using the

search operation

 To save the user’s time there is no login or signup is required, User can directly

install the application and search for the desired need

 A user can also request to enroll for a blood donor to the admin of the application

 The search option is provided according to the blood group in the application

itself, The user does not have to enter any thing in the application manually

 Hospitals can also use this application to search the blood for the patient

 The databases for the blood banks and blood groups are been separated due to the

security purpose

3|Page
INTRODUCTION

This project acts as an important role in saving life of human beings and which is

also its main aim. The project Android Blood finder application is developed so

that users can view the information about registered blood donors such as name,

address, and contact along with their details of blood group.

The project also has a enroll page where in, the user can Enroll i.e. request the

admin to being a donor. Thus, this application helps to select the right donor

instantly using the blood group.

The main aim of developing this application is to reduce the time to a great extent

that is spent in searching for the right donor and the availability of blood required.

Thus, this application provides the required information in no time and also helps

in quicker decision making.

Advantages :-

 This system can be used to view all the donor details and accordingly select

the right donor.

 This system can also be used to view nearby blood banks in very quick time

 The android mobile user will be able to make quick decision in selecting a

donor.

4|Page
 Usage of this application will greatly reduce time in selecting the right

donor.

 This application can be used by any common people.

 The application can prove very beneficial into the clinics, hospitals as the

requirement is very high in such places.

Disadvantages :-

 The android mobile user will not be able to insert or view details if the

server goes down. Thus, there is disadvantage of single point failure.

 This app cannot be run on any other Platform rather than Android i.e.

(Apple, Blackberry)

 This application only provides blood bank information of the Mumbai

Suburban’s

 The application cannot be run on the API less than 15 i.e. (Jellybean)

5|Page
REQUIREMENT SPECIFICATION

A Software Requirement Specification (SRS) is a description of a software system to be

developed. It lays out functional and non-functional requirements, and may include a set

of use cases that describe the user interactions that the software must provide.

SOFTWARE REQUIREMNTS :-

Front End :- ANDROID STUDIO (JAVA & XML)

Back End :- SQLite Database

Development Tool :- Android Development Toolkit (ADT)

HARDWARE REQUIREMENTS :-

Processor :- Intel i5/AMD

Hard Disk :- 5 GB

RAM :- 8 GB

ANDROID DEVICE

FUNCTIONAL REQUIREMENT :-

ADMIN :-

Login : The Admin can Login by providing Username & Password.

Management : The Admin Manages this 3 Information’s

6|Page
1. Blood Banks in Mumbai :-

Admin can ADD, UPDATE, DELETE the Blood Bank’s Database as required.

2. Blood Donor’s :-

Admin can ADD, UPDATE, DELETE the Blood Donor’s Database as required.

3. Enroll Request’s for Donor’s :-

Admin can check for the Request of User’s to be a Donor & add them in the

Donor’s list.

Logout : The Admin can Logout using this Option & redirect to the Main Page of the

Application

USER :-

Search Blood Banks in Mumbai : The User can Search the Blood banks in Mumbai

& contact them or go there for the Requirement of the Blood to the User.

Search Donor’s: The User can Search for the Blood Donor’s nearest to it as of its

Requirements of Blood Group & contact the person for the blood donation.

Enroll to be a Donor : The User can enroll the request for being the donor to the

Admin.

7|Page
NON-FUNCTIONAL REQUIREMENT:-

Performance Requirements :

Performance is measured in terms of the output provided by the application. Requirement

specification plays an important part in the analysis of the system, which will fit into

required environment. It rests largely with the users of the system to give the requirement

specifications because they are the people who finally use the system. This is because the

requirements have to be known during the initial stage so that the system can be designed

according to those requirements. It is Very difficult to change the system once it has been

designed and on the other hand designing a system, which does not cater to the

requirements of the user, is of no use. The requirement Specification for any system can

be broadly stated as given below :

 The system should be interface with the user

 The system should be accurate

Reliability

 In this system reliability means the

Security

 The Database should be protected from hacking, virus etc.

Availability

 This application will be available always

8|Page
FEASIBLITY STUDY

Feasibility study includes consideration of all the possible way to provide solution to the

given problem. The proposed solution should satisfy all the user requirements and should

be flexible enough so that future changes can be easily done based on the future

requirements.

OPERATIONAL FEASIBILTY

Operation of the proposed system depend on the user. These various user type are

mentioned below :

1. Admin

2. User

Admin :-

 Admin can manage the Enrollment of the user.

 If the user preform an unusual or illegal kind of task then the admin may wish to

delete the account of that particular user.

 Admin can provide necessary information related to the application such as new

updates.

 Admin can add new Blood Banks in the Application while Updating the data

9|Page
User :-

 User can Search for the Blood donor’s & blood banks on basis of its requirements

 User can Updates related to the application is provided by the admin to the user.

 User can Enroll the Request form to the Admin for being a Donor

TECHNICAL FEASIBLITY

 The blood finder application is created by using certain programming languages

like JAVA & XML, and SQLite as a database.

 JAVA is used for front-end and XML for data transfer.

 This system avoids manual work such as maintaining a hard copy of Blood

Donor’s list.

 This application keeps the data in a centralized way which is available to all the

user

ECONOMICAL FEASIBLITY

 As no papers required so it reduce cost.

 It would be beneficial because only one time development efforts required.

All people are aware of technologies so no special skills required to run the
system

10 | P a g e
SYSTEM DESIGN

E-R DIAGRAM :-

11 | P a g e
CLASS DIAGRAM :-

Admin
+admin_username:String
+admin_password :String
+AddDonor()
+EditDonor()
+DeleteDonor()
+AddBloodBank()
+EditBloodBank()
+DeleteBloodBank()
+EnrollUser()

Blood Bank User Blood Donor

+bnk_id : Int +user_id : Int +bld_dnr_id :Int

+bnk_name : String +user_name : String +bld_dnr_name : String

+bnk_address : String +user_address : String +bld_dnr_address : String

+bnk_contact : Int +user_contact : String +bld_dnr_contact : Int

+show_bnk_data() +user_blood_group : String +bld_dnr_blood_group : String


+show_blood_bank() +show_bld_dnr_data()
+show_blood_donor()
+enroll_as_donor()

12 | P a g e
USE CASE DIAGRAM :-

ADMIN

Search Blood Donor

Search Blood Bank

Enroll User
request for donor

13 | P a g e
USER

Enroll the user

Add Blood Bank

Delete Blood Bank

Edit Blood Bank

Delete Blood Donor


Add Blood Donor

Edit Blood Donor

14 | P a g e
SYSTEM FLOW CHART
Start

No
Is Admin Is User

No
Yes

Login

Yes
Admin Is Valid

Manage Search
Blood Bank Donor’s

Manage Search
Blood Donor Blood Banks

Manage User Enroll to be a


Enroll Request Donor

Logout

Exit

15 | P a g e
DATA FLOW DIAGRAM

ADMIN :-

Admin

Login to
System

Manage
Modules

Manage Blood Manage Blood Manage Users


Banks Details Donors Details Enroll Request

16 | P a g e
USER :-

Search
User
Modules

Enroll to be
a Donor

Search Blood Search Blood

Banks Details Donors Details

17 | P a g e
CODE :-
AndroidMainifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mustafa.found">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="BLOOD FINDER"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

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


</intent-filter>
</activity>
<activity android:name=".user_p" />
<activity android:name=".admin_p" />
<activity android:name=".admin_log" />
<activity android:name=".add_bank" />
<activity android:name=".edit_bank" />
<activity android:name=".del_bank" />
<activity android:name=".admin_sel" />
<activity android:name=".add_dnr" />
<activity android:name=".del_dnr" />
<activity android:name=".edit_dnr" />
<activity android:name=".admin_dnr_p"></activity>
</application>
</manifest>

MainActivity.java

package com.example.mustafa.found;
import android.content.DialogInterface;
import android.content.Intent;
import android.support.v7.app.AlertDialog;

18 | P a g e
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
ImageButton i,i1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
i=(ImageButton)findViewById(R.id.i_admin);
i1=(ImageButton)findViewById(R.id.i_user);
i.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(getApplicationContext(),"Please provide your
Authentication",Toast.LENGTH_SHORT).show();
startActivity(new Intent(MainActivity.this,admin_log.class));
}
});
i1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(getApplicationContext(),"Welcome
User",Toast.LENGTH_SHORT).show();
startActivity(new Intent(MainActivity.this,user_p.class));
}
});
}
@Override
public void onBackPressed() {
new AlertDialog.Builder(this)
.setMessage("Are you sure you want to exit?")
.setCancelable(false)
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
MainActivity.this.finish();
}
})

19 | P a g e
.setNegativeButton("No", null)
.show();
}
}

user_p.java

package com.example.mustafa.found;
import android.content.Intent;
import android.database.Cursor;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
public class user_p extends AppCompatActivity {
Button b1,b2;
MyHelper mh;
MyHelperdnr mhdnr;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_user_p);
mh=new MyHelper(this);
mhdnr=new MyHelperdnr(this);
b1=(Button)findViewById(R.id.b_bnk);
b2=(Button)findViewById(R.id.b_dnr);
viewAllData();
viewAllDatadnr();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater m=getMenuInflater();
m.inflate(R.menu.usermenu,menu);
return super.onCreateOptionsMenu(menu);

20 | P a g e
}
@Override
public boolean onOptionsItemSelected(MenuItem item)
{
switch (item.getItemId())
{
case R.id.it_enrl:
startActivity(new Intent(user_p.this,Enroll_donor.class));
Toast.makeText(getApplicationContext(),"Enroll Yourself as
Donor",Toast.LENGTH_SHORT).show();
break;
case R.id.it_about:
startActivity(new Intent(user_p.this,aboutus.class));
Toast.makeText(getApplicationContext(),"About
Us",Toast.LENGTH_SHORT).show();
break;
}
return super.onOptionsItemSelected(item);
}
public void viewAllData()
{
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Cursor res = mh.getAllData();
if(res.getCount() == 0)
{
showMessage("Error","Nothing Found");
return;
}
StringBuffer buffer = new StringBuffer();
while(res.moveToNext())
{
buffer.append("Name : " + res.getString(1) + "\n");
buffer.append("Address : " + res.getString(2) + "\n");
buffer.append("Mobile Number: " + res.getString(3) + "\n");
}
showMessage("Blood Bank Data", buffer.toString());
}
});

21 | P a g e
}

public void viewAllDatadnr()


{
b2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(getApplicationContext(),"Blood donors
List",Toast.LENGTH_SHORT).show();
startActivity(new Intent(user_p.this,search.class));
}
});
}
public void showMessage(String title , String message)
{
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setCancelable(true);
builder.setTitle(title);
builder.setMessage(message);
builder.show();
}
}

admin_log.java

package com.example.mustafa.found;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class admin_log extends AppCompatActivity {
EditText t1,t2;
Button b;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_admin_log);

22 | P a g e
t1=(EditText)findViewById(R.id.txt_username);
t2=(EditText)findViewById(R.id.txt_pass);
b=(Button)findViewById(R.id.btn_log);
b.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String unm,pass;
unm=t1.getText().toString();
pass=t2.getText().toString();
if(unm.isEmpty())
{
t1.setError("Enter Username");
return;
}
if(pass.isEmpty())
{
t2.setError("Enter Password");
return;
}
if(unm.isEmpty())
{
t1.setError("Enter Username");
}
if(pass.isEmpty())
{
t2.setError("Enter Password");
}
if(unm.equals("admin") && pass.equals("admin"))
{
Toast.makeText(getApplicationContext(),"Welcome
Admin",Toast.LENGTH_SHORT).show();
startActivity(new Intent(admin_log.this,admin_sel.class));
}
else
{
Toast.makeText(getApplicationContext(),"Please Enter Correct
Credentials",Toast.LENGTH_SHORT).show();
}
} });
}}

23 | P a g e
admin_sel.java

package com.example.mustafa.found;
import android.content.DialogInterface;
import android.content.Intent;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
public class admin_sel extends AppCompatActivity {
Button bt1,bt2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_admin_sel);
bt1=(Button)findViewById(R.id.b_bank_admin);
bt2=(Button)findViewById(R.id.b_dnr_admin);
bt1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(getApplicationContext(),"Blood Bank
details",Toast.LENGTH_SHORT).show();
startActivity(new Intent(admin_sel.this,admin_p.class));
}
});
bt2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(getApplicationContext(),"Blood Donor
details",Toast.LENGTH_SHORT).show();
startActivity(new Intent(admin_sel.this,admin_dnr_p.class));
}
});

24 | P a g e
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater m=getMenuInflater();
m.inflate(R.menu.adminlogout,menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item)
{
switch (item.getItemId())
{
case R.id.logout:
new AlertDialog.Builder(this)
.setMessage("Do you want to Exit")
.setCancelable(false)
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
startActivity(new Intent(admin_sel.this,MainActivity.class));
}
})
.setNegativeButton("No",null)
.show();
break;
}
return super.onOptionsItemSelected(item);
}
}

admin_p.java

package com.example.mustafa.found;
import android.content.Intent;
import android.database.Cursor;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;

25 | P a g e
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageButton;
import android.widget.Toast;
public class admin_p extends AppCompatActivity {
ImageButton btnadd,btnedit,btndel,btnshw;
MyHelper mh;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_admin_p);
btnadd=(ImageButton)findViewById(R.id.b_add);
btnedit=(ImageButton)findViewById(R.id.b_edit);
btndel=(ImageButton)findViewById(R.id.b_del);
btnshw=(ImageButton)findViewById(R.id.b_shhw);
mh=new MyHelper(this);
viewAll();
btnadd.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(admin_p.this,add_bank.class));
Toast.makeText(getApplicationContext(),"Add bank
details",Toast.LENGTH_SHORT).show();
}
});
btnedit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(admin_p.this,edit_bank.class));
Toast.makeText(getApplicationContext(),"Edit Bank
Details",Toast.LENGTH_SHORT).show();
}
});
btndel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(admin_p.this,del_bank.class));
Toast.makeText(getApplicationContext(),"Delete Bank
Details",Toast.LENGTH_SHORT).show();

26 | P a g e
}
});
}
public void viewAll()
{
btnshw.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Cursor res = mh.getAllData();
if(res.getCount() == 0)
{
// show msg
showMessage("Error","Nothing Found");
return;
}
StringBuffer buffer = new StringBuffer();
while(res.moveToNext())
{
buffer.append("Id : " + res.getString(0) + "\n");
buffer.append("Name : " + res.getString(1) + "\n");
buffer.append("Address : " + res.getString(2) + "\n");
buffer.append("Mobile Number : " + res.getString(3) + "\n");
}
showMessage("Blood Bank Data", buffer.toString());
}
});

}
public void showMessage(String title , String message)
{
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setCancelable(true);
builder.setTitle(title);
builder.setMessage(message);
builder.show();
}
}

27 | P a g e
add_bank.java

package com.example.mustafa.found;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class add_bank extends AppCompatActivity {
MyHelper mh;
EditText bnm,badd,bmob;
Button btnadd;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_bank);
mh=new MyHelper(this);
bnm=(EditText)findViewById(R.id.txt_name);
badd=(EditText)findViewById(R.id.txt_address);
bmob=(EditText)findViewById(R.id.txt_mob);
btnadd=(Button)findViewById(R.id.add_btn);
addData();
}
public void addData()
{
btnadd.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View view) {
String s1,s2,s3;
s1=bnm.getText().toString();
s2=badd.getText().toString();
s3=bmob.getText().toString();
if(s1.isEmpty())
{
bnm.setError("Enter Name");
return;
}

28 | P a g e
if(s2.isEmpty())
{
badd.setError("Enter Address");
return;
}
if(s3.isEmpty())
{
bmob.setError("Enter Mobile Number");
return;
}
if(bmob.length()<10)
{
if(bmob.length()>8 || bmob.length()<8)
{
bmob.setError("Enter 8 digit Phone Number");
return;
}
}
if(bmob.length()>8)
{
if(bmob.length()<10 || bmob.length()>10)
{
bmob.setError("Enter 10 digit Mobile Number");
return;
}
}
boolean isInserted = mh.insertData(bnm.getText().toString() ,
badd.getText().toString(),
bmob.getText().toString());
if(isInserted == true)
Toast.makeText(add_bank.this,"Bank Data Inserted
Successfully",Toast.LENGTH_SHORT).show();
else
Toast.makeText(add_bank.this, "Bank Data not Inserted Succesfully"
,Toast.LENGTH_SHORT).show();
}
});
}
}

29 | P a g e
edit_bank.java

package com.example.mustafa.found;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class edit_bank extends AppCompatActivity {
MyHelper mh;
EditText et1,et2,et3,et4;
Button btnedit;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_edit_bank);
mh=new MyHelper(this);
et1=(EditText)findViewById(R.id.id_edit);
et2=(EditText)findViewById(R.id.nm_edit);
et3=(EditText)findViewById(R.id.add_edit);
et4=(EditText)findViewById(R.id.mob_edit);
btnedit=(Button)findViewById(R.id.edit_btn);
updateData();
}
public void updateData()
{
btnedit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view)
{
String r1,r2,r3,r4;
r1=et1.getText().toString();
r2=et2.getText().toString();
r3=et3.getText().toString();
r4=et4.getText().toString();
if(r1.isEmpty())
{
et1.setError("Enter ID");

30 | P a g e
return;
}
if(r2.isEmpty())
{
et2.setError("Enter Name");
}
if(r3.isEmpty())
{
et3.setError("Enter Address");
return;
}
if(r4.isEmpty())
{
et4.setError("Enter Mobile Number");
return;
}
boolean isUpdate =
mh.updateData(et1.getText().toString(),et2.getText().toString(),et3.getText().toString(),et4.getT
ext().toString());
if(isUpdate== true)
Toast.makeText(edit_bank.this,"Blood Bank Data Updated
Successfully",Toast.LENGTH_SHORT).show();

else
Toast.makeText(edit_bank.this, "Blood Bank Data Not Updated Successfully"
,Toast.LENGTH_SHORT).show();
}
});
}
}

del_bank.java

package com.example.mustafa.found;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

31 | P a g e
import android.widget.EditText;
import android.widget.Toast;
public class del_bank extends AppCompatActivity {
EditText delt;
Button bdl;
MyHelper mh;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_del_bank);
delt=(EditText)findViewById(R.id.txt_id);
bdl=(Button)findViewById(R.id.del_btn);
mh=new MyHelper(this);
delData();
}
public void delData()
{
bdl.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String d1=delt.getText().toString();
if(d1.isEmpty())
{
delt.setError("Enter ID");
return;
}
boolean isdelete=mh.delData(delt.getText().toString());
if(isdelete==true)
Toast.makeText(getApplicationContext(),"Blood Bank Data Deleted
Successfully",Toast.LENGTH_SHORT).show();
else
Toast.makeText(getApplicationContext(),"Blood Bank Data Not Deleted
Successfully",Toast.LENGTH_SHORT).show();
}
});
}
}

32 | P a g e
admin_dnr_p.java

package com.example.mustafa.found;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageButton;
import android.widget.Toast;
public class admin_dnr_p extends AppCompatActivity {
ImageButton dnradd,dnredit,dnrdel,dnrshw;
MyHelperdnr mhdnr;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_admin_dnr_p);
dnradd=(ImageButton)findViewById(R.id.d_add);
dnredit=(ImageButton)findViewById(R.id.d_edit);
dnrdel=(ImageButton)findViewById(R.id.d_del);
dnrshw=(ImageButton)findViewById(R.id.d_shhw);
mhdnr=new MyHelperdnr(this);
viewAlldnr();
dnradd.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(admin_dnr_p.this,add_dnr.class));
}
});
dnredit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(admin_dnr_p.this,edit_dnr.class));
}
});

33 | P a g e
dnrdel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(admin_dnr_p.this,del_dnr.class));
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater m=getMenuInflater();
m.inflate(R.menu.adminmenu,menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item)
{
switch (item.getItemId())
{
case R.id.ad_it_nw_req:
startActivity(new Intent(admin_dnr_p.this,new_donor_request.class));
Toast.makeText(getApplicationContext(),"Enroll Donor's
Request",Toast.LENGTH_SHORT).show();
break;

}
return super.onOptionsItemSelected(item);
}
public void viewAlldnr()
{
dnrshw.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Cursor res = mhdnr.getAllDatadnr();
if(res.getCount() == 0)
{
// show msg
showMessage("Error","Nothing Found");
return;
}

34 | P a g e
StringBuffer buffer = new StringBuffer();
while(res.moveToNext())
{
buffer.append("Id : " + res.getString(0) + "\n");
buffer.append("Name : " + res.getString(1) + "\n");
buffer.append("Address : " + res.getString(2) + "\n");
buffer.append("Mobile Number : " + res.getString(3) + "\n");
buffer.append("Blood Group : "+res.getString(4)+ "\n");
}
showMessage("Blood Donor Data", buffer.toString());
}
});

}
public void showMessage(String title , String message)
{
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setCancelable(true);
builder.setTitle(title);
builder.setMessage(message);
builder.show();
}
}

add_dnr.java

package com.example.mustafa.found;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class add_dnr extends AppCompatActivity {


EditText dd1,dd2,dd3,dd4;
Button dbnadd;

35 | P a g e
MyHelperdnr mhdnr;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_dnr);
dd1=(EditText)findViewById(R.id.txt_nm_dnr);
dd2=(EditText)findViewById(R.id.txt_add_dnr);
dd3=(EditText)findViewById(R.id.txt_mob_dnr);
dd4=(EditText)findViewById(R.id.txt_bld_dnr);
dbnadd=(Button)findViewById(R.id.btn_add_dnr);
mhdnr=new MyHelperdnr(this);
addDatadnr();
}

public void addDatadnr()


{
dbnadd.setOnClickListener(new View.OnClickListener()
{

@Override
public void onClick(View view) {
String a1,a2,a3,a4;
a1=dd1.getText().toString();
a2=dd2.getText().toString();
a3=dd3.getText().toString();
a4=dd4.getText().toString();
if(a1.isEmpty())
{
dd1.setError("Enter Name");
return;
}
if(a2.isEmpty())
{
dd2.setError("Enter Address");
return;
}
if(a3.isEmpty())
{
dd3.setError("Enter Mobile Number");
return;

36 | P a g e
}
if(dd3.length()>10 || dd3.length()<10)
{
dd3.setError("Enter 10 digit Mobile Number");
return;
}
if(a4.isEmpty())
{
dd4.setError("Enter Blood group");
return;
}
boolean isInserted = mhdnr.insertDatadnr(dd1.getText().toString() ,
dd2.getText().toString(),
dd3.getText().toString(), dd4.getText().toString());
if(isInserted == true)
Toast.makeText(add_dnr.this,"Blood Donor Data Inserted
Successfully",Toast.LENGTH_SHORT).show();

else
Toast.makeText(add_dnr.this, "Blood Donor Data Not Inserted Successfully"
,Toast.LENGTH_SHORT).show();
}
});

}
}

edit_dnr.java

package com.example.mustafa.found;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

37 | P a g e
public class edit_dnr extends AppCompatActivity {
EditText edn1,edn2,edn3,edn4,edn5;
Button dnredit;
MyHelperdnr mhdnr;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_edit_dnr);
edn1=(EditText)findViewById(R.id.id_edit_dnr);
edn2=(EditText)findViewById(R.id.nm_edit_dnr);
edn3=(EditText)findViewById(R.id.add_edit_dnr);
edn4=(EditText)findViewById(R.id.mob_edit_dnr);
edn5=(EditText)findViewById(R.id.bld_edit_dnr);
dnredit=(Button)findViewById(R.id.btn_edit_dnr);
mhdnr=new MyHelperdnr(this);
updateDatadnr();
}

public void updateDatadnr()


{

dnredit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view)
{
String z1,z2,z3,z4,z5;
z1=edn1.getText().toString();
z2=edn2.getText().toString();
z3=edn3.getText().toString();
z4=edn4.getText().toString();
z5=edn5.getText().toString();
if(z1.isEmpty())
{
edn1.setError("Enter ID");
return;
}
if(z2.isEmpty())
{
edn2.setError("Enter Name");
return;

38 | P a g e
}
if(z3.isEmpty())
{
edn3.setError("Enter Address");
return;
}
if(z4.isEmpty())
{
edn4.setError("Enter Mobile Number");
return;
}
if(z5.isEmpty())
{
edn5.setError("Enter Blood Group");
return;
}
boolean isUpdate =
mhdnr.updateDatadnr(edn1.getText().toString(),edn2.getText().toString(),edn3.getText().toStri
ng(),edn4.getText().toString(),edn5.getText().toString());
if(isUpdate== true)
Toast.makeText(edit_dnr.this,"Blood Donor Data Updated
Successfully",Toast.LENGTH_SHORT).show();

else
Toast.makeText(edit_dnr.this, "Blood Donor Data Not Updated Successfully"
,Toast.LENGTH_SHORT).show();
}
});
}
}

del_dnr.java

package com.example.mustafa.found;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

39 | P a g e
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class del_dnr extends AppCompatActivity {


EditText eid;
Button btndl;
MyHelperdnr mhdnr;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_del_dnr);
eid=(EditText)findViewById(R.id.id_del_dnr);
btndl=(Button)findViewById(R.id.btn_del_dnr);
mhdnr=new MyHelperdnr(this);
delDatadnr();
}
public void delDatadnr()
{
btndl.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String d2=eid.getText().toString();
if(d2.isEmpty())
{
eid.setError("Enter ID");
return;
}
boolean isdelete=mhdnr.delDatadnr(eid.getText().toString());
if(isdelete==true)
Toast.makeText(getApplicationContext(),"Blood Donor Data Deleted
Successfully",Toast.LENGTH_SHORT).show();
else
Toast.makeText(getApplicationContext(),"Blood Donor Data Not
Deleted",Toast.LENGTH_SHORT).show();
}
});
}
}

40 | P a g e
new_donor_request.java

package com.example.mustafa.found;

import android.content.Intent;
import android.database.Cursor;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import android.widget.Toast;

public class new_donor_request extends AppCompatActivity {


ImageButton l1,l2;
MyHelperenrdnr enrdnr;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_new_donor_request);
l1=(ImageButton)findViewById(R.id.ib_shw_new);
l2=(ImageButton)findViewById(R.id.ib_del_new);
l2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(new_donor_request.this,del_dnr_req.class));
Toast.makeText(getApplicationContext(),"Delete Donor
reuest",Toast.LENGTH_SHORT).show();
}
});
enrdnr=new MyHelperenrdnr(this);
showdataenrdnr();
}
public void showdataenrdnr()
{
l1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(getApplicationContext(),"Blood Donors

41 | P a g e
Request",Toast.LENGTH_SHORT).show();
Cursor res = enrdnr.getAllDataenrdnr();
if(res.getCount() == 0)
{
showMessage("Error","Nothing Found");
return;
}
StringBuffer buffer = new StringBuffer();
while(res.moveToNext())
{
buffer.append("ID : "+res.getString(0) + "\n");
buffer.append("Name : " + res.getString(1) + "\n");
buffer.append("Address : " + res.getString(2) + "\n");
buffer.append("Mobile Number: " + res.getString(3) + "\n");
}
showMessage("Blood Donor's Request", buffer.toString());
}
});
}
public void showMessage(String title , String message)
{
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setCancelable(true);
builder.setTitle(title);
builder.setMessage(message);
builder.show();
}
}

del_dnr_req.java

package com.example.mustafa.found;

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

42 | P a g e
import android.widget.Toast;

public class del_dnr_req extends AppCompatActivity {


EditText delreq1;
Button delreqbtn;
MyHelperenrdnr enrdnr;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_del_dnr_req);
delreq1=(EditText)findViewById(R.id.txt_del_req);
delreqbtn=(Button)findViewById(R.id.btn_del_req);
enrdnr=new MyHelperenrdnr(this);
delenrdnr();
}
public void delenrdnr()
{
delreqbtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String d2=delreq1.getText().toString();
if(d2.isEmpty())
{
delreq1.setError("Enter ID");
return;
}
boolean isdelete=enrdnr.delDataenrdnr(delreq1.getText().toString());
if(isdelete==true)
Toast.makeText(getApplicationContext(),"Blood Donor Data Deleted
Successfully",Toast.LENGTH_SHORT).show();
else
Toast.makeText(getApplicationContext(),"Blood Donor Data Not
Deleted",Toast.LENGTH_SHORT).show();
}
});
}
}

43 | P a g e
Enroll_donor.java

package com.example.mustafa.found;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class Enroll_donor extends AppCompatActivity {


EditText nw1,nw2,nw3,nw4;
Button nwadd;
MyHelperenrdnr enrdnr;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_enroll_donor);
nw1=(EditText)findViewById(R.id.txt_new_nm);
nw2=(EditText)findViewById(R.id.txt_new_add);
nw3=(EditText)findViewById(R.id.txt_new_mob);
nw4=(EditText)findViewById(R.id.txt_new_bld);
nwadd=(Button)findViewById(R.id.btn_new_add);
enrdnr=new MyHelperenrdnr(this);
addDataenrdnr();
}
public void addDataenrdnr()
{
nwadd.setOnClickListener(new View.OnClickListener()
{

@Override
public void onClick(View view) {
String a1,a2,a3,a4;
a1=nw1.getText().toString();
a2=nw2.getText().toString();
a3=nw3.getText().toString();
a4=nw4.getText().toString();
if(a1.isEmpty())

44 | P a g e
{
nw1.setError("Enter Name");
return;
}
if(a2.isEmpty())
{
nw2.setError("Enter Address");
return;
}
if(a3.isEmpty())
{
nw3.setError("Enter Mobile Number");
return;
}
if(nw3.length()>10 || nw3.length()<10)
{
nw3.setError("Enter 10 digit Mobile Number");
return;
}
if(a4.isEmpty())
{
nw4.setError("Enter Blood group");
return;
}
boolean isInserted = enrdnr.insertDataenrdnr(nw1.getText().toString() ,
nw2.getText().toString(),
nw3.getText().toString(), nw4.getText().toString());
if(isInserted == true)
Toast.makeText(Enroll_donor.this,"Your Enrollment is Done
Successfully",Toast.LENGTH_SHORT).show();

else
Toast.makeText(Enroll_donor.this, "Your Enrolllment is not done Successfully"
,Toast.LENGTH_SHORT).show();
}
});

45 | P a g e
search_bld_grp.java

package com.example.mustafa.found;
import android.database.Cursor;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class search_bld_grp extends AppCompatActivity {


MyHelperdnr mhdnr;
TextView ba,bap,bb,bbp,babp,bop;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_search);
mhdnr=new MyHelperdnr(this);
ba=(TextView)findViewById(R.id.txt_A);
bap=(TextView)findViewById(R.id.txt_AP);
bb=(TextView)findViewById(R.id.txt_B);
bbp=(TextView)findViewById(R.id.txt_BP);
babp=(TextView)findViewById(R.id.txt_ABP);
bop=(TextView)findViewById(R.id.txt_OP);
srchdataA();
srchdataAP();
srchdataB();
srchdataBP();
srchdataABP();
srchdataOP();
}
public void srchdataA()
{
ba.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Cursor cursor=mhdnr.srchdataA();
if(cursor.getCount() == 0)

46 | P a g e
{
// show msg
showMessage("Error","Nothing Found");
return;
}
StringBuffer buffer = new StringBuffer();
while(cursor.moveToNext())
{
buffer.append("Name : " + cursor.getString(1) + "\n");
buffer.append("Address : " + cursor.getString(2) + "\n");
buffer.append("Mobile Number : " + cursor.getString(3) + "\n");
buffer.append("Blood Group : "+cursor.getString(4)+ "\n");
}
showMessage(" Blood Group A Donor's List", buffer.toString());
}
});
}
public void srchdataAP()
{
bap.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Cursor cursor=mhdnr.srchdataAP();
if(cursor.getCount() == 0)
{
// show msg
showMessage("Error","Nothing Found");
return;
}
StringBuffer buffer = new StringBuffer();
while(cursor.moveToNext())
{
buffer.append("Name : " + cursor.getString(1) + "\n");
buffer.append("Address : " + cursor.getString(2) + "\n");
buffer.append("Mobile Number : " + cursor.getString(3) + "\n");
buffer.append("Blood Group : "+cursor.getString(4)+ "\n");
}
showMessage(" Blood Group A+ Donor's List", buffer.toString());
}
});

47 | P a g e
}
public void srchdataB()
{
bb.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Cursor cursor=mhdnr.srchdataB();
if(cursor.getCount() == 0)
{
// show msg
showMessage("Error","Nothing Found");
return;
}
StringBuffer buffer = new StringBuffer();
while(cursor.moveToNext())
{
buffer.append("Name : " + cursor.getString(1) + "\n");
buffer.append("Address : " + cursor.getString(2) + "\n");
buffer.append("Mobile Number : " + cursor.getString(3) + "\n");
buffer.append("Blood Group : "+cursor.getString(4)+ "\n");
}
showMessage(" Blood Group B Donor's List", buffer.toString());
}
});
}
public void srchdataBP()
{
bbp.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Cursor cursor=mhdnr.srchdataBP();
if(cursor.getCount() == 0)
{
// show msg
showMessage("Error","Nothing Found");
return;
}
StringBuffer buffer = new StringBuffer();
while(cursor.moveToNext())
{

48 | P a g e
buffer.append("Name : " + cursor.getString(1) + "\n");
buffer.append("Address : " + cursor.getString(2) + "\n");
buffer.append("Mobile Number : " + cursor.getString(3) + "\n");
buffer.append("Blood Group : "+cursor.getString(4)+ "\n");
}
showMessage(" Blood Group B+ Donor's List", buffer.toString());
}
});
}
public void srchdataABP()
{
babp.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Cursor cursor=mhdnr.srchdataABP();
if(cursor.getCount() == 0)
{
// show msg
showMessage("Error","Nothing Found");
return;
}
StringBuffer buffer = new StringBuffer();
while(cursor.moveToNext())
{
buffer.append("Name : " + cursor.getString(1) + "\n");
buffer.append("Address : " + cursor.getString(2) + "\n");
buffer.append("Mobile Number : " + cursor.getString(3) + "\n");
buffer.append("Blood Group : "+cursor.getString(4)+ "\n");
}
showMessage(" Blood Group AB+ Donor's List", buffer.toString());
}
});
}
public void srchdataOP()
{
bop.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Cursor cursor=mhdnr.srchdataOP();
if(cursor.getCount() == 0)

49 | P a g e
{
// show msg
showMessage("Error","Nothing Found");
return;
}
StringBuffer buffer = new StringBuffer();
while(cursor.moveToNext())
{
buffer.append("Name : " + cursor.getString(1) + "\n");
buffer.append("Address : " + cursor.getString(2) + "\n");
buffer.append("Mobile Number : " + cursor.getString(3) + "\n");
buffer.append("Blood Group : "+cursor.getString(4)+ "\n");
}
showMessage(" Blood Group O+ Donor's List", buffer.toString());
}
});
}

public void showMessage(String title , String message)


{
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setCancelable(true);
builder.setTitle(title);
builder.setMessage(message);
builder.show();
}
}

/ Helper class for Blood bank database /

MyHelper.java

package com.example.mustafa.found;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;

50 | P a g e
import android.database.sqlite.SQLiteOpenHelper;

public class MyHelper extends SQLiteOpenHelper {


public static final String DATABASE_NAME= "Bank.db";
public static final String TABLE_NAME = "bank_table";
public static final String COL_1 = "ID";
public static final String COl_2 = "Name";
public static final String COL_3 = "Address";
public static final String COL_4 = "Mobile";
public MyHelper(Context context)
{
super(context,DATABASE_NAME, null, 1);
}

@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL("Create Table " + TABLE_NAME + " (ID INTEGER PRIMARY KEY
AUTOINCREMENT , NAME TEXT, ADDRESS TEXT, MOBILE INTEGER) ");
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}

public boolean insertData(String name, String address, String mobile)


{
SQLiteDatabase db = this.getWritableDatabase();
ContentValues contentValues = new ContentValues();
contentValues.put(COl_2,name);
contentValues.put(COL_3,address);
contentValues.put(COL_4,mobile);
long result = db.insert(TABLE_NAME,null,contentValues);
if (result == -1)
return false;
else
return true;
}
public Cursor getAllData()
{
SQLiteDatabase db = this.getWritableDatabase();
Cursor res = db.rawQuery("select * from " + TABLE_NAME,null);

51 | P a g e
return res;
}
public boolean updateData(String id,String name, String address, String mobile)
{
SQLiteDatabase db = this.getWritableDatabase();
ContentValues contentValues = new ContentValues();
contentValues.put(COl_2,name);
contentValues.put(COL_3,address);
contentValues.put(COL_4,mobile);
db.update(TABLE_NAME,contentValues,"ID = ?", new String[] {id});
return true;
}
public boolean delData(String id)
{
SQLiteDatabase db=this.getWritableDatabase();
db.delete(TABLE_NAME,"ID=?",new String[] {id});
return true;
}

/ Helper class for Blood donor’s database /

MyHelperdnr.java

package com.example.mustafa.found;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class MyHelperdnr extends SQLiteOpenHelper {

public static final String DATABASE_NAME= "Blooddnr.db";


public static final String TABLE_NAME = "donor_table";
public static final String COL_1 = "ID";
public static final String COl_2 = "Name";

52 | P a g e
public static final String COL_3 = "Address";
public static final String COL_4 = "Mobile";
public static final String COL_5 = "Blood";
public MyHelperdnr(Context context)
{
super(context,DATABASE_NAME, null, 1);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL("Create Table " + TABLE_NAME + " (ID INTEGER PRIMARY KEY
AUTOINCREMENT , NAME TEXT, ADDRESS TEXT, MOBILE INTEGER ,BLOOD
TEXT) ");
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}
public boolean insertDatadnr(String name, String address, String mobile, String blood)
{
SQLiteDatabase db = this.getWritableDatabase();
ContentValues contentValues = new ContentValues();
contentValues.put(COl_2,name);
contentValues.put(COL_3,address);
contentValues.put(COL_4,mobile);
contentValues.put(COL_5,blood);
long result = db.insert(TABLE_NAME,null,contentValues);
if (result == -1)
return false;
else
return true;
}
public Cursor getAllDatadnr()
{
SQLiteDatabase db = this.getWritableDatabase();
Cursor res = db.rawQuery("select * from " + TABLE_NAME,null);
return res;
}
public boolean updateDatadnr(String id, String name, String address, String mobile, String
blood)
{
SQLiteDatabase db = this.getWritableDatabase();

53 | P a g e
ContentValues contentValues = new ContentValues();
contentValues.put(COl_2,name);
contentValues.put(COL_3,address);
contentValues.put(COL_4,mobile);
contentValues.put(COL_5,blood);
db.update(TABLE_NAME,contentValues,"ID = ?", new String[] {id});
return true;
}
public boolean delDatadnr(String id)
{
SQLiteDatabase db=this.getWritableDatabase();
db.delete(TABLE_NAME,"ID=?",new String[] {id});
return true;
}
public Cursor srchdataA()
{
SQLiteDatabase db=this.getReadableDatabase();
String blooda="A";
Cursor cursora=db.rawQuery("SELECT * FROM "+TABLE_NAME+" WHERE
"+COL_5 + " ='"+blooda+"'",null);
return cursora;
}
public Cursor srchdataAP()
{
SQLiteDatabase db=this.getReadableDatabase();
String bloodap="A+";
Cursor cursorap=db.rawQuery("SELECT * FROM "+TABLE_NAME+" WHERE
"+COL_5 + " ='"+bloodap+"'",null);
return cursorap;
}
public Cursor srchdataB()
{
SQLiteDatabase db=this.getReadableDatabase();
String bloodb="B";
Cursor cursorb=db.rawQuery("SELECT * FROM "+TABLE_NAME+" WHERE
"+COL_5 + " ='"+bloodb+"'",null);
return cursorb;
}
public Cursor srchdataBP()
{

54 | P a g e
SQLiteDatabase db=this.getReadableDatabase();
String bloodbp="B+";
Cursor cursorbp=db.rawQuery("SELECT * FROM "+TABLE_NAME+" WHERE
"+COL_5 + " ='"+bloodbp+"'",null);
return cursorbp;
}
public Cursor srchdataABP()
{
SQLiteDatabase db=this.getReadableDatabase();
String bloodabp="AB+";
Cursor cursorabp=db.rawQuery("SELECT * FROM "+TABLE_NAME+" WHERE
"+COL_5 + " ='"+bloodabp+"'",null);
return cursorabp;
}
public Cursor srchdataOP()
{
SQLiteDatabase db=this.getReadableDatabase();
String bloodop="O+";
Cursor cursorop=db.rawQuery("SELECT * FROM "+TABLE_NAME+" WHERE
"+COL_5 + " ='"+bloodop+"'",null);
return cursorop;
}
}

/ Helper class for User Enroll request database /

MyHelperenrdnr.java

package com.example.mustafa.found;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class MyHelperenrdnr extends SQLiteOpenHelper {


public static final String DATABASE_NAME= "Bloodenrdnr.db";
public static final String TABLE_NAME = "donor_table";

55 | P a g e
public static final String COL_1 = "ID";
public static final String COl_2 = "Name";
public static final String COL_3 = "Address";
public static final String COL_4 = "Mobile";
public static final String COL_5 = "Blood";
public MyHelperenrdnr(Context context)
{
super(context,DATABASE_NAME, null, 1);
}
public void onCreate(SQLiteDatabase db) {
db.execSQL("Create Table " + TABLE_NAME + " (ID INTEGER PRIMARY KEY
AUTOINCREMENT , NAME TEXT, ADDRESS TEXT, MOBILE INTEGER ,BLOOD
TEXT) ");
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}
public boolean insertDataenrdnr(String name, String address, String mobile, String blood)
{
SQLiteDatabase db = this.getWritableDatabase();
ContentValues contentValues = new ContentValues();
contentValues.put(COl_2,name);
contentValues.put(COL_3,address);
contentValues.put(COL_4,mobile);
contentValues.put(COL_5,blood);
long result = db.insert(TABLE_NAME,null,contentValues);
if (result == -1)
return false;
else
return true;
}
public Cursor getAllDataenrdnr()
{
SQLiteDatabase db = this.getWritableDatabase();
Cursor res = db.rawQuery("select * from " + TABLE_NAME,null);
return res;
}
public boolean delDataenrdnr(String id)
{
SQLiteDatabase db=this.getWritableDatabase();

56 | P a g e
db.delete(TABLE_NAME,"ID=?",new String[] {id});
return true;
}
}

Folder :- res (resource)


Package Name :- Layout

Activity_main.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"
tools:context=".MainActivity"
android:background="@drawable/a1">

<ImageButton
android:id="@+id/i_admin"
android:layout_width="137dp"
android:layout_height="139dp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginStart="124dp"
android:layout_marginLeft="124dp"
android:layout_marginTop="61dp"
android:scaleType="fitCenter"
app:srcCompat="@drawable/admin" />

<ImageButton
android:id="@+id/i_user"
android:layout_width="142dp"
android:layout_height="142dp"
android:layout_alignLeft="@id/i_admin"
android:layout_alignStart="@+id/i_admin"

57 | P a g e
android:layout_alignParentBottom="true"
android:layout_marginStart="1dp"
android:layout_marginLeft="1dp"
android:layout_marginBottom="110dp"
android:scaleType="fitCenter"
app:srcCompat="@drawable/user" />

</RelativeLayout>

Activity_user_p.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"
tools:context=".user_p"
android:background="@drawable/a1">

<Button
android:id="@+id/b_dnr"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="100dp"
android:layout_weight="1"
android:height="80dp"
android:background="@color/colorAccent"
android:text="Blood Donor" />

<Button
android:id="@+id/b_bnk"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_marginTop="150dp"

58 | P a g e
android:layout_weight="1"
android:height="80dp"
android:background="@color/colorAccent"
android:text="Blood Bank" />
</RelativeLayout>

Activity_add_bank.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"
tools:context=".add_bank"
android:background="@drawable/a1">

<EditText
android:id="@+id/txt_name"
style="@android:style/Widget.Holo.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginStart="5dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="47dp"
android:ems="10"
android:hint="Name"
android:inputType="textPersonName"
android:textAppearance="@style/TextAppearance.AppCompat.Display1" />

<EditText
android:id="@+id/txt_address"
style="@android:style/Widget.Holo.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"

59 | P a g e
android:layout_alignParentTop="true"
android:layout_marginStart="0dp"
android:layout_marginLeft="0dp"
android:layout_marginTop="162dp"
android:ems="10"
android:hint="Address"
android:inputType="textPersonName"
android:textAppearance="@style/TextAppearance.AppCompat.Display1" />

<EditText
android:id="@+id/txt_mob"
style="@android:style/Widget.Holo.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="0dp"
android:layout_marginBottom="153dp"
android:ems="10"
android:hint="Mobile"
android:inputType="number"
android:textAppearance="@style/TextAppearance.AppCompat.Display1"
android:layout_alignParentLeft="true"
android:layout_marginLeft="0dp" />

<Button
android:id="@+id/add_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="26dp"
android:height="80dp"
android:background="@color/colorAccent"
android:text="Add" />
</RelativeLayout>

60 | P a g e
Activity_add_dnr.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"
tools:context=".add_dnr"
android:background="@drawable/a1">

<EditText
android:id="@+id/txt_nm_dnr"
style="@android:style/Widget.Holo.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginStart="0dp"
android:layout_marginTop="1dp"
android:ems="10"
android:hint="Name"
android:inputType="textPersonName"
android:textAppearance="@style/TextAppearance.AppCompat.Display1"
android:layout_marginLeft="0dp"
android:layout_alignParentLeft="true" />

<EditText
android:id="@+id/txt_add_dnr"
style="@android:style/Widget.Holo.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginTop="96dp"
android:ems="10"
android:hint="Address"
android:inputType="textPersonName"
android:textAppearance="@style/TextAppearance.AppCompat.Display1"
android:layout_alignParentLeft="true" />

61 | P a g e
<EditText
android:id="@+id/txt_mob_dnr"
style="@android:style/Widget.Holo.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginStart="0dp"
android:layout_marginLeft="0dp"
android:layout_marginTop="193dp"
android:ems="10"
android:hint="Mobile"
android:inputType="number"
android:textAppearance="@style/TextAppearance.AppCompat.Display1" />

<EditText
android:id="@+id/txt_bld_dnr"
style="@android:style/Widget.Holo.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="0dp"
android:layout_marginLeft="0dp"
android:layout_marginBottom="122dp"
android:ems="10"
android:hint="Blood Group"
android:inputType="textPersonName"
android:textAppearance="@style/TextAppearance.AppCompat.Display1" />

<Button
android:id="@+id/btn_add_dnr"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="0dp"

62 | P a g e
android:height="80dp"
android:background="@color/colorAccent"
android:text="Add"
android:layout_alignParentLeft="true" />
</RelativeLayout>

Activity_admin_dnr_p.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"
tools:context=".admin_dnr_p"
android:background="@drawable/a1">

<ImageButton
android:id="@+id/d_add"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginStart="0dp"
android:layout_marginLeft="0dp"
android:layout_marginTop="48dp"
android:scaleType="fitCenter"
app:srcCompat="@drawable/add" />

<ImageButton
android:id="@+id/d_edit"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginTop="45dp"
android:layout_marginEnd="0dp"
android:layout_marginRight="0dp"

63 | P a g e
android:scaleType="fitCenter"
app:srcCompat="@drawable/edit" />

<ImageButton
android:id="@+id/d_del"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_alignStart="@+id/d_add"
android:layout_alignLeft="@+id/d_add"
android:layout_alignParentBottom="true"
android:layout_marginStart="0dp"
android:layout_marginLeft="0dp"
android:layout_marginBottom="85dp"
android:scaleType="fitCenter"
app:srcCompat="@drawable/delete" />

<ImageButton
android:id="@+id/d_shhw"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginEnd="0dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="87dp"
android:scaleType="fitCenter"
app:srcCompat="@drawable/show" />
</RelativeLayout>

Activity_admin_login.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"
tools:context=".admin_log"

64 | P a g e
android:background="@drawable/a1">

<EditText
android:id="@+id/txt_username"
style="@android:style/Widget.Holo.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="87dp"
android:ems="10"
android:hint="USERNAME"
android:inputType="textPersonName"
android:textAppearance="@style/TextAppearance.AppCompat.Display1" />

<EditText
android:id="@+id/txt_pass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="198dp"
android:ems="10"
android:hint="PASSWORD"
android:inputType="textPassword"
android:textAppearance="@style/TextAppearance.AppCompat.Display1" />

<Button
android:id="@+id/btn_log"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="69dp"
android:height="80dp"
android:background="@color/colorAccent"
android:text="Login"
android:layout_alignParentLeft="true" />
</RelativeLayout>

65 | P a g e
Activity_admin_p.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"
tools:context=".admin_p"
android:background="@drawable/a1">

<ImageButton
android:id="@+id/b_add"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginStart="0dp"
android:layout_marginLeft="0dp"
android:layout_marginTop="46dp"
android:scaleType="fitCenter"
app:srcCompat="@drawable/add" />

<ImageButton
android:id="@+id/b_edit"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginTop="44dp"
android:layout_marginEnd="0dp"
android:layout_marginRight="0dp"
android:scaleType="fitCenter"
app:srcCompat="@drawable/edit" />

<ImageButton
android:id="@+id/b_del"

66 | P a g e
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="0dp"
android:layout_marginLeft="0dp"
android:layout_marginBottom="89dp"
android:scaleType="fitCenter"
app:srcCompat="@drawable/delete" />

<ImageButton
android:id="@+id/b_shhw"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_alignStart="@+id/b_edit"
android:layout_alignLeft="@id/b_edit"
android:layout_alignParentBottom="true"
android:layout_marginStart="9dp"
android:layout_marginLeft="9dp"
android:layout_marginBottom="86dp"
android:scaleType="fitCenter"
app:srcCompat="@drawable/show" />
</RelativeLayout>

Activity_admin_sel.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"
tools:context=".admin_sel"
android:background="@drawable/a1">

<Button
android:id="@+id/b_bank_admin"

67 | P a g e
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="101dp"
android:height="80dp"
android:background="@color/colorAccent"
android:text="Blood Bank" />

<Button
android:id="@+id/b_dnr_admin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="0dp"
android:layout_marginLeft="0dp"
android:layout_marginBottom="168dp"
android:background="@color/colorAccent"
android:text="Blood donor"
android:height="80dp"/>
</RelativeLayout>

Activity_del_bank.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"
tools:context=".del_bank"
android:background="@drawable/a1">

<EditText
android:id="@+id/txt_id"
style="@android:style/Widget.Holo.EditText"
android:layout_width="wrap_content"

68 | P a g e
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="67dp"
android:ems="10"
android:hint="ID"
android:inputType="number"
android:textAppearance="@style/TextAppearance.AppCompat.Display1" />

<Button
android:id="@+id/del_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="206dp"
android:background="@color/colorAccent"
android:height="80dp"
android:text="Delete" />
</RelativeLayout>

Activity_del_dnr.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"
tools:context=".del_dnr"
android:background="@drawable/a1">

<EditText
android:id="@+id/id_del_dnr"
style="@android:style/Widget.Holo.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"

69 | P a g e
android:layout_centerHorizontal="true"
android:layout_marginTop="70dp"
android:ems="10"
android:hint="ID"
android:inputType="number"
android:textAppearance="@style/TextAppearance.AppCompat.Display1" />

<Button
android:id="@+id/btn_del_dnr"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:height="80dp"
android:background="@color/colorAccent"
android:text="Delete" />
</RelativeLayout>

Activity_del_dnr_req.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"
tools:context=".del_dnr_req"
android:background="@drawable/a1">

<EditText
android:id="@+id/txt_del_req"
style="@android:style/Widget.Holo.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="41dp"
android:ems="10"

70 | P a g e
android:hint="ID"
android:inputType="number"
android:textAppearance="@style/TextAppearance.AppCompat.Display1" />

<Button
android:id="@+id/btn_del_req"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginStart="0dp"
android:layout_marginLeft="0dp"
android:layout_marginTop="164dp"
android:background="@color/colorAccent"
android:text="Delete"
android:height="80dp"/>
</RelativeLayout>

Activity_edit_bank.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"
tools:context=".edit_bank"
android:background="@drawable/a1">

<EditText
android:id="@+id/id_edit"
style="@android:style/Widget.Holo.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"

71 | P a g e
android:layout_marginTop="18dp"
android:ems="10"
android:hint="ID"
android:inputType="textPersonName"
android:textAppearance="@style/TextAppearance.AppCompat.Display1" />

<EditText
android:id="@+id/nm_edit"
style="@android:style/Widget.Holo.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginTop="125dp"
android:ems="10"
android:hint="Name"
android:inputType="textPersonName"
android:textAppearance="@style/TextAppearance.AppCompat.Display1"
android:layout_alignParentLeft="true" />

<EditText
android:id="@+id/add_edit"
style="@android:style/Widget.Holo.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="210dp"
android:ems="10"
android:hint="Address"
android:inputType="textPersonName"
android:textAppearance="@style/TextAppearance.AppCompat.Display1"
android:layout_alignParentLeft="true" />

<EditText
android:id="@+id/mob_edit"
style="@android:style/Widget.Holo.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"

72 | P a g e
android:layout_alignParentBottom="true"
android:layout_marginBottom="119dp"
android:ems="10"
android:hint="Mobile"
android:inputType="number"
android:textAppearance="@style/TextAppearance.AppCompat.Display1"
android:layout_alignParentLeft="true" />

<Button
android:id="@+id/edit_btn"
android:layout_width="match_parent"
android:layout_height="59dp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="0dp"
android:layout_marginLeft="0dp"
android:layout_marginBottom="19dp"
android:background="@color/colorAccent"
android:text="Edit" />
</RelativeLayout>

Activity_edit_dnr.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"
tools:context=".edit_dnr"
android:background="@drawable/a1">

<EditText
android:id="@+id/id_edit_dnr"
style="@android:style/Widget.Holo.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

73 | P a g e
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:ems="10"
android:hint="ID"
android:inputType="number"
android:textAppearance="@style/TextAppearance.AppCompat.Display1"
android:layout_alignParentLeft="true" />

<EditText
android:id="@+id/nm_edit_dnr"
style="@android:style/Widget.Holo.EditText"
android:layout_width="match_parent"
android:layout_height="53dp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginStart="0dp"
android:layout_marginLeft="0dp"
android:layout_marginTop="88dp"
android:ems="10"
android:hint="Name"
android:inputType="textPersonName"
android:textAppearance="@style/TextAppearance.AppCompat.Display1" />

<EditText
android:id="@+id/add_edit_dnr"
style="@android:style/Widget.Holo.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginStart="0dp"
android:layout_marginLeft="0dp"
android:layout_marginTop="161dp"
android:ems="10"
android:hint="Address"
android:inputType="textPersonName"
android:textAppearance="@style/TextAppearance.AppCompat.Display1" />

74 | P a g e
<EditText
android:id="@+id/mob_edit_dnr"
style="@android:style/Widget.Holo.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="0dp"
android:layout_marginLeft="0dp"
android:layout_marginBottom="179dp"
android:ems="10"
android:hint="Mobile"
android:inputType="number"
android:textAppearance="@style/TextAppearance.AppCompat.Display1" />

<EditText
android:id="@+id/bld_edit_dnr"
style="@android:style/Widget.Holo.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="83dp"
android:ems="10"
android:hint="Blood Group"
android:inputType="textPersonName"
android:textAppearance="@style/TextAppearance.AppCompat.Display1"
android:layout_alignParentLeft="true" />

<Button
android:id="@+id/btn_edit_dnr"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="0dp"
android:layout_marginLeft="0dp"
android:background="@color/colorAccent"

75 | P a g e
android:text="Edit"
android:height="80dp"/>
</RelativeLayout>

Activity_enroll_donor.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"
tools:context=".Enroll_donor"
android:background="@drawable/a1">

<EditText
android:id="@+id/txt_new_nm"
style="@android:style/Widget.Holo.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginStart="0dp"
android:layout_marginLeft="0dp"
android:layout_marginTop="8dp"
android:ems="10"
android:hint="Name"
android:inputType="textPersonName"
android:textAppearance="@style/TextAppearance.AppCompat.Display1" />

<EditText
android:id="@+id/txt_new_add"
style="@android:style/Widget.Holo.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"

76 | P a g e
android:layout_alignParentTop="true"
android:layout_marginTop="124dp"
android:ems="10"
android:hint="Address"
android:inputType="textPersonName"
android:textAppearance="@style/TextAppearance.AppCompat.Display1"
android:layout_alignParentLeft="true" />

<EditText
android:id="@+id/txt_new_mob"
style="@android:style/Widget.Holo.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="0dp"
android:layout_marginBottom="193dp"
android:ems="10"
android:hint="Mobile"
android:inputType="number"
android:textAppearance="@style/TextAppearance.AppCompat.Display1"
android:layout_marginLeft="0dp"
android:layout_alignParentLeft="true" />

<EditText
android:id="@+id/txt_new_bld"
style="@android:style/Widget.Holo.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="95dp"
android:ems="10"
android:hint="Blood Group"
android:inputType="textPersonName"
android:textAppearance="@style/TextAppearance.AppCompat.Display1"
android:layout_alignParentLeft="true" />

<Button
android:id="@+id/btn_new_add"

77 | P a g e
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="0dp"
android:layout_marginLeft="0dp"
android:background="@color/colorAccent"
android:text="Enroll"
android:height="80dp"/>
</RelativeLayout>

Activity_new_donor_request.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"
tools:context=".new_donor_request"
android:background="@drawable/a1">

<ImageButton
android:id="@+id/ib_shw_new"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginStart="110dp"
android:layout_marginLeft="110dp"
android:layout_marginTop="72dp"
android:scaleType="fitCenter"
app:srcCompat="@drawable/show" />

<ImageButton

78 | P a g e
android:id="@+id/ib_del_new"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_alignStart="@+id/ib_shw_new"
android:layout_alignParentBottom="true"
android:layout_marginBottom="60dp"
android:scaleType="fitCenter"
app:srcCompat="@drawable/delete"
android:layout_alignLeft="@+id/ib_shw_new" />
</RelativeLayout>

Activity_search.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"
tools:context=".search_bld_grp"
android:background="@drawable/a1">

<TextView
android:id="@+id/txt_A"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginStart="33dp"
android:layout_marginLeft="33dp"
android:layout_marginTop="15dp"
android:text="A"
android:textAppearance="@style/TextAppearance.AppCompat.Display1"
android:textColor="#F00"
android:textSize="60dp"
android:textStyle="bold" />

79 | P a g e
<TextView
android:id="@+id/txt_AP"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginTop="20dp"
android:layout_marginEnd="35dp"
android:layout_marginRight="35dp"
android:text="A+"
android:textColor="#F00"
android:textSize="60dp"
android:textStyle="bold" />

<TextView
android:id="@+id/txt_B"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/txt_A"
android:layout_alignLeft="@+id/txt_A"
android:layout_alignParentTop="true"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:layout_marginTop="163dp"
android:text="B"
android:textColor="#F00"
android:textSize="60dp"
android:textStyle="bold" />

<TextView
android:id="@+id/txt_BP"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/txt_AP"
android:layout_alignLeft="@+id/txt_AP"
android:layout_alignParentTop="true"
android:layout_marginStart="-2dp"
android:layout_marginLeft="-2dp"

80 | P a g e
android:layout_marginTop="163dp"
android:text="B+"
android:textColor="#F00"
android:textSize="60dp"
android:textStyle="bold" />

<TextView
android:id="@+id/txt_ABP"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/txt_A"
android:layout_alignLeft="@+id/txt_A"
android:layout_alignParentBottom="true"
android:layout_marginStart="-16dp"
android:layout_marginLeft="-16dp"
android:layout_marginBottom="59dp"
android:text="AB+"
android:textColor="#F00"
android:textSize="60dp"
android:textStyle="bold" />

<TextView
android:id="@+id/txt_OP"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/txt_ABP"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="42dp"
android:layout_marginRight="42dp"
android:layout_marginBottom="0dp"
android:text="O+"
android:textColor="#F00"
android:textSize="60dp"
android:textStyle="bold" />
</RelativeLayout>

81 | P a g e
Package : Menu
Adminlogout.xml

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


<menu xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">

<item
android:id="@+id/logout"
android:title="Log Out" />
</menu>

Adminmenu.xml

<menu xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">

<item
android:id="@+id/ad_it_nw_req"
android:title="Enroll Request" />
</menu>

Usermenu.xml

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


<menu xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">

<item
android:id="@+id/it_enrl"
android:title="Enroll as Donor" />
<item
android:id="@+id/it_about"

82 | P a g e
android:title="About Us" />
</menu>

Package : Values
Colors.xml

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


<resources>
<color name="colorPrimary">#008577</color>
<color name="colorPrimaryDark">#00574B</color>
<color name="colorAccent">#fff820</color>
</resources>

Ic_launcher_background.xml

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


<resources>
<color name="ic_launcher_background">#FFFF00</color>
</resources>

Strings.xml
<resources>
<string name="app_name">found</string>
</resources>

Styles.xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>

83 | P a g e
RESULTS
TABLES :-
Table Name :- Blood Bank

Column Data Type


Bank_id Integer
Bank_name Varchar
Bank_address Varchar
Bank_contact Integer

Table Name :- Blood Donor

Column Data Type


Donor_id Integer
Donor_name Varchar
Donor_address Varchar
Donor_contact Integer
Donor_blood_group Varchar

Table Name :- Enroll User Request

Column Data Type


User_id Integer
User_name Varchar
User_address Varchar
User_contact Integer
User_blood_group Varchar

84 | P a g e
SCREENSHOTS
User :-

85 | P a g e
86 | P a g e
Admin :-

87 | P a g e
88 | P a g e
89 | P a g e
90 | P a g e
91 | P a g e
FUTURE ENHANCEMENT

 In future there will be list of blood banks of more cities in Maharastra

 We will include more functionality as per user requirement

 Not a single application is ever considered as complete forever firstly

because there is always something new requirement also are growing day by

day

 We will provide the GPS Service to find the nearest blood bank for the user.

 We will also provide details of blood group and other medical information

of the blood donor.

92 | P a g e
REFERENCE AND BIBLIOGRAPHY

1) www.stackoverflow.com

2) www.github.com

3) www.youtube.com

4) www.simplifiedcoding.com

93 | P a g e
Reference
Acharya, Kamal. "STUDENT INFORMATION MANAGEMENT
SYSTEM." Authorea Preprints (2023).
Acharya, Kamal. "Library Management System." Available at SSRN4807104 (2019).
ACHARYA, KAMAL, et al. "LIBRARY MANAGEMENT SYSTEM." (2019).
Acharya, Kamal. "Online bus reservation system project report." Authorea
Preprints (2024).
Acharya, Kamal. "Online bus reservation system project report." (2024).
Acharya, Kamal. “Online Bus Reservation System.” SSRN ElectroNIC ASIA
Journal (2024): n. pag.
Acharya, Kamal. “Student Information Management System Project.” SSRN
ElectroNIC ASIA Journal (2024): n. pag.
Acharya, Kamal. “ATTENDANCE MANAGEMENT SYSTEM.” International
Research Journal of Modernization in Engineering Technology and
Science (2023): n. pag.
Acharya, Kamal. “College Information Management System.” SSRN ElectroNIC
ASIA Journal (2024): n. pag.
Acharya, Kamal, Attendance Management System Project (April 28, 2024).
Available at
SSRN: https://ssrn.com/abstract=4810251 or http://dx.doi.org/10.2139/ssrn.4810251
Acharya, Kamal, Online Food Order System (May 2, 2024). Available at
SSRN: https://ssrn.com/abstract=4814732 or http://dx.doi.org/10.2139/ssrn.4814732
Acharya, Kamal, University management system project. (May 1, 2024). Availableat
SSRN: https://ssrn.com/abstract=4814103 or http://dx.doi.org/10.2139/ssrn.4814103
Acharya, Kamal, Online banking management system. (May 1, 2024). Available at
SSRN: https://ssrn.com/abstract=4813597 or http://dx.doi.org/10.2139/ssrn.4813597
Acharya, Kamal, Online Job Portal Management System (May 5, 2024). Available at
SSRN: https://ssrn.com/abstract=4817534 or http://dx.doi.org/10.2139/ssrn.4817534
Acharya, Kamal, Employee leave management system. (May 7, 2024). Available
at SSRN: https://ssrn.com/abstract=4819626 or http://dx.doi.org/10.2139/ssrn.4819626
Acharya, Kamal, Online electricity billing project report. (May 7, 2024). Available at
SSRN: https://ssrn.com/abstract=4819630 or http://dx.doi.org/10.2139/ssrn.4819630
Acharya, Kamal, POLICY MANAGEMENT SYSTEM PROJECT REPORT. (December 10, 2023). Available at
SSRN: https://ssrn.com/abstract=4831694 or http://dx.doi.org/10.2139/ssrn.4831694
Acharya, Kamal, Online job placement system project report. (January 10, 2023). Available at
SSRN: https://ssrn.com/abstract=4831638 or http://dx.doi.org/10.2139/ssrn.4831638
Acharya, Kamal, Software testing for project report. (May 16, 2023). Available at
SSRN: https://ssrn.com/abstract=4831028 or http://dx.doi.org/10.2139/ssrn.4831028
Acharya, Kamal, ONLINE CRIME REPORTING SYSTEM PROJECT. (August 10, 2022). Available at
SSRN: https://ssrn.com/abstract=4831015 or http://dx.doi.org/10.2139/ssrn.4831015
Acharya, Kamal, Burber ordering system project report. (October 10, 2022). Available at
SSRN: https://ssrn.com/abstract=4832704 or http://dx.doi.org/10.2139/ssrn.4832704
Acharya, Kamal, Teachers Record Management System Project Report (December 10, 2023). Available at
SSRN: https://ssrn.com/abstract=4833821 or http://dx.doi.org/10.2139/ssrn.4833821
Acharya, Kamal, Dairy Management System Project Report (December 20, 2020). Available at
SSRN: https://ssrn.com/abstract=4835231 or http://dx.doi.org/10.2139/ssrn.4835231
94 | P a g e
Acharya, Kamal, Electrical Shop Management System Project (December 10, 2019). Available at
SSRN: https://ssrn.com/abstract=4835238 or http://dx.doi.org/10.2139/ssrn.4835238
Acharya, Kamal, Online book store management system project report. (Febuary 10, 2020). Available at
SSRN: https://ssrn.com/abstract=4835277 or http://dx.doi.org/10.2139/ssrn.4835277
Acharya, Kamal, Paint shop management system project report. (January 10, 2019). Available at
SSRN: https://ssrn.com/abstract=4835441 or http://dx.doi.org/10.2139/ssrn.4835441
Acharya, Kamal, Supermarket billing system project report. (August 10, 2021). Available at
SSRN: https://ssrn.com/abstract=4835474 or http://dx.doi.org/10.2139/ssrn.4835474
Acharya, Kamal, Online texi booking system project report. (March 10, 2022). Available at
SSRN: https://ssrn.com/abstract=4837729 or http://dx.doi.org/10.2139/ssrn.4837729
Acharya, Kamal, Online car servicing system project report. (March 10, 2023). Available at
SSRN: https://ssrn.com/abstract=4837832 or http://dx.doi.org/10.2139/ssrn.4837832
Acharya, Kamal, School management system project report. (July 10, 2021). Available at
SSRN: https://ssrn.com/abstract=4837837 or http://dx.doi.org/10.2139/ssrn.4837837
Acharya, Kamal, Furniture Showroom Management System Project Report (March 21, 2021). Available at
SSRN: https://ssrn.com/abstract=4839422 or http://dx.doi.org/10.2139/ssrn.4839422
Acharya, Kamal, Online Vehicle Rental System Project Report (March 21, 2019). Available at
SSRN: https://ssrn.com/abstract=4839429 or http://dx.doi.org/10.2139/ssrn.4839429
Acharya, Kamal, Fruit Shop Management System Project Report (August 10, 2023). Available at
SSRN: https://ssrn.com/abstract=4841048 or http://dx.doi.org/10.2139/ssrn.4841048
Acharya, Kamal, Hall Booking Management System Project Report (December 21, 2023). Available at
SSRN: https://ssrn.com/abstract=4841055 or http://dx.doi.org/10.2139/ssrn.4841055
Acharya, Kamal, Lundry Management System Project Report (October 21, 2023). Available at
SSRN: https://ssrn.com/abstract=4841059 or http://dx.doi.org/10.2139/ssrn.4841059
Acharya, Kamal, A CASE STUDY OF CINEMA MANAGEMENT SYSTEM PROJECT (September 25, 2023).
Available at SSRN: https://ssrn.com/abstract=4841209 or http://dx.doi.org/10.2139/ssrn.4841209
Acharya, Kamal, A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT (May 25, 2024). Available at
SSRN: https://ssrn.com/abstract=4841210 or http://dx.doi.org/10.2139/ssrn.4841210
Acharya, Kamal, ONLINE DATING MANAGEMENT SYSTEM PROJECT REPORT. (April 25, 2023). Available at
SSRN: https://ssrn.com/abstract=4842066 or http://dx.doi.org/10.2139/ssrn.4842066
Acharya, Kamal, ONLINE RESUME BUILDER MANAGEMENT SYSTEM PROJECT REPORT. (April 25, 2021).
Available at SSRN: https://ssrn.com/abstract=4842071 or http://dx.doi.org/10.2139/ssrn.4842071
Acharya, Kamal, TOLL TEX MANAGEMENT SYSTEM PROJECT REPORT (August 21, 2023). Available at
SSRN: https://ssrn.com/abstract=4842082 or http://dx.doi.org/10.2139/ssrn.4842082
Acharya, Kamal, Chat Application Through Client Server Management System Project Report (June 25, 2023).
Available at SSRN: https://ssrn.com/abstract=4842761 or http://dx.doi.org/10.2139/ssrn.4842761
Acharya, Kamal, Web Chatting Application Management System Project Report (April 25, 2022). Available at
SSRN: https://ssrn.com/abstract=4842771 or http://dx.doi.org/10.2139/ssrn.4842771
Acharya, Kamal, Automobile management system project report (May 25, 2022). Available at
SSRN: https://ssrn.com/abstract=4846917 or http://dx.doi.org/10.2139/ssrn.4846917
Acharya, Kamal, College bus management system project report (April 25, 2023). Available at
SSRN: https://ssrn.com/abstract=4846920 or http://dx.doi.org/10.2139/ssrn.4846920
Acharya, Kamal, Courier management system project report (May 25, 2023). Available at
SSRN: https://ssrn.com/abstract=4846922 or http://dx.doi.org/10.2139/ssrn.4846922
Acharya, Kamal, Event management system project report (April 25, 2021). Available at
SSRN: https://ssrn.com/abstract=4846927 or http://dx.doi.org/10.2139/ssrn.4846927
Acharya, Kamal, Library management system project report II (May 25, 2020). Available at
SSRN: https://ssrn.com/abstract=4848857 or http://dx.doi.org/10.2139/ssrn.4848857

95 | P a g e

You might also like