

{"id":115656,"date":"2023-10-09T19:00:11","date_gmt":"2023-10-09T13:30:11","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=115656"},"modified":"2026-06-01T14:18:18","modified_gmt":"2026-06-01T08:48:18","slug":"android-organ-donation-app","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/android-organ-donation-app\/","title":{"rendered":"Android Project \u2013 Organ Donation App"},"content":{"rendered":"<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:2610,&quot;href&quot;:&quot;https:\\\/\\\/drive.google.com\\\/file\\\/d\\\/1ghcf6yrG3VBqb6WayGA9olZDpImTsTaM\\\/view?usp=drive_link&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20260601090543\\\/https:\\\/\\\/drive.google.com\\\/file\\\/d\\\/1ghcf6yrG3VBqb6WayGA9olZDpImTsTaM\\\/view?usp=drive_link&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-06-02 07:29:44&quot;,&quot;http_code&quot;:200}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-02 07:29:44&quot;,&quot;http_code&quot;:200},&quot;process&quot;:&quot;done&quot;}]'><\/div>\n<p>Welcome! In this project, we will try to create an Android application for organ donation tracking using Android Studio. Join us as we dive into the world of Android app development and work towards building an application that promotes the noble cause of organ donation. Let&#8217;s get started right away!<\/p>\n<h2>About Android Organ Donation App<\/h2>\n<p>Organ donation is a remarkable act of kindness that has the potential to save lives and bring hope to those in need. With the aim of spreading awareness and facilitating the organ donation process, our app serves as a valuable resource for individuals interested in becoming organ donors.<\/p>\n<p>Through this app, users can access vital information about organ donation, find local organ donation centres, and stay informed about the other recipients in need. By leveraging technology, we hope to inspire more people to become organ donors, ultimately contributing to a brighter and healthier future for all.<\/p>\n<h3>Flow of Application:<\/h3>\n<p>The organ donation app follows a user-friendly flow that simplifies the process of organ donation. Here&#8217;s a breakdown of its main features and the flow of the app:<\/p>\n<ul>\n<li><strong>\u00a0Donor Registration:<\/strong> Users who wish to become organ donors can easily register through the app. They will have the option to specify their organ donation preferences, blood type, age, addresses and phone number.<\/li>\n<li>\u00a0<strong>Organ Donation Hospitals:<\/strong> The app offers a directory of nearby organ donation centres and hospitals. Users can search for centres based on location, availability of specific organs, and other relevant criteria.<\/li>\n<li><strong>\u00a0Blood Specification:<\/strong> The app offers a directory of specific donors based on the blood types of the donors so that they can easily find the most compatible organs.<\/li>\n<li><strong>\u00a0Organ Specification:<\/strong> The app offers a directory of specific organs so that they can easily find the exact organs that they might be looking for.<\/li>\n<\/ul>\n<h3>Requirements for The Project:<\/h3>\n<p>To develop an Android Organ Donation project, you&#8217;ll need the following requirements:<\/p>\n<ul>\n<li>Knowledge of Java or Kotlin.<\/li>\n<li>\u00a0Android Studio.<\/li>\n<li>\u00a0Understanding of Android Input Methods.<\/li>\n<li>\u00a0Understanding of Firebase Hosting and Database.<\/li>\n<li>\u00a0Knowledge of XML Layout Design.<\/li>\n<li>\u00a0Android Keyboard API<\/li>\n<li>\u00a0User Interface Design Concepts<\/li>\n<li>\u00a0Object Oriented Programming Concepts<\/li>\n<\/ul>\n<p>By fulfilling these requirements, you&#8217;ll be well-equipped to develop a custom Android organ donation project.<\/p>\n<h3>Download Android Organ Donation App Project.<\/h3>\n<p>Please download the source code of the Android Organ Donation App Project: \u00a0<a href=\"https:\/\/drive.google.com\/file\/d\/1ghcf6yrG3VBqb6WayGA9olZDpImTsTaM\/view?usp=drive_link\"><strong>Android Organ Donation App Project Code.<\/strong><\/a><\/p>\n<h3>Project Description:<\/h3>\n<p>On downloading the code, you are going to see many folders. This section gives you a brief about which folders and files are essential for your project:<\/p>\n<p><strong>Manifest File (AndroidManifest.xml):<\/strong> The manifest file gives the Android system crucial details about your app, including the package name, activities, services, permissions, and hardware requirements.<\/p>\n<p><strong>Java Class Code (com.example.orgdon) :<\/strong> There are multiple classes in our project. Dividing our whole project into these multiple classes offers advantages such as modularity, code organisation, reusability, scalability, maintainability, and improved readability and debugging. The whole code can be divided into five types:<br \/>\n<strong>o<\/strong> Organ List and Classes<br \/>\n<strong>o<\/strong> Blood List and Classes<br \/>\n<strong>o<\/strong> Donor and Hospital Lists Classes<br \/>\n<strong>o<\/strong> Main Activity and Firebase Classes<br \/>\n<strong>o<\/strong> Adapter Class<\/p>\n<p><strong>Resources:<\/strong><br \/>\n<strong>o drawables:<\/strong> Contains the icons\/vectors required for the application.<br \/>\n<strong>o layout:<\/strong> Contains the basic designs of the different pages of the application.<br \/>\n<strong>o values:<\/strong> Contains the references to different values used in the application<br \/>\n<strong>o menu:<\/strong> Contains the layout of the search menu option<\/p>\n<p><strong>Gradle Scripts:<\/strong> Contains all the dependencies and libraries that we will import in our project.<\/p>\n<h3>Steps To Implement the Project:<\/h3>\n<p><strong>1.<\/strong> Download the source code.<br \/>\n<strong>2.<\/strong> Locate the zip file and unzip.<br \/>\n<strong>3.<\/strong> Open Android Studio and click on \u201cOpen an Existing Project\u201d.<br \/>\n<strong>4.<\/strong> Locate and select the source code folder.<br \/>\n<strong>5.<\/strong> The IDE should look like this:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/ide.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-120601 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/ide.webp\" alt=\"ide\" width=\"940\" height=\"499\" \/><\/a><\/p>\n<p><strong>6.<\/strong> On opening the folder in Android Studio, make sure the gradle scripts and the settings are suitable for your IDE and SDK.<br \/>\n<strong>7.<\/strong> Work around the files and try to figure out what they all do. Start with AndroidManifest.xml and follow the different codes to different ends.<\/p>\n<h4>Main Activity:<\/h4>\n<p>This is the front page file of our application. ImageView and TextView are holder for our images and texts, and there are certain buttons that, on click, go to their specific pages.<\/p>\n<p><strong><strong>activity_main.xml:<\/strong><\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n\r\n&lt;!--This is our front page--&gt;\r\n\r\n&lt;LinearLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n    xmlns:tools=\"http:\/\/schemas.android.com\/tools\"\r\n    android:layout_width=\"fill_parent\"\r\n    android:layout_height=\"fill_parent\"\r\n    android:gravity=\"center_horizontal\"\r\n    android:orientation=\"vertical\"\r\n    android:layout_marginTop=\"40dp\"\r\n    tools:context=\".MainActivity\"&gt;\r\n\r\n    &lt;LinearLayout\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:gravity=\"center\"\r\n        android:orientation=\"vertical\"&gt;\r\n\r\n        &lt;ImageView\r\n            android:layout_width=\"wrap_content\"\r\n            android:layout_height=\"100dp\"\r\n            android:src=\"@drawable\/log\" \/&gt;\r\n\r\n        &lt;TextView\r\n            android:id=\"@+id\/textView2\"\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"wrap_content\"\r\n            android:gravity=\"center\"\r\n            android:paddingBottom=\"15dp\"\r\n            android:text=\"Organ Donation\"\r\n            android:textColor=\"@color\/black\"\r\n            android:textSize=\"30sp\"\r\n            android:textStyle=\"bold\" \/&gt;\r\n\r\n        &lt;TextView\r\n            android:id=\"@+id\/textView3\"\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"wrap_content\"\r\n            android:layout_marginHorizontal=\"5dp\"\r\n            android:gravity=\"center\"\r\n            android:paddingHorizontal=\"10dp\"\r\n            android:text=\"Giving a second change of life is in your hands.\"\r\n            android:textColor=\"@color\/black\"\r\n            android:textSize=\"16sp\"\r\n            android:textStyle=\"bold\" \/&gt;\r\n\r\n        &lt;Button\r\n            android:id=\"@+id\/recyclerviewbtn\"\r\n            android:layout_width=\"360dp\"\r\n            android:layout_height=\"70dp\"\r\n            android:layout_gravity=\"center\"\r\n            android:layout_marginVertical=\"10dp\"\r\n            android:backgroundTint=\"#F44336\"\r\n            android:text=\"ORGAN DONORS\" \/&gt;\r\n\r\n        &lt;Button\r\n            android:id=\"@+id\/groupList\"\r\n            android:layout_width=\"360dp\"\r\n            android:layout_height=\"70dp\"\r\n            android:layout_gravity=\"center\"\r\n            android:layout_marginVertical=\"10dp\"\r\n            android:backgroundTint=\"#F44336\"\r\n            android:text=\"By Blood Group\" \/&gt;\r\n\r\n        &lt;Button\r\n            android:id=\"@+id\/frequency\"\r\n            android:layout_width=\"360dp\"\r\n            android:layout_height=\"70dp\"\r\n            android:layout_gravity=\"center\"\r\n            android:layout_marginVertical=\"10dp\"\r\n            android:backgroundTint=\"#F44336\"\r\n            android:text=\"Organs\" \/&gt;\r\n\r\n        &lt;Button\r\n            android:id=\"@+id\/place\"\r\n            android:layout_width=\"360dp\"\r\n            android:layout_height=\"70dp\"\r\n            android:layout_gravity=\"center\"\r\n            android:layout_marginVertical=\"10dp\"\r\n            android:backgroundTint=\"#F44336\"\r\n            android:text=\"HOSPITALS\" \/&gt;\r\n\r\n    &lt;\/LinearLayout&gt;\r\n\r\n    &lt;LinearLayout\r\n        android:layout_width=\"wrap_content\"\r\n        android:layout_height=\"match_parent\"\r\n        android:layout_marginVertical=\"30dp\"\r\n        android:gravity=\"center|bottom\"&gt;\r\n\r\n        &lt;ImageView\r\n            android:layout_width=\"wrap_content\"\r\n            android:layout_height=\"100dp\"\r\n            android:src=\"@drawable\/download\"\r\n            android:gravity=\"bottom\" \/&gt;\r\n\r\n    &lt;\/LinearLayout&gt;\r\n\r\n&lt;\/LinearLayout&gt;<\/pre>\n<p><strong><strong>MainActivity.java:<\/strong><\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/*A DataFlair Guide*\/\r\n\r\n\r\npackage com.example.orgdon;\r\n\r\nimport android.content.Intent;\r\nimport android.os.Bundle;\r\nimport android.widget.Button;\r\n\r\nimport androidx.appcompat.app.AppCompatActivity;\r\n\r\nimport java.util.Objects;\r\n\r\n\/*\r\nThis part of the code is called first.\r\nHere, we initialize and call our Front Page.\r\n*\/\r\n\r\npublic class MainActivity extends AppCompatActivity {\r\n\r\n    Button donors, bloodgroup, organs, hospitals;\r\n\r\n    @Override\r\n    protected void onCreate(Bundle savedInstanceState) {\r\n        super.onCreate(savedInstanceState);\r\n\r\n        \/\/This is the layout of our Front Page.\r\n        setContentView(R.layout.activity_main);\r\n\r\n        Objects.requireNonNull(getSupportActionBar()).hide();\r\n\r\n        \/\/These are the four buttons that we see in our front page.\r\n        \/\/Each button has it's own ID in the xml part of the program, so that\r\n        \/\/each button can be referred to and called easily.\r\n        donors = findViewById(R.id.recyclerviewbtn);\r\n        bloodgroup = findViewById(R.id.frequency);\r\n        organs = findViewById(R.id.groupList);\r\n        hospitals = findViewById(R.id.place);\r\n\r\n        \/\/On clicking the respective button we go to the respective pages.\r\n        donors.setOnClickListener(v -&gt; {\r\n            Intent i = new Intent(MainActivity.this, DonorList.class);\r\n            startActivity(i);\r\n            finish();\r\n        });\r\n\r\n        organs.setOnClickListener(view -&gt; {\r\n            Intent i = new Intent(MainActivity.this, Organs.class);\r\n            startActivity(i);\r\n            finish();\r\n        });\r\n\r\n        bloodgroup.setOnClickListener(view -&gt; {\r\n            Intent i = new Intent(MainActivity.this, GroupList.class);\r\n            startActivity(i);\r\n            finish();\r\n        });\r\n\r\n        hospitals.setOnClickListener(view -&gt; {\r\n            Intent i = new Intent(MainActivity.this, HospitalList.class);\r\n            startActivity(i);\r\n            finish();\r\n        });\r\n    }\r\n}<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/front-page-of-application.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-120602 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/front-page-of-application.webp\" alt=\"front page of application\" width=\"1920\" height=\"1024\" \/><\/a><\/p>\n<h4>Donor List:<\/h4>\n<p><strong>item.xml:<\/strong> This file contains the basic layout of the display list that we are going to use.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;androidx.cardview.widget.CardView xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n    xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\"\r\n    android:id=\"@+id\/cardView\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"wrap_content\"\r\n    android:layout_margin=\"8dp\"\r\n    app:cardCornerRadius=\"8dp\"\r\n    app:cardElevation=\"6dp\"&gt;\r\n\r\n    &lt;LinearLayout\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:orientation=\"vertical\"&gt;\r\n\r\n        &lt;LinearLayout\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"wrap_content\"\r\n            android:layout_marginVertical=\"5dp\"\r\n            android:weightSum=\"10\"\r\n            android:baselineAligned=\"false\"&gt;\r\n\r\n            &lt;LinearLayout\r\n                android:layout_width=\"0dp\"\r\n                android:layout_height=\"wrap_content\"\r\n                android:layout_marginLeft=\"16dp\"\r\n                android:layout_weight=\"8\"\r\n                android:orientation=\"vertical\"&gt;\r\n\r\n                &lt;LinearLayout\r\n                    android:layout_width=\"wrap_content\"\r\n                    android:layout_height=\"wrap_content\"\r\n                    android:layout_gravity=\"center_vertical\"\r\n                    android:orientation=\"horizontal\"&gt;\r\n\r\n                    &lt;TextView\r\n                        android:layout_width=\"wrap_content\"\r\n                        android:layout_height=\"wrap_content\"\r\n                        android:text=\"Name :\"\r\n                        android:textColor=\"@color\/black\"\r\n                        android:textSize=\"20sp\"\r\n                        android:textStyle=\"bold\" \/&gt;\r\n\r\n                    &lt;TextView\r\n                        android:id=\"@+id\/nameText\"\r\n                        android:layout_width=\"wrap_content\"\r\n                        android:layout_height=\"wrap_content\"\r\n                        android:layout_marginLeft=\"8dp\"\r\n                        android:text=\"Yashraj Kaflay\"\r\n                        android:textColor=\"@color\/black\"\r\n                        android:textSize=\"20sp\" \/&gt;\r\n\r\n                &lt;\/LinearLayout&gt;\r\n\r\n                &lt;LinearLayout\r\n                    android:layout_width=\"wrap_content\"\r\n                    android:layout_height=\"wrap_content\"\r\n                    android:layout_gravity=\"center_vertical\"\r\n                    android:orientation=\"horizontal\"&gt;\r\n\r\n                    &lt;TextView\r\n                        android:layout_width=\"wrap_content\"\r\n                        android:layout_height=\"wrap_content\"\r\n                        android:text=\"Address :\"\r\n                        android:textColor=\"@color\/black\"\r\n                        android:textSize=\"20sp\"\r\n                        android:textStyle=\"bold\" \/&gt;\r\n\r\n                    &lt;TextView\r\n                        android:id=\"@+id\/address\"\r\n                        android:layout_width=\"wrap_content\"\r\n                        android:layout_height=\"wrap_content\"\r\n                        android:layout_marginLeft=\"8dp\"\r\n                        android:text=\"Rangamati\"\r\n                        android:textColor=\"@color\/black\"\r\n                        android:textSize=\"20sp\" \/&gt;\r\n\r\n                &lt;\/LinearLayout&gt;\r\n\r\n                &lt;LinearLayout\r\n                    android:layout_width=\"wrap_content\"\r\n                    android:layout_height=\"wrap_content\"\r\n                    android:layout_gravity=\"center_vertical\"\r\n                    android:orientation=\"horizontal\"&gt;\r\n\r\n                    &lt;TextView\r\n                        android:layout_width=\"wrap_content\"\r\n                        android:layout_height=\"wrap_content\"\r\n                        android:text=\"Organ :\"\r\n                        android:textColor=\"@color\/black\"\r\n                        android:textSize=\"20sp\"\r\n                        android:textStyle=\"bold\" \/&gt;\r\n\r\n                    &lt;TextView\r\n                        android:id=\"@+id\/lastDonated\"\r\n                        android:layout_width=\"wrap_content\"\r\n                        android:layout_height=\"wrap_content\"\r\n                        android:layout_marginLeft=\"8dp\"\r\n                        android:text=\"Liver\"\r\n                        android:textColor=\"@color\/black\"\r\n                        android:textSize=\"20sp\" \/&gt;\r\n\r\n                &lt;\/LinearLayout&gt;\r\n\r\n                &lt;LinearLayout\r\n                    android:layout_width=\"wrap_content\"\r\n                    android:layout_height=\"wrap_content\"\r\n                    android:layout_gravity=\"center_vertical\"\r\n                    android:orientation=\"horizontal\"&gt;\r\n\r\n                    &lt;TextView\r\n                        android:layout_width=\"wrap_content\"\r\n                        android:layout_height=\"wrap_content\"\r\n                        android:text=\"Age :\"\r\n                        android:textColor=\"@color\/black\"\r\n                        android:textSize=\"20sp\"\r\n                        android:textStyle=\"bold\" \/&gt;\r\n\r\n                    &lt;TextView\r\n                        android:id=\"@+id\/tvage\"\r\n                        android:layout_width=\"wrap_content\"\r\n                        android:layout_height=\"wrap_content\"\r\n                        android:layout_marginLeft=\"8dp\"\r\n                        android:text=\"18\"\r\n                        android:textColor=\"@color\/black\"\r\n                        android:textSize=\"20sp\" \/&gt;\r\n\r\n                &lt;\/LinearLayout&gt;\r\n                &lt;LinearLayout\r\n                    android:layout_width=\"wrap_content\"\r\n                    android:layout_height=\"wrap_content\"\r\n                    android:layout_gravity=\"center_vertical\"\r\n                    android:orientation=\"horizontal\"&gt;\r\n\r\n                    &lt;TextView\r\n                        android:layout_width=\"wrap_content\"\r\n                        android:layout_height=\"wrap_content\"\r\n                        android:text=\"Hospital :\"\r\n                        android:textColor=\"@color\/black\"\r\n                        android:textSize=\"20sp\"\r\n                        android:textStyle=\"bold\" \/&gt;\r\n\r\n                    &lt;TextView\r\n                        android:id=\"@+id\/hospital\"\r\n                        android:layout_width=\"wrap_content\"\r\n                        android:layout_height=\"wrap_content\"\r\n                        android:layout_marginLeft=\"8dp\"\r\n                        android:text=\"St. Mary's\"\r\n                        android:textColor=\"@color\/black\"\r\n                        android:textSize=\"20sp\" \/&gt;\r\n\r\n                &lt;\/LinearLayout&gt;\r\n\r\n            &lt;\/LinearLayout&gt;\r\n\r\n            &lt;LinearLayout\r\n                android:layout_width=\"0dp\"\r\n                android:layout_height=\"match_parent\"\r\n                android:layout_weight=\"2\"&gt;\r\n\r\n                &lt;LinearLayout\r\n                    android:layout_width=\"match_parent\"\r\n                    android:layout_height=\"match_parent\"\r\n                    android:orientation=\"vertical\"\r\n                    android:weightSum=\"10\"&gt;\r\n\r\n                    &lt;LinearLayout\r\n                        android:layout_width=\"match_parent\"\r\n                        android:layout_height=\"0dp\"\r\n                        android:layout_weight=\"5\"&gt;\r\n\r\n                        &lt;TextView\r\n                            android:id=\"@+id\/bloodgroup\"\r\n                            android:layout_width=\"match_parent\"\r\n                            android:layout_height=\"match_parent\"\r\n                            android:gravity=\"center\"\r\n                            android:text=\"O+\"\r\n                            android:textColor=\"#FF0000\"\r\n                            android:textSize=\"25sp\"\r\n                            android:textStyle=\"bold\" \/&gt;\r\n                    &lt;\/LinearLayout&gt;\r\n\r\n                    &lt;LinearLayout\r\n                        android:layout_width=\"match_parent\"\r\n                        android:layout_height=\"0dp\"\r\n                        android:layout_weight=\"5\"&gt;\r\n\r\n                        &lt;ImageButton\r\n                            android:id=\"@+id\/phone\"\r\n                            android:layout_width=\"match_parent\"\r\n                            android:layout_height=\"40dp\"\r\n                            android:layout_gravity=\"center\"\r\n                            android:background=\"#fff\"\r\n                            android:src=\"@drawable\/phone\" \/&gt;\r\n\r\n                    &lt;\/LinearLayout&gt;\r\n\r\n                &lt;\/LinearLayout&gt;\r\n\r\n            &lt;\/LinearLayout&gt;\r\n\r\n        &lt;\/LinearLayout&gt;\r\n\r\n        &lt;LinearLayout\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"wrap_content\"\r\n            android:weightSum=\"2\"&gt;\r\n\r\n            &lt;LinearLayout\r\n                android:layout_width=\"0dp\"\r\n                android:layout_height=\"wrap_content\"\r\n                android:layout_gravity=\"center\"\r\n                android:layout_weight=\"1\"\r\n                android:gravity=\"center\"&gt;\r\n\r\n                &lt;Button\r\n                    android:id=\"@+id\/editButton\"\r\n                    android:layout_width=\"wrap_content\"\r\n                    android:layout_height=\"match_parent\"\r\n                    android:backgroundTint=\"#F44336\"\r\n                    android:gravity=\"center\"\r\n                    android:text=\"Edit\" \/&gt;\r\n            &lt;\/LinearLayout&gt;\r\n\r\n            &lt;LinearLayout\r\n                android:layout_width=\"0dp\"\r\n                android:layout_height=\"wrap_content\"\r\n                android:layout_gravity=\"center\"\r\n                android:layout_weight=\"1\"\r\n                android:gravity=\"center\"&gt;\r\n\r\n                &lt;Button\r\n                    android:id=\"@+id\/deleteButton\"\r\n                    android:layout_width=\"wrap_content\"\r\n                    android:layout_height=\"match_parent\"\r\n                    android:backgroundTint=\"#F44336\"\r\n                    android:gravity=\"center\"\r\n                    android:text=\"Delete\" \/&gt;\r\n            &lt;\/LinearLayout&gt;\r\n\r\n        &lt;\/LinearLayout&gt;\r\n\r\n    &lt;\/LinearLayout&gt;\r\n\r\n&lt;\/androidx.cardview.widget.CardView&gt;<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/donor-list.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-120603 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/donor-list.webp\" alt=\"donor list\" width=\"1920\" height=\"1000\" \/><\/a><\/p>\n<p><strong>activity_donor_list.xml:<\/strong> This is the part of the code that takes all the different items of the list and arranges them in proper list-like order.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n    xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\"\r\n    xmlns:tools=\"http:\/\/schemas.android.com\/tools\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"match_parent\"\r\n    tools:context=\".DonorList\"&gt;\r\n\r\n    &lt;androidx.recyclerview.widget.RecyclerView\r\n        android:id=\"@+id\/recview\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"match_parent\"\r\n        app:layout_constraintBottom_toBottomOf=\"parent\"\r\n        app:layout_constraintEnd_toEndOf=\"parent\"\r\n        app:layout_constraintHorizontal_bias=\"0.0\"\r\n        app:layout_constraintStart_toStartOf=\"parent\"\r\n        app:layout_constraintTop_toTopOf=\"parent\"\r\n        app:layout_constraintVertical_bias=\"0.0\" \/&gt;\r\n\r\n    &lt;com.google.android.material.floatingactionbutton.FloatingActionButton\r\n        android:id=\"@+id\/fadd\"\r\n        android:layout_width=\"wrap_content\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:clickable=\"true\"\r\n        app:layout_constraintBottom_toBottomOf=\"parent\"\r\n        app:layout_constraintEnd_toEndOf=\"parent\"\r\n        app:layout_constraintHorizontal_bias=\"0.884\"\r\n        app:layout_constraintStart_toStartOf=\"parent\"\r\n        app:layout_constraintTop_toTopOf=\"parent\"\r\n        app:layout_constraintVertical_bias=\"0.945\"\r\n        app:srcCompat=\"@drawable\/add\"\r\n        android:focusable=\"true\" \/&gt;\r\n\r\n&lt;\/androidx.constraintlayout.widget.ConstraintLayout&gt;<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/activity-donor-list-xml.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-120604 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/activity-donor-list-xml.webp\" alt=\"activity donor list xml\" width=\"1920\" height=\"1019\" \/><\/a><\/p>\n<p><strong>DonorList.java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">package\u00a0com.example.orgdon;\r\n\r\nimport android.annotation.SuppressLint;\r\nimport android.content.Intent;\r\nimport android.os.Bundle;\r\nimport android.view.Menu;\r\nimport android.view.MenuItem;\r\nimport android.widget.SearchView;\r\n\r\nimport androidx.annotation.NonNull;\r\nimport androidx.appcompat.app.AppCompatActivity;\r\nimport androidx.recyclerview.widget.LinearLayoutManager;\r\nimport androidx.recyclerview.widget.RecyclerView;\r\n\r\nimport com.firebase.ui.database.FirebaseRecyclerOptions;\r\nimport com.google.android.material.floatingactionbutton.FloatingActionButton;\r\nimport com.google.firebase.database.FirebaseDatabase;\r\n\r\nimport java.util.Objects;\r\n\r\n\/*\r\nThis is the 'Organ Donors' page of our program.\r\n*\/\r\n\r\npublic class DonorList extends AppCompatActivity {\r\n\r\n    RecyclerView recView;\r\n    MyAdapter adapter;\r\n    FloatingActionButton fb;\r\n\r\n    @Override\r\n    protected void onCreate(Bundle savedInstanceState) {\r\n        super.onCreate(savedInstanceState);\r\n        \/\/On creation of the page, the program calls the activity_donor_list.xml file\r\n        \/\/in the layout folder which is the layout of this page.\r\n        setContentView(R.layout.activity_donor_list);\r\n        setTitle(\"Search Donors\");\r\n\r\n        Objects.requireNonNull(getSupportActionBar()).setDisplayHomeAsUpEnabled(true);\r\n\r\n\r\n        \/\/This code allows the return arrow in the page, but it is not complete without\r\n        \/\/some action.\r\n        getSupportActionBar().setDisplayShowHomeEnabled(true);\r\n\r\n        \/\/We use this part of the code to generate the Card view of the donor list.\r\n        recView = findViewById(R.id.recview);\r\n        recView.setLayoutManager(new LinearLayoutManager(this));\r\n\r\n        \/\/ We fetch all Donors from Firebase\r\n        FirebaseRecyclerOptions&lt;model&gt; options =\r\n                new FirebaseRecyclerOptions.Builder&lt;model&gt;()\r\n                        .setQuery(FirebaseDatabase.getInstance().getReference().child(\"donors\"), model.class)\r\n                        .build();\r\n\r\n        adapter = new MyAdapter(options);\r\n        recView.setAdapter(adapter);\r\n\r\n        \/\/This part allows the '+' button at the bottom-right of the screen.\r\n        \/\/This allows us to add an entry to our database.\r\n        fb = findViewById(R.id.fadd);\r\n        fb.setOnClickListener(view -&gt; startActivity(new Intent(getApplicationContext(), AddDonor.class)));\r\n    }\r\n\r\n    \/\/ This is where we specify where will the program go if we press back.\r\n    \/\/ As you can see it goes back to the MainActivity page.\r\n    @Override\r\n    public void onBackPressed() {\r\n        Intent intent = new Intent(this, MainActivity.class);\r\n        startActivity(intent);\r\n    }\r\n\r\n    \/\/ This is the second part of the return arrow on the top left corner of the\r\n    \/\/ screen. This part of the code allows us to go back to the last page, which we\r\n    \/\/ have to specify(MainActivity)\r\n    @Override\r\n    public boolean onOptionsItemSelected(@NonNull MenuItem item) {\r\n        if (item.getItemId() == android.R.id.home) {\r\n            Intent intent = new Intent(this, MainActivity.class);\r\n            startActivity(intent);\r\n        }\r\n        return super.onOptionsItemSelected(item);\r\n    }\r\n\r\n    \/\/ If we have added some entry to our database, this notifies us that, either\r\n    \/\/ entering the data was successfull or not.\r\n    @SuppressLint(\"NotifyDataSetChanged\")\r\n    @Override\r\n    protected void onStart() {\r\n        super.onStart();\r\n        recView.getRecycledViewPool().clear();\r\n        adapter.startListening();\r\n        recView.getRecycledViewPool().clear();\r\n        adapter.notifyDataSetChanged();\r\n\r\n    }\r\n\r\n    @Override\r\n    protected void onStop() {\r\n        super.onStop();\r\n        adapter.stopListening();\r\n    }\r\n\r\n    \/\/ This part of the code helps us use the search button\r\n    @Override\r\n    public boolean onCreateOptionsMenu(Menu menu) {\r\n        getMenuInflater().inflate(R.menu.searchmenu, menu);\r\n        MenuItem item = menu.findItem(R.id.search);\r\n        SearchView searchView = (SearchView) item.getActionView();\r\n\r\n        searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {\r\n\r\n            \/\/ We take the string from the search bar and compare it our database entries\r\n            \/\/ based on some specific criteria.\r\n            @Override\r\n            public boolean onQueryTextSubmit(String s) {\r\n                processSearch(s.length() == 0 ? s : s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase());\r\n                return false;\r\n            }\r\n\r\n            @Override\r\n            public boolean onQueryTextChange(String s) {\r\n                processSearch(s.length() == 0 ? s : s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase());\r\n                return false;\r\n            }\r\n        });\r\n\r\n        return super.onCreateOptionsMenu(menu);\r\n    }\r\n\r\n    private void processSearch(String s) {\r\n        \/\/ This is where we specify the criteria to filter our database and display\r\n        \/\/ accordingly. In this case, we filter our search for donor according to\r\n        \/\/ their names.\r\n        FirebaseRecyclerOptions&lt;model&gt; options =\r\n                new FirebaseRecyclerOptions.Builder&lt;model&gt;()\r\n                        .setQuery(FirebaseDatabase.getInstance().getReference().child(\"donors\").orderByChild(\"name\").startAt(s).endAt(s + \"\\uf8ff\"), model.class)\r\n                        .build();\r\n\r\n        adapter = new MyAdapter(options);\r\n        adapter.startListening();\r\n        recView.setAdapter(adapter);\r\n    }\r\n\r\n\r\n}<\/pre>\n<p><strong>activity_add_donor.xml:<\/strong> The page to add donors to the list.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;androidx.appcompat.widget.LinearLayoutCompat xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n    xmlns:tools=\"http:\/\/schemas.android.com\/tools\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"match_parent\"\r\n    android:gravity=\"center_horizontal\"\r\n    android:orientation=\"vertical\"\r\n    tools:context=\".AddDonor\"&gt;\r\n\r\n    &lt;com.google.android.material.textfield.TextInputLayout\r\n        style=\"@style\/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_marginHorizontal=\"20dp\"\r\n        android:layout_marginTop=\"20dp\"&gt;\r\n\r\n        &lt;com.google.android.material.textfield.TextInputEditText\r\n            android:id=\"@+id\/addName\"\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"match_parent\"\r\n            android:hint=\"Name\" \/&gt;\r\n\r\n    &lt;\/com.google.android.material.textfield.TextInputLayout&gt;\r\n\r\n    &lt;com.google.android.material.textfield.TextInputLayout\r\n        style=\"@style\/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_marginHorizontal=\"20dp\"\r\n        android:layout_marginTop=\"20dp\"&gt;\r\n\r\n        &lt;com.google.android.material.textfield.TextInputEditText\r\n            android:id=\"@+id\/addAddress\"\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"match_parent\"\r\n            android:hint=\"Address\" \/&gt;\r\n\r\n    &lt;\/com.google.android.material.textfield.TextInputLayout&gt;\r\n\r\n    &lt;com.google.android.material.textfield.TextInputLayout\r\n        style=\"@style\/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_marginHorizontal=\"20dp\"\r\n        android:layout_marginTop=\"20dp\"&gt;\r\n\r\n        &lt;com.google.android.material.textfield.TextInputEditText\r\n            android:id=\"@+id\/addDonated\"\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"match_parent\"\r\n            android:hint=\"Organ Donated\" \/&gt;\r\n\r\n    &lt;\/com.google.android.material.textfield.TextInputLayout&gt;\r\n\r\n    &lt;com.google.android.material.textfield.TextInputLayout\r\n        style=\"@style\/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_marginHorizontal=\"20dp\"\r\n        android:layout_marginTop=\"20dp\"&gt;\r\n\r\n        &lt;com.google.android.material.textfield.TextInputEditText\r\n            android:id=\"@+id\/addAge\"\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"match_parent\"\r\n            android:hint=\"Age\" \/&gt;\r\n\r\n    &lt;\/com.google.android.material.textfield.TextInputLayout&gt;\r\n\r\n    &lt;com.google.android.material.textfield.TextInputLayout\r\n        style=\"@style\/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_marginHorizontal=\"20dp\"\r\n        android:layout_marginTop=\"20dp\"&gt;\r\n\r\n        &lt;com.google.android.material.textfield.TextInputEditText\r\n            android:id=\"@+id\/addBlood\"\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"match_parent\"\r\n            android:hint=\"Blood Group\" \/&gt;\r\n\r\n    &lt;\/com.google.android.material.textfield.TextInputLayout&gt;\r\n\r\n    &lt;com.google.android.material.textfield.TextInputLayout\r\n        style=\"@style\/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_marginHorizontal=\"20dp\"\r\n        android:layout_marginTop=\"20dp\"\r\n        android:layout_marginBottom=\"30dp\"&gt;\r\n\r\n        &lt;com.google.android.material.textfield.TextInputEditText\r\n            android:id=\"@+id\/addPhone\"\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"match_parent\"\r\n            android:hint=\"Phone\" \/&gt;\r\n\r\n    &lt;\/com.google.android.material.textfield.TextInputLayout&gt;\r\n\r\n    &lt;com.google.android.material.textfield.TextInputLayout\r\n        style=\"@style\/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_marginHorizontal=\"20dp\"\r\n        android:layout_marginBottom=\"30dp\"&gt;\r\n\r\n        &lt;com.google.android.material.textfield.TextInputEditText\r\n            android:id=\"@+id\/addHospital\"\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"match_parent\"\r\n            android:hint=\"Hospital\" \/&gt;\r\n\r\n    &lt;\/com.google.android.material.textfield.TextInputLayout&gt;\r\n\r\n    &lt;Button\r\n        android:id=\"@+id\/add_submit\"\r\n        android:layout_width=\"wrap_content\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_marginBottom=\"15dp\"\r\n        android:text=\"Add to Database\"\r\n        android:textSize=\"20sp\" \/&gt;\r\n\r\n    &lt;Button\r\n        android:id=\"@+id\/add_back\"\r\n        android:layout_width=\"wrap_content\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:text=\"Back\"\r\n        android:textSize=\"20sp\" \/&gt;\r\n\r\n&lt;\/androidx.appcompat.widget.LinearLayoutCompat&gt;<\/pre>\n<p><strong>AddDonor.java:<\/strong><\/p>\n<p>package com.example.orgdon;<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import android.content.Intent;\r\nimport android.os.Bundle;\r\nimport android.widget.Button;\r\nimport android.widget.EditText;\r\nimport android.widget.Toast;\r\n\r\nimport androidx.appcompat.app.AppCompatActivity;\r\n\r\nimport com.google.firebase.database.FirebaseDatabase;\r\n\r\nimport java.util.HashMap;\r\nimport java.util.Map;\r\n\r\n\/\/ This is the Add Donor page which we get on pressing the '+' button on the\r\n\/\/ Organ Donor List Page.\r\npublic class AddDonor extends AppCompatActivity {\r\n\r\n    \/\/ Here, we specify the  different Text fields and buttons we are using in the page.\r\n    EditText name, address, donated, age, blood, phone, hospital;\r\n    Button submit, back;\r\n\r\n    @Override\r\n    protected void onCreate(Bundle savedInstanceState) {\r\n        super.onCreate(savedInstanceState);\r\n        setContentView(R.layout.activity_add_donor);\r\n\r\n        name = findViewById(R.id.addName);\r\n        address = findViewById(R.id.addAddress);\r\n        donated = findViewById(R.id.addDonated);\r\n        age = findViewById(R.id.addAge);\r\n        blood = findViewById(R.id.addBlood);\r\n        phone = findViewById(R.id.addPhone);\r\n        hospital = findViewById(R.id.addHospital);\r\n\r\n        back = findViewById(R.id.add_back);\r\n        back.setOnClickListener(view -&gt; {\r\n            Intent intent = new Intent(getApplicationContext(), DonorList.class);\r\n            startActivity(intent);\r\n        });\r\n\r\n        submit = findViewById(R.id.add_submit);\r\n        submit.setOnClickListener(view -&gt; processInsert());\r\n    }\r\n\r\n    @Override\r\n    public void onBackPressed() {\r\n        Intent intent = new Intent(this, DonorList.class);\r\n        startActivity(intent);\r\n    }\r\n\r\n    \/\/ This part of the code gets the text from the Text fields and then\r\n    \/\/ inserts those values into a Firebase database.\r\n    private void processInsert() {\r\n        Map&lt;String, Object&gt; map = new HashMap&lt;&gt;();\r\n        map.put(\"name\", name.getText().toString());\r\n        map.put(\"address\", address.getText().toString());\r\n        map.put(\"donated\", donated.getText().toString());\r\n        map.put(\"age\", age.getText().toString());\r\n        map.put(\"blood\", blood.getText().toString());\r\n        map.put(\"phone\", phone.getText().toString());\r\n        map.put(\"hospital\", hospital.getText().toString());\r\n\r\n        \/\/ Add Donors to Firebase Database\r\n        FirebaseDatabase.getInstance().getReference().child(\"donors\").push()\r\n                .setValue(map)\r\n                .addOnSuccessListener(aVoid -&gt; {\r\n                    name.setText(\"\");\r\n                    address.setText(\"\");\r\n                    donated.setText(\"\");\r\n                    age.setText(\"\");\r\n                    blood.setText(\"\");\r\n                    phone.setText(\"\");\r\n                    hospital.setText(\"\");\r\n                    Toast.makeText(getApplicationContext(), \"Added Successfully\", Toast.LENGTH_LONG).show();\r\n                    startActivity(new Intent(getApplicationContext(), DonorList.class));\r\n                })\r\n                .addOnFailureListener(e -&gt; Toast.makeText(getApplicationContext(), \"Could not Added\", Toast.LENGTH_LONG).show());\r\n\r\n    }\r\n}<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/donor-list-java.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-120605 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/donor-list-java.webp\" alt=\"donor list java\" width=\"1920\" height=\"1004\" \/><\/a><\/p>\n<p><strong>dialogcontent.xml:<\/strong> This file is used to update any of the records of the list.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;LinearLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"match_parent\"\r\n    android:orientation=\"vertical\"&gt;\r\n\r\n    &lt;TextView\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"50dp\"\r\n        android:background=\"#F44336\"\r\n        android:gravity=\"center\"\r\n        android:text=\"Update Donors Data\"\r\n        android:textColor=\"#fff\"\r\n        android:textSize=\"25sp\" \/&gt;\r\n\r\n    &lt;com.google.android.material.textfield.TextInputLayout\r\n        style=\"@style\/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_marginHorizontal=\"20dp\"\r\n        android:layout_marginTop=\"20dp\"&gt;\r\n\r\n        &lt;com.google.android.material.textfield.TextInputEditText\r\n            android:id=\"@+id\/nameEdit\"\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"match_parent\"\r\n            android:hint=\"Name\" \/&gt;\r\n\r\n    &lt;\/com.google.android.material.textfield.TextInputLayout&gt;\r\n\r\n    &lt;com.google.android.material.textfield.TextInputLayout\r\n        style=\"@style\/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_marginHorizontal=\"20dp\"\r\n        android:layout_marginTop=\"20dp\"&gt;\r\n\r\n        &lt;com.google.android.material.textfield.TextInputEditText\r\n            android:id=\"@+id\/addressEdit\"\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"match_parent\"\r\n            android:hint=\"Address\" \/&gt;\r\n\r\n    &lt;\/com.google.android.material.textfield.TextInputLayout&gt;\r\n\r\n    &lt;com.google.android.material.textfield.TextInputLayout\r\n        style=\"@style\/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_marginHorizontal=\"20dp\"\r\n        android:layout_marginTop=\"20dp\"&gt;\r\n\r\n        &lt;com.google.android.material.textfield.TextInputEditText\r\n            android:id=\"@+id\/donatedEdit\"\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"match_parent\"\r\n            android:hint=\"Organ\" \/&gt;\r\n\r\n    &lt;\/com.google.android.material.textfield.TextInputLayout&gt;\r\n\r\n    &lt;com.google.android.material.textfield.TextInputLayout\r\n        style=\"@style\/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_marginHorizontal=\"20dp\"\r\n        android:layout_marginTop=\"20dp\"&gt;\r\n\r\n        &lt;com.google.android.material.textfield.TextInputEditText\r\n            android:id=\"@+id\/ageEdit\"\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"match_parent\"\r\n            android:hint=\"Age\" \/&gt;\r\n\r\n    &lt;\/com.google.android.material.textfield.TextInputLayout&gt;\r\n\r\n    &lt;com.google.android.material.textfield.TextInputLayout\r\n        style=\"@style\/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_marginHorizontal=\"20dp\"\r\n        android:layout_marginTop=\"20dp\"&gt;\r\n\r\n        &lt;com.google.android.material.textfield.TextInputEditText\r\n            android:id=\"@+id\/bloodEdit\"\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"match_parent\"\r\n            android:hint=\"Blood Group\" \/&gt;\r\n\r\n    &lt;\/com.google.android.material.textfield.TextInputLayout&gt;\r\n\r\n    &lt;com.google.android.material.textfield.TextInputLayout\r\n        style=\"@style\/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_marginHorizontal=\"20dp\"\r\n        android:layout_marginTop=\"20dp\"&gt;\r\n\r\n        &lt;com.google.android.material.textfield.TextInputEditText\r\n            android:id=\"@+id\/phoneEdit\"\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"match_parent\"\r\n            android:hint=\"Phone\" \/&gt;\r\n\r\n    &lt;\/com.google.android.material.textfield.TextInputLayout&gt;\r\n\r\n    &lt;com.google.android.material.textfield.TextInputLayout\r\n        style=\"@style\/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_marginHorizontal=\"20dp\"\r\n        android:layout_marginTop=\"20dp\"&gt;\r\n\r\n        &lt;com.google.android.material.textfield.TextInputEditText\r\n            android:id=\"@+id\/hospitalEdit\"\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"match_parent\"\r\n            android:hint=\"Hospital\" \/&gt;\r\n\r\n    &lt;\/com.google.android.material.textfield.TextInputLayout&gt;\r\n\r\n    &lt;Button\r\n        android:id=\"@+id\/usubmit\"\r\n        android:layout_width=\"300dp\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_gravity=\"center\"\r\n        android:layout_marginTop=\"15dp\"\r\n        android:layout_marginBottom=\"10dp\"\r\n        android:background=\"#009688\"\r\n        android:text=\"Update\"\r\n        android:textColor=\"#fff\"\r\n        android:textSize=\"20sp\" \/&gt;\r\n\r\n&lt;\/LinearLayout&gt;<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/diagonal-content.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-120606 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/diagonal-content.webp\" alt=\"diagonal content\" width=\"1920\" height=\"1024\" \/><\/a><\/p>\n<p><strong>MyAdapter.java:<\/strong><\/p>\n<p>package com.example.orgdon;<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import android.annotation.SuppressLint;\r\nimport android.app.AlertDialog;\r\nimport android.content.Intent;\r\nimport android.net.Uri;\r\nimport android.view.LayoutInflater;\r\nimport android.view.View;\r\nimport android.view.ViewGroup;\r\nimport android.widget.Button;\r\nimport android.widget.ImageButton;\r\nimport android.widget.TextView;\r\n\r\nimport androidx.annotation.NonNull;\r\nimport androidx.recyclerview.widget.RecyclerView;\r\n\r\nimport com.firebase.ui.database.FirebaseRecyclerAdapter;\r\nimport com.firebase.ui.database.FirebaseRecyclerOptions;\r\nimport com.google.android.material.textfield.TextInputEditText;\r\nimport com.google.firebase.database.FirebaseDatabase;\r\nimport com.orhanobut.dialogplus.DialogPlus;\r\nimport com.orhanobut.dialogplus.ViewHolder;\r\n\r\nimport java.util.HashMap;\r\nimport java.util.Map;\r\nimport java.util.Objects;\r\n\r\n\/\/ This is an important class which helps us do a lot of things in our project.\r\n\r\npublic class MyAdapter extends FirebaseRecyclerAdapter&lt;model, MyAdapter.myViewHolder&gt; {\r\n    public MyAdapter(@NonNull FirebaseRecyclerOptions&lt;model&gt; options) {\r\n        super(options);\r\n    }\r\n\r\n\r\n    @Override\r\n    protected void onBindViewHolder(@NonNull final myViewHolder holder, @SuppressLint(\"RecyclerView\") final int position, @NonNull final model model) {\r\n        holder.name.setText(model.getName());\r\n        holder.address.setText(model.getAddress());\r\n        holder.donated.setText(model.getDonated());\r\n        holder.age.setText(model.getAge());\r\n        holder.blood.setText(model.getBlood());\r\n        holder.hospital.setText(model.getHospital());\r\n\r\n\r\n        \/\/ This part of the code is for when the call button is pressed when viewing the\r\n        \/\/ list. This code takes the user to the phone application.\r\n        holder.call.setOnClickListener(v -&gt; {\r\n            String call = model.getPhone();\r\n            String s = \"tel:\" + call;\r\n            Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse(s));\r\n            v.getContext().startActivity(intent);\r\n\r\n        });\r\n\r\n        \/\/ This is the layout that is shown on pressing the edit button.\r\n        holder.edit.setOnClickListener(view -&gt; {\r\n            final DialogPlus dialogPlus = DialogPlus.newDialog(holder.name.getContext())\r\n                    .setContentHolder(new ViewHolder(R.layout.dialogcontent))\r\n                    .setExpanded(true, 2400)\r\n                    .create();\r\n\r\n            \/\/ If we want to update our database we click on the entry and press edit.\r\n            \/\/ On pressing Edit, this part of our program get invoked. This next code rewrites\r\n            \/\/ the values into the Text fields.\r\n\r\n            View myView = dialogPlus.getHolderView();\r\n            final TextInputEditText name = myView.findViewById(R.id.nameEdit);\r\n            final TextInputEditText address = myView.findViewById(R.id.addressEdit);\r\n            final TextInputEditText donated = myView.findViewById(R.id.donatedEdit);\r\n            final TextInputEditText age = myView.findViewById(R.id.ageEdit);\r\n            final TextInputEditText blood = myView.findViewById(R.id.bloodEdit);\r\n            final TextInputEditText phone = myView.findViewById(R.id.phoneEdit);\r\n            final TextInputEditText hospital = myView.findViewById(R.id.hospitalEdit);\r\n            Button submit = myView.findViewById(R.id.usubmit);\r\n\r\n            name.setText(model.getName());\r\n            address.setText(model.getAddress());\r\n            donated.setText(model.getDonated());\r\n            age.setText(model.getAge());\r\n            blood.setText(model.getBlood());\r\n            phone.setText(model.getPhone());\r\n            hospital.setText(model.getHospital());\r\n\r\n            dialogPlus.show();\r\n\r\n            \/\/ Pressing the submit button then updates the data to the Firebase database.\r\n\r\n            submit.setOnClickListener(view1 -&gt; {\r\n                Map&lt;String, Object&gt; map = new HashMap&lt;&gt;();\r\n                map.put(\"name\", Objects.requireNonNull(name.getText()).toString());\r\n                map.put(\"address\", Objects.requireNonNull(address.getText()).toString());\r\n                map.put(\"donated\", Objects.requireNonNull(donated.getText()).toString());\r\n                map.put(\"age\", Objects.requireNonNull(age.getText()).toString());\r\n                map.put(\"blood\", Objects.requireNonNull(blood.getText()).toString());\r\n                map.put(\"phone\", Objects.requireNonNull(phone.getText()).toString());\r\n                map.put(\"hospital\", Objects.requireNonNull(hospital.getText()).toString());\r\n\r\n                FirebaseDatabase.getInstance().getReference().child(\"donors\")\r\n                        .child(Objects.requireNonNull(getRef(position).getKey())).updateChildren(map)\r\n                        .addOnSuccessListener(aVoid -&gt; dialogPlus.dismiss())\r\n                        .addOnFailureListener(e -&gt; dialogPlus.dismiss());\r\n            });\r\n\r\n        });\r\n\r\n        \/\/ This is the Delete button that is present beside the Edit button.\r\n\r\n        holder.delete.setOnClickListener(view -&gt; {\r\n            AlertDialog.Builder builder = new AlertDialog.Builder(holder.name.getContext());\r\n            builder.setTitle(\"Delete Donors?\");\r\n            builder.setMessage(\"Are you sure?\");\r\n\r\n            builder.setPositiveButton(\"Yes\", (dialogInterface, i) -&gt; FirebaseDatabase.getInstance().getReference().child(\"donors\")\r\n                    .child(Objects.requireNonNull(getRef(position).getKey())).removeValue());\r\n\r\n            builder.setNegativeButton(\"No\", (dialogInterface, i) -&gt; {\r\n\r\n            });\r\n\r\n            builder.show();\r\n        });\r\n\r\n    }\r\n\r\n\r\n    \/\/ This part of the code is used to create the specific card view layout of the\r\n    \/\/ donor's list that we view.\r\n    @NonNull\r\n    @Override\r\n    public myViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {\r\n        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item, parent, false);\r\n        return new myViewHolder(view);\r\n    }\r\n\r\n    static class myViewHolder extends RecyclerView.ViewHolder {\r\n\r\n        final Button edit;\r\n        final Button delete;\r\n        final ImageButton call;\r\n        final TextView name;\r\n        final TextView address;\r\n        final TextView donated;\r\n        final TextView age;\r\n        final TextView blood;\r\n\r\n        final TextView hospital;\r\n\r\n        public myViewHolder(@NonNull View itemView) {\r\n            super(itemView);\r\n            name = itemView.findViewById(R.id.nameText);\r\n            address = itemView.findViewById(R.id.address);\r\n            donated = itemView.findViewById(R.id.lastDonated);\r\n            age = itemView.findViewById(R.id.tvage);\r\n            blood = itemView.findViewById(R.id.bloodgroup);\r\n            hospital = itemView.findViewById(R.id.hospital);\r\n            call = itemView.findViewById(R.id.phone);\r\n            edit = itemView.findViewById(R.id.editButton);\r\n            delete = itemView.findViewById(R.id.deleteButton);\r\n        }\r\n    }\r\n}<\/pre>\n<h4>OfflineFirebase.java:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">package com.example.orgdon;\r\n\r\nimport android.app.Application;\r\n\r\nimport com.google.firebase.database.FirebaseDatabase;\r\n\r\n\/\/This class is to initialize our firebase database\r\npublic class OfflineFirebase extends Application {\r\n\r\n    @Override\r\n    public void onCreate() {\r\n        super.onCreate();\r\n\r\n        \/\/Extra COde\r\n        FirebaseDatabase.getInstance().setPersistenceEnabled(true);\r\n    }\r\n}<\/pre>\n<h4>Blood List:<\/h4>\n<p><strong>activity_group_list.xml:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;LinearLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n    xmlns:tools=\"http:\/\/schemas.android.com\/tools\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"match_parent\"\r\n    android:orientation=\"horizontal\"\r\n    tools:context=\".GroupList\"&gt;\r\n\r\n    &lt;LinearLayout\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:gravity=\"center\"\r\n        android:orientation=\"vertical\"&gt;\r\n\r\n        &lt;ImageView\r\n            android:layout_width=\"wrap_content\"\r\n            android:layout_height=\"100dp\"\r\n            android:layout_marginTop=\"30dp\"\r\n            android:src=\"@drawable\/logo\" \/&gt;\r\n\r\n        &lt;TextView\r\n            android:id=\"@+id\/textView2\"\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"wrap_content\"\r\n            android:gravity=\"center\"\r\n            android:paddingBottom=\"10dp\"\r\n            android:text=\"Blood Group\"\r\n            android:textColor=\"@color\/black\"\r\n            android:textSize=\"25sp\"\r\n            android:textStyle=\"bold\" \/&gt;\r\n\r\n        &lt;LinearLayout\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"wrap_content\"\r\n            android:layout_marginTop=\"30dp\"\r\n            android:weightSum=\"2\"&gt;\r\n\r\n            &lt;LinearLayout\r\n                android:layout_width=\"0dp\"\r\n                android:layout_height=\"wrap_content\"\r\n                android:layout_gravity=\"center\"\r\n                android:layout_marginHorizontal=\"30dp\"\r\n                android:layout_weight=\"1\"\r\n                android:gravity=\"center\"&gt;\r\n\r\n                &lt;Button\r\n                    android:id=\"@+id\/aPositive\"\r\n                    android:layout_width=\"match_parent\"\r\n                    android:layout_height=\"100dp\"\r\n                    android:backgroundTint=\"#F44336\"\r\n                    android:gravity=\"center\"\r\n                    android:text=\"A+\" \/&gt;\r\n            &lt;\/LinearLayout&gt;\r\n\r\n            &lt;LinearLayout\r\n                android:layout_width=\"0dp\"\r\n                android:layout_height=\"wrap_content\"\r\n                android:layout_gravity=\"center\"\r\n                android:layout_marginHorizontal=\"30dp\"\r\n                android:layout_weight=\"1\"\r\n                android:gravity=\"center\"&gt;\r\n\r\n                &lt;Button\r\n                    android:id=\"@+id\/aNegative\"\r\n                    android:layout_width=\"match_parent\"\r\n                    android:layout_height=\"100dp\"\r\n                    android:backgroundTint=\"#F44336\"\r\n                    android:gravity=\"center\"\r\n                    android:text=\"A-\" \/&gt;\r\n            &lt;\/LinearLayout&gt;\r\n        &lt;\/LinearLayout&gt;\r\n\r\n        &lt;LinearLayout\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"wrap_content\"\r\n            android:weightSum=\"2\"&gt;\r\n\r\n            &lt;LinearLayout\r\n                android:layout_width=\"0dp\"\r\n                android:layout_height=\"wrap_content\"\r\n                android:layout_gravity=\"center\"\r\n                android:layout_marginHorizontal=\"30dp\"\r\n                android:layout_weight=\"1\"\r\n                android:gravity=\"center\"&gt;\r\n\r\n                &lt;Button\r\n                    android:id=\"@+id\/bPositive\"\r\n                    android:layout_width=\"match_parent\"\r\n                    android:layout_height=\"100dp\"\r\n                    android:backgroundTint=\"#F44336\"\r\n                    android:gravity=\"center\"\r\n                    android:text=\"B+\" \/&gt;\r\n            &lt;\/LinearLayout&gt;\r\n\r\n            &lt;LinearLayout\r\n                android:layout_width=\"0dp\"\r\n                android:layout_height=\"wrap_content\"\r\n                android:layout_gravity=\"center\"\r\n                android:layout_marginHorizontal=\"30dp\"\r\n                android:layout_weight=\"1\"\r\n                android:gravity=\"center\"&gt;\r\n\r\n                &lt;Button\r\n                    android:id=\"@+id\/bNegative\"\r\n                    android:layout_width=\"match_parent\"\r\n                    android:layout_height=\"100dp\"\r\n                    android:backgroundTint=\"#F44336\"\r\n                    android:gravity=\"center\"\r\n                    android:text=\"B-\" \/&gt;\r\n            &lt;\/LinearLayout&gt;\r\n        &lt;\/LinearLayout&gt;\r\n\r\n        &lt;LinearLayout\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"wrap_content\"\r\n            android:weightSum=\"2\"&gt;\r\n\r\n            &lt;LinearLayout\r\n                android:layout_width=\"0dp\"\r\n                android:layout_height=\"wrap_content\"\r\n                android:layout_gravity=\"center\"\r\n                android:layout_marginHorizontal=\"30dp\"\r\n                android:layout_weight=\"1\"\r\n                android:gravity=\"center\"&gt;\r\n\r\n                &lt;Button\r\n                    android:id=\"@+id\/abPositive\"\r\n                    android:layout_width=\"match_parent\"\r\n                    android:layout_height=\"100dp\"\r\n                    android:backgroundTint=\"#F44336\"\r\n                    android:gravity=\"center\"\r\n                    android:text=\"AB+\" \/&gt;\r\n            &lt;\/LinearLayout&gt;\r\n\r\n            &lt;LinearLayout\r\n                android:layout_width=\"0dp\"\r\n                android:layout_height=\"wrap_content\"\r\n                android:layout_gravity=\"center\"\r\n                android:layout_marginHorizontal=\"30dp\"\r\n                android:layout_weight=\"1\"\r\n                android:gravity=\"center\"&gt;\r\n\r\n                &lt;Button\r\n                    android:id=\"@+id\/abNegative\"\r\n                    android:layout_width=\"match_parent\"\r\n                    android:layout_height=\"100dp\"\r\n                    android:backgroundTint=\"#F44336\"\r\n                    android:gravity=\"center\"\r\n                    android:text=\"AB-\" \/&gt;\r\n            &lt;\/LinearLayout&gt;\r\n        &lt;\/LinearLayout&gt;\r\n\r\n        &lt;LinearLayout\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"wrap_content\"\r\n            android:weightSum=\"2\"&gt;\r\n\r\n            &lt;LinearLayout\r\n                android:layout_width=\"0dp\"\r\n                android:layout_height=\"wrap_content\"\r\n                android:layout_gravity=\"center\"\r\n                android:layout_marginHorizontal=\"30dp\"\r\n                android:layout_weight=\"1\"\r\n                android:gravity=\"center\"&gt;\r\n\r\n                &lt;Button\r\n                    android:id=\"@+id\/oPositive\"\r\n                    android:layout_width=\"match_parent\"\r\n                    android:layout_height=\"100dp\"\r\n                    android:backgroundTint=\"#F44336\"\r\n                    android:gravity=\"center\"\r\n                    android:text=\"O+\" \/&gt;\r\n            &lt;\/LinearLayout&gt;\r\n\r\n            &lt;LinearLayout\r\n                android:layout_width=\"0dp\"\r\n                android:layout_height=\"wrap_content\"\r\n                android:layout_gravity=\"center\"\r\n                android:layout_marginHorizontal=\"30dp\"\r\n                android:layout_weight=\"1\"\r\n                android:gravity=\"center\"&gt;\r\n\r\n                &lt;Button\r\n                    android:id=\"@+id\/oNegative\"\r\n                    android:layout_width=\"match_parent\"\r\n                    android:layout_height=\"100dp\"\r\n                    android:backgroundTint=\"#F44336\"\r\n                    android:gravity=\"center\"\r\n                    android:text=\"O-\" \/&gt;\r\n            &lt;\/LinearLayout&gt;\r\n        &lt;\/LinearLayout&gt;\r\n    &lt;\/LinearLayout&gt;\r\n&lt;\/LinearLayout&gt;<\/pre>\n<p><strong>GroupList.java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">package com.example.orgdon;\r\n\r\nimport android.content.Intent;\r\nimport android.os.Bundle;\r\nimport android.widget.Button;\r\n\r\nimport androidx.appcompat.app.AppCompatActivity;\r\n\r\n\/\/This is the Blood Group List page.\r\n\r\npublic class GroupList extends AppCompatActivity {\r\n\r\n    \/\/The button of the page are specified here and the layout of the page is called below.\r\n    Button aPositive, aNegative, bPositive, bNegative, abPositive, abNegative, oPositive, oNegative;\r\n\r\n    @Override\r\n    protected void onCreate(Bundle savedInstanceState) {\r\n        super.onCreate(savedInstanceState);\r\n        setContentView(R.layout.activity_group_list);\r\n\r\n        aPositive = findViewById(R.id.aPositive);\r\n        aNegative = findViewById(R.id.aNegative);\r\n        bPositive = findViewById(R.id.bPositive);\r\n        bNegative = findViewById(R.id.bNegative);\r\n        abPositive = findViewById(R.id.abPositive);\r\n        abNegative = findViewById(R.id.abNegative);\r\n        oPositive = findViewById(R.id.oPositive);\r\n        oNegative = findViewById(R.id.oNegative);\r\n\r\n\r\n        \/\/Each button on being clicked goes to it's respective page.\r\n\r\n        aPositive.setOnClickListener(view -&gt; {\r\n            Intent i = new Intent(GroupList.this, APositive.class);\r\n            startActivity(i);\r\n        });\r\n\r\n        aNegative.setOnClickListener(view -&gt; {\r\n            Intent i = new Intent(GroupList.this, ANegative.class);\r\n            startActivity(i);\r\n        });\r\n\r\n        bPositive.setOnClickListener(view -&gt; {\r\n            Intent i = new Intent(GroupList.this, BPositive.class);\r\n            startActivity(i);\r\n        });\r\n\r\n        bNegative.setOnClickListener(view -&gt; {\r\n            Intent i = new Intent(GroupList.this, BNegative.class);\r\n            startActivity(i);\r\n        });\r\n\r\n        abPositive.setOnClickListener(view -&gt; {\r\n            Intent i = new Intent(GroupList.this, ABPositive.class);\r\n            startActivity(i);\r\n        });\r\n\r\n        abNegative.setOnClickListener(view -&gt; {\r\n            Intent i = new Intent(GroupList.this, ABNegative.class);\r\n            startActivity(i);\r\n        });\r\n\r\n        oPositive.setOnClickListener(view -&gt; {\r\n            Intent i = new Intent(GroupList.this, OPositive.class);\r\n            startActivity(i);\r\n        });\r\n\r\n        oNegative.setOnClickListener(view -&gt; {\r\n            Intent i = new Intent(GroupList.this, com.example.orgdon.ONegative.class);\r\n            startActivity(i);\r\n        });\r\n    }\r\n\r\n    @Override\r\n    public void onBackPressed() {\r\n        Intent intent = new Intent(this, MainActivity.class);\r\n        startActivity(intent);\r\n    }\r\n}<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/organ-donation-app.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-120607 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/organ-donation-app.webp\" alt=\"organ donation app\" width=\"1920\" height=\"1020\" \/><\/a><\/p>\n<p><strong>8.<\/strong> Press the run button at the top bar; it will install the application on a virtual device.<br \/>\n<strong>9.<\/strong> Test if the application runs correctly.<br \/>\n<strong>10.<\/strong> Customise to your taste.<\/p>\n<h3>Android Organ Donation App Output:<\/h3>\n<p><strong>The application should look like this:<\/strong><\/p>\n<p><strong>This is the home page.<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/organ-donation-home-page.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-120608 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/organ-donation-home-page.webp\" alt=\"organ donation home page\" width=\"400\" height=\"823\" \/><\/a><\/p>\n<p><strong>We get this on opening the \u201cOrgan Donors\u201d button.<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/organ-donors-button.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-120609 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/organ-donors-button.webp\" alt=\"organ donors button\" width=\"400\" height=\"823\" \/><\/a><\/p>\n<p><strong>This is how we \u201cAdd\u201d and \u201cEdit\u201d our list.<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/organ-donation-add-and-edit-button.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-120610 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/organ-donation-add-and-edit-button.webp\" alt=\"organ donation add and edit button\" width=\"800\" height=\"800\" \/><\/a><\/p>\n<p><strong>This is what we get on pressing \u201cBy Blood Group\u201d and \u201cOrgans\u201d respectively.<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/organ-donation-blood-group-and-organ.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-120611 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/organ-donation-blood-group-and-organ.webp\" alt=\"organ donation blood group and organ\" width=\"800\" height=\"802\" \/><\/a><\/p>\n<p><strong>This is what we get on pressing hospitals and searching for anything specific in hospitals search bar.<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/organ-donation-app-output.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-120612 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/organ-donation-app-output.webp\" alt=\"organ donation app output\" width=\"800\" height=\"802\" \/><\/a><\/p>\n<h3>Summary:<\/h3>\n<p>This guide explores the development of an Android organ donation app, highlighting the importance of organ donation and providing step-by-step instructions for implementing the app using Android Studio. By leveraging multiple classes, users can register as donors, access information, find donation centres, and connect with recipients.<\/p>\n<p>Through the power of technology, this app aims to increase awareness and participation in organ donation, ultimately saving lives and fostering a healthier future for all. Hope you found this guide insightful. Thank you for reading!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Welcome! In this project, we will try to create an Android application for organ donation tracking using Android Studio. Join us as we dive into the world of Android app development and work towards&#46;&#46;&#46;<\/p>\n","protected":false},"author":581,"featured_media":120613,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18722],"tags":[28290,28292,22513,22507,28294,28293,28291],"class_list":["post-115656","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android","tag-android-organ-donation-app","tag-android-organ-donation-app-project","tag-android-project-ideas","tag-android-projects","tag-android-projects-for-practice","tag-organ-donation-app","tag-organ-donation-project"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Android Project \u2013 Organ Donation App - DataFlair<\/title>\n<meta name=\"description\" content=\"Through this Android Organ Donation app, users can access vital information about organ donation, find local organ donation centres.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/android-organ-donation-app\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android Project \u2013 Organ Donation App - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Through this Android Organ Donation app, users can access vital information about organ donation, find local organ donation centres.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/android-organ-donation-app\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-09T13:30:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-06-01T08:48:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/android-organ-donation-app-2.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Android Project \u2013 Organ Donation App - DataFlair","description":"Through this Android Organ Donation app, users can access vital information about organ donation, find local organ donation centres.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/android-organ-donation-app\/","og_locale":"en_US","og_type":"article","og_title":"Android Project \u2013 Organ Donation App - DataFlair","og_description":"Through this Android Organ Donation app, users can access vital information about organ donation, find local organ donation centres.","og_url":"https:\/\/data-flair.training\/blogs\/android-organ-donation-app\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2023-10-09T13:30:11+00:00","article_modified_time":"2026-06-01T08:48:18+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/android-organ-donation-app-2.webp","type":"image\/webp"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/android-organ-donation-app\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/android-organ-donation-app\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/c187795dc82ab948373cca526df7c445"},"headline":"Android Project \u2013 Organ Donation App","datePublished":"2023-10-09T13:30:11+00:00","dateModified":"2026-06-01T08:48:18+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/android-organ-donation-app\/"},"wordCount":979,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/android-organ-donation-app\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/android-organ-donation-app-2.webp","keywords":["android organ donation app","android organ donation app project","android project ideas","android projects","android projects for practice","organ donation app","organ donation project"],"articleSection":["Android Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/android-organ-donation-app\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/android-organ-donation-app\/","url":"https:\/\/data-flair.training\/blogs\/android-organ-donation-app\/","name":"Android Project \u2013 Organ Donation App - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/android-organ-donation-app\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/android-organ-donation-app\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/android-organ-donation-app-2.webp","datePublished":"2023-10-09T13:30:11+00:00","dateModified":"2026-06-01T08:48:18+00:00","description":"Through this Android Organ Donation app, users can access vital information about organ donation, find local organ donation centres.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/android-organ-donation-app\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/android-organ-donation-app\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/android-organ-donation-app\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/android-organ-donation-app-2.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/android-organ-donation-app-2.webp","width":1200,"height":628},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/android-organ-donation-app\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Android Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/android\/"},{"@type":"ListItem","position":3,"name":"Android Project \u2013 Organ Donation App"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/c187795dc82ab948373cca526df7c445","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team provides high-impact content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We make complex concepts easy to grasp, helping learners of all levels succeed in their tech careers.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam6\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/115656","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=115656"}],"version-history":[{"count":8,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/115656\/revisions"}],"predecessor-version":[{"id":148695,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/115656\/revisions\/148695"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/120613"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=115656"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=115656"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=115656"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}