0% found this document useful (0 votes)
618 views61 pages

Report AAhar App

This document describes a mobile application project submitted for a Bachelor of Technology degree. The application, called AAHAR-APP, aims to reduce food waste by connecting restaurants and cafes with organizations that can distribute excess food to those in need. It allows donors to see donation options and have items collected, while benefiting restaurants, cafes, and the needy. The project was created by three students and overseen by their guide to fulfill degree requirements.

Uploaded by

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

Report AAhar App

This document describes a mobile application project submitted for a Bachelor of Technology degree. The application, called AAHAR-APP, aims to reduce food waste by connecting restaurants and cafes with organizations that can distribute excess food to those in need. It allows donors to see donation options and have items collected, while benefiting restaurants, cafes, and the needy. The project was created by three students and overseen by their guide to fulfill degree requirements.

Uploaded by

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

AAHAR-APP

A Major Project Work


Submitted in Partial fulfilment for the award of
Graduate Degree of Bachelor of Technology (B.Tech.) In
Information Technology
(Session:May 2023)

Submitted By

ABHILASH GARG
Enroll No: 0205IT191001
SHREYA YADAV
Enroll No: 0205IT191023
SHUSHANT DIWEDI
Enroll No: 0205IT191025

Under the Guidance of


Prof. Mahindra Rai
(HOD, IT)

DEPARTMENT OF INFORMATION TECHNOLOGY


SHRI RAM INSTITUTE OF TECHNOLOGY, JABALPUR (M.P)
RAJIV GANDHI PROUDYOGIKI VISHWAVIDYALAYA, BHOPAL (M.P)

1
CERTIFICATE

This is to certify that

ABHILASH GARG (Enroll no-0205IT191001)


SHREYA YADAV (Enroll no-0205IT191023)
SHUSHANT DIWEDI (Enroll no-020IT191025)

Students of 8TH semester, Information Technology S.R.I.T., Jabalpur have submitted their major
project report entitled “AAHAR APP” for the partial fulfilment of the requirement for the degree of
Bachelor of Technology as per R.G.P.V., Bhopal.

They have successfully implemented and tested this project, which meets all the requirements
specified under my guidance.

Prof. Mahendra Rai Db. Shailesh Prof. Mahendra Rai


Gupta (H.O.D)
(Project Guide)
(Principal) Information Technology,
Information Technology SRIT
Department, SRIT SRIT,
Jabalpur

2
CERTIFICATE
This is to certify that
ABHILASH GARG (Enroll no-0205IT191001)
SHREYA YADAV (Enroll no-0205IT191023)
SHUSHANT DIWEDI (Enroll no-020IT191025)

Students of 8th semester, Information Technology S.R.I.T., Jabalpur have submitted their major
project report entitled “AAHAR-APP” for the partial fulfilment of the requirement for the degree of
Bachelor of Technology as per R.G.P.V., Bhopal.
They have successfully implemented and tested this project, which meets all the requirements
specified under my guidance.

(INTERNAL EXAMINER) (EXTERNAL EXAMINER)

Date :- Date :-

3
Preface

In highly populated countries like India, food wastage is a disturbing issue. The streets, garbage bins and
landfills have ample proof to prove it. Marriages, canteens, restaurants, social and family get-togethers and
functions expel out so much food. Food wastage is not only an indication of hunger or pollution, but also of
many economic problems. The high standard of living has resulted in the wastage of food, clothes, etc. because
of quick changes in habits and lifestyle. Instead of wasting these things we can put them in use by donating
them to various organizations such as orphanages, old age homes, etc. The product is an internet-based android
application that basically aims at charity through donations.
The proposed application shall reduce food wastage and also fulfill other requirements like clothes, books,
utensils, etc. of needy organizations and peoples.

As mentioned above in the description there is a lot of food wastage that occurs daily at restaurants and cafes.
Instead of throwing away the same as trash (which usually is the scenario), it can be used to feed the homeless.
Also, since the pickup is arranged for by the enterprise, the restaurants/cafes need not worry about it.
Benefiters will be both the restaurants/cafés (reducing the carbon footprint and wastage), and the needy.

The ultimate objective of this project is to communicate that investments in food wastage reduction is the most
logical step in the pursuit of sustainable production and consumption, including food security, climate change
and other adverse environmental effects. Public awareness materials and a strategy will be developed to this
effect.

4
Acknowledgement

Words are considered as a symbol of approval and token of appreciation then let the words play the
heralding role expressing my gratitude.
The satisfaction that accompanies that the successful completion of any task would be incomplete without
the mention of people whose ceaseless cooperation made it possible, whose constant guidance and
encouragement crown all efforts with success. We are grateful to our project guide Mr. Mahendra Rai Sir for
the guidance, inspiration and constructive suggestions that helpful us in the preparation of this project. We
also thank our colleagues who have helped in successful completion of the project

TEAM MEMBERS
1. ABHILASH GARG
2. SHREYA YADAV
3. SHUSHANT DIWEDI

5
DECLARATION

I the undersigned solemnly declare that the report of the project work entitled “AAHAR APP”, is based my
own work carried out during the course of my study under the gauidance of Mr Mahendra Rai sir. I assert that
the statements made and conclusions drawn are an outcome of the project work.
I further declare that to the best of my knowledge and belief that the project report does not contain any part
of any work which has been submitted for the award of any other degree/diploma/certificate in this University
or any other University

TEAM MEMBERS:
1. ABHILASH GARG

2. SHREYA YADAV
3. SHUSHANT DIWEDI

6
Content
1 Introduction
2 Analysis
2.1 Objective of Project

2.2 Requirement Gathering

2.3 Hardware Requirement.

2.4 Software Requirement

2.5 Feasibility Study

2.6 Software Model

2.7 Software Development Life Cycle

2.8 Cost Estimation

3 Design

3.1 Input Requirement

3.2 ER Diagram

3.3 Data Flow Diagram / Object diagram

3.4 Control Flow Diagram

3.5 System Flow Diagram

4 Tools Used
5 Coding
6 Output

7 Testing

8 SWOT Analysis
9 Conclusion

10 Reference

7
1.INTRODUCTION
In highly populated countries like India, food wastage is a disturbing issue. The streets, garbage bins and
landfills have ample proof to prove it. Marriages, canteens, restaurants, social and family get-togethers and
functions expel out so much food. Food wastage is not only an indication of hunger or pollution, but also of
many economic problems. The high standard of living has resulted in the wastage of food, clothes, etc. because
of quick changes in habits and lifestyle. Instead of wasting these things we can put them in use by donating
them to various organizations such as orphanages, old age homes, etc. The product is an internet-based android
application that basically aims at charity through donations.
The proposed application shall reduce food wastage and also fulfill other requirements like clothes, books,
utensils, etc. of needy organizations and peoples.

As mentioned above in the description there is a lot of food wastage that occurs daily at restaurants and cafes.
Instead of throwing away the same as trash (which usually is the scenario), it can be used to feed the homeless.
Also, since the pickup is arranged for by the enterprise, the restaurants/cafes need not worry about it.
Benefiters will be both the restaurants/cafés (reducing the carbon footprint and wastage), and the needy.

The ultimate objective of this project is to communicate that investments in food wastage reduction is the most
logical step in the pursuit of sustainable production and consumption, including food security, climate change
and other adverse environmental effects. Public awareness materials and a strategy will be developed to this
effect.

The aim is to automate its existing manual system by the help of computerized equipment’s and full-fledged
computer software, fulfilling their requirements, so that their valuable data/information can be stored for a
longer period with easy accessing and manipulation of the same. Basically the project describes how to
manage for good performance and better services for the clients

8
2.ANALYSIS
• In the current working scenario, many NGOs are struggling with some issues mainly communication
with their member , heads and volunteer while NGOs are donating. One of our members is volunteer
of an NGO and main objective of the NGO is to feed the poor people. As volunteer, our member has
to visit the restaurants, individual donations and some processed foods. He is facing many problems
like communications issues, Missing some places for picking up food, unable to find location for
volunteer and much more.
• Hence, we came up with our Android Application, this app is for every ngo available in the particular
city and donate things like clothes food stationary, items and much more.

2.1Aim and Objective of project

• The objective of our application is to enable a link of communication and interactions among NGOs,
donors and the needy.
• The people wishing to donate will be able to see all the options available with them to do the same. The
item they wish to donate then shall be collected by a receiver who is connected our applications similsrly
receiver can collect and contact with donor.
• The donated item shall safely reach the intended needy person after this interaction. In other words, our
project has the following objectives:
(a) Reduce lack of awareness
(b) Enable easy interaction between donors and receiver
(c) Make work faster and quicker by digitizing it via our app

2.2Requirement Gathering

2.2.1 Functional Requirement:-

These are the requirements that the end user specifically demands as basic facilities that the system
should offers. All these functionalities need to be neccesarily incorporated into the system as a part of the
contract.

2.2.2 System Requirement:-

System requirements are all of the requirement at the system level that describes the functions which the
system as a whole should fulfill to satisfy the stakeholder needs and requirements and are expressed in an
appropriate combinations of textual statements views and non functional requirements the latter expressing
the levels of safety security reliability etc that will be necessary.

System requirements play major roles in systems engineering as they:

1.Form the basis of system architecture and design activities.

9
2.Form the basis of system integration and verification activities.

3.Act as reference for validation and stakeholder acceptance.

4.Provide a means of communication between the various technical staf that interact throughout the project.

2.2.3 Hardware Requirement:-

• Processor: SD or 2.6 GHz


• Memory:2GB RAM
• Hard Disk: 100MB free space on a device

2.2.4 Software Requirement:-

• OS: Android 5.0+


• GPS availability
• Boardband connection

2.2.5 Feasibility Requirement:-

• Technical Feasibility

Analysis of technical resources available concerning the project requirement comes under technical
feasibility. The project is an android application that shall be coded in android studio. API and lookup
technologies are used for tracking purpose. Necessary tools will be used for statistical analysis of the work
done by the volunteers.

• Operational Feasibility

Users of the system are familier with the website navigation. Simple GUI. Data retrival and data processing
will be done by the system.

2.2.6 Software Model:-

Making AAHAR-APP Application we are using linear sequential flow which is Water Fall
Model

The Waterfall Model was the first Process Model to be introduced. It is also referred to as a
linear-sequential life cycle model. It is very simple to understand and use. In a waterfall
model, each phase must be completed before the next phase can begin and there is no
overlapping in the phases.

The Waterfall model is the earliest SDLC approach that was used for software development.

10
The waterfall Model illustrates the software development process in a linear sequential flow.
This means that any phase in the development process begins only if the previous phase is
complete. In this waterfall model, the phases do not overlap.

The sequential phases in Waterfall model are −

• Requirement Gathering and analysis − All possible requirements of the system to


be developed are captured in this phase and documented in a requirement specification
document.

• System Design − The requirement specifications from first phase are studied in this
phase and the system design is prepared. This system design helps in specifying
hardware and system requirements and helps in defining the overall system
architecture.

• Implementation − With inputs from the system design, the system is first developed
in small programs called units, which are integrated in the next phase. Each unit is
developed and tested for its functionality, which is referred to as Unit Testing.

• Integration and Testing − All the units developed in the implementation phase are
integrated into a system after testing of each unit. Post integration the entire system is
tested for any faults and failures.

• Deployment of system − Once the functional and non-functional testing is done; the
product is deployed in the customer environment or released into the market.

Maintenance − There are some issues which come up in the client environment. To fix those
issues, patches are released. Also to enhance the product some better versions are released.
Maintenance is done to deliver these changes in the customer environment

2.2.7 Software Development Life Cycle:-

11
In this phase, a logical system is built which fulfils the given requirements. Design phase of
software development deals with transforming the clients 's requirements into a logically
working system. Normally, design is performed in the following in the following two steps:

1. Primary Design Phase:


In this phase, the system is designed at block level. The blocks are created on the basis
of analysis done in the problem identification phase. Different blocks are created for
different functions emphasis is put on minimizing the information flow between blocks.
Thus, all activities which require more interaction are kept in one block.
2. Secondary Design Phase:
In the secondary phase the detailed design of every block is performed.

The general tasks involved in the design process are the following:

1. Design various blocks for overall system processes.

2. Design smaller, compact and workable modules in each block.

3. Design various database structures.

4. Specify details of programs to achieve desired functionality.

5. Design the form of inputs, and outputs of the system.

6. Perform documentation of the design.

7. System reviews.

User Interface Design

User Interface Design is concerned with the dialogue between a user and the computer. It is
concerned with everything from starting the system or logging into the system to the eventually
presentation of desired inputs and outputs. The overall flow of screens and messages is called
a dialogue.

The following steps are various guidelines for User Interface Design:

1. The system user should always be aware of what to do next.

2. The screen should be formatted so that various types of information, instructions and
messages always appear in the same general display area.

3. Message, instructions or information should be displayed long enough to allow the system
user to read them.

4. Use display attributes sparingly.


12
5. Default values for fields and answers to be entered by the user should be specified.

6.user should not be allowed to proceed without correcting an error.

7. The system user should never get an operating system message or fatal error.

For a successful software project, the following steps can be followed:

Select a project

• Identifying project's aims and objectives


• Understanding requirements and specification
• Methods of analysis, design and implementation
• Testing techniques
• Documentation

Project milestones and deliverables

Budget allocation

• Exceeding limits within control

Project Estimates

• Cost
• Time
• Size of code
• Duration

Resource Allocation

• Hardware
• Software
• Previous relevant project information
• Digital Library

Risk Management

• Risk avoidance
• Risk detection

2.2.8 Cost Estimation:-

Cost estimation of the project:


13
Software cost comprises a small percentage of overall computer-based system cost. There are
a number of factors, which are considered, that can affect the ultimate cost the software such
as - human, technical, Hardware and Software availability etc.

The main point that was considered during the cost estimation of project was its sizing. In spite
of complete software sizing, function point and approximate lines of code were also used to
"size" each element of the Software and their costing

The cost estimation done by me for Project also depend upon the baseline metrics collected
from past projects and these were used in conjunction with estimation variables to develop cost
and effort projections.

We have basically estimated this project mainly on two bases -

1) Effort Estimation - This refers to the total man-hours required for the development of
the project. It even includes the time required for doing documentation and user manual.

2) Hardware Required Estimation This includes the cost of the PCs and the hardware cost
required for development of this project.

14
3.DESIGN
In this phase, a logical system is built which fulfils the given requirements. Design phase of software
development deals with transforming the clients 's requirements into a logically working system. Normally,
design is performed in the following in the following two steps:
3.1Primary Design Phase:
In this phase, the system is designed at block level. The blocks are created on the basis of analysis done in the
problem identification phase. Different blocks are created for different functions emphasis is put on
minimising the information flow between blocks. Thus, all activities which require more interaction are kept
in one block.
3.2Secondary Design Phase:

In the secondary phase the detailed design of every block is performed.

The general tasks involved in the design process are the following:

1. Design various blocks for overall system processes.

2. Design smaller, compact and workable modules in each block.

3. Design various database structures.

4. Specify details of programs to achieve desired functionality.

5. Design the form of inputs, and outputs of the system.

6. Perform documentation of the design.

7. System reviews.

3.3Input Requirement

• Integration of all the modules/forms in the system.


• Preparation of the test cases
• Preparation of the possible test data with all the validation checks.
• Actual testing done manually
• Recording of all the reproduced errors.
• Modifications done for the errors found during testing

• Prepared the test result scripts after rectification of the errors.


• Functionality of the entire module/forms.
• Validations for user input.
• Checking of the Coding standards to be maintained during coding.

15
• Testing the module with all the possible test data.
• Testing of the functionality involving all type of calculations etc.
• Commenting standard in the source files.

The software quality plan we will use the following SQA Strategy:

• In the first step, we will select the test factors and rank them. The selected test factors
such as reliability, maintainability, portability or etc. will be placed in the matrix
according to their ranks.

• The second step is for identifying the phases of the development process. The phase
should be recorded in the matrix.

• The third step is that identifying the business risks of the software deliverables. The
risks will be ranked into three ranks such as high, medium and low.

• 3.4.Flow Diagram

16
3.5 ER Diagram

17
3.6 Use Case Diagram

18
4.Tool used
FRONT-END
• Using Android Studio IDE for developing Android Application
• Using Circle Image view library for displaying Profile Images
• Using Lottie Animation Library for making Interactive User
Interface
BACK-END

• Using Java Language as a back-end for making this Android application


• DATABASE
- Firebase real-time database which is provided by Google
(Free Cloud hosted no SQL database)
Database Details

19
5.coding
1.MAINFEST
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.aahaarapp">
<!--
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
Google Maps Android API v2, but you must specify either coarse or fine
location permissions for the "MyLocation" functionality.
-->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />

<application
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.AAHAARAPP"
tools:ignore="AllowBackup">
<activity android:name=".UserdataActivity"></activity>
<activity android:name=".History" />
<activity android:name=".MyPin" />
<activity android:name=".About" />
<activity android:name=".FoodMap" />

<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyBtAubRGSlTZanGLTPT3JrKWsRCFAXZzrE" />

<activity android:name=".Receive" />


<activity android:name=".Contact" />
<activity android:name=".Signup" />
<activity android:name=".Logup" />
<activity android:name=".MainActivity" />
<activity android:name=".Donate" />
<activity android:name=".landingpage" />
<activity
android:name=".SplashScreen"
android:theme="@style/SplashScreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

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


</intent-filter>
</activity>
</application>

</manifest>
20
2.LAYOUT
2.1About Us
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black"
tools:context=".About">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:ignore="ScrollViewSize">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/about"
android:fontFamily="@font/opensans"
android:textSize="26sp"
android:textColor="@color/white"
android:layout_margin="20dp"/>

<!-- <ImageView-->
<!-- android:layout_width="200dp"-->
<!-- android:layout_height="200dp"-->
<!-- android:layout_gravity="center_horizontal"-->
<!-- android:layout_marginTop="18dp"-->
<!-- android:layout_marginBottom="28dp"-->
<!-- android:src="@drawable/splash"-->
<!-- tools:ignore="ContentDescription" />-->

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:fontFamily="@font/nunitosans_light"
android:text="@string/aboutus"
android:textColor="@color/white"
android:justificationMode="inter_word"
android:textSize="20sp" />

<androidx.cardview.widget.CardView
android:id="@+id/instagram"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_margin="10dp"
android:clickable="true"
app:cardBackgroundColor="@color/gray"
21
app:cardCornerRadius="12dp"
app:cardElevation="5dp"
tools:ignore="KeyboardInaccessibleWidget">

<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:layout_marginLeft="40dp"
android:layout_marginRight="10dp"
android:src="@drawable/instagram"
tools:ignore="ContentDescription" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="@font/opensans"
android:text="Instagram"
android:textColor="@color/white"
android:textSize="25sp" />

</androidx.cardview.widget.CardView>

<androidx.cardview.widget.CardView
android:id="@+id/facebook"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_margin="10dp"
android:clickable="true"
app:cardBackgroundColor="@color/gray"
app:cardCornerRadius="12dp"
app:cardElevation="5dp"
tools:ignore="KeyboardInaccessibleWidget">

<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:layout_marginLeft="40dp"
android:layout_marginRight="10dp"
android:src="@drawable/facebook"
tools:ignore="ContentDescription" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="@font/opensans"
android:text="Facebook"
android:textColor="@color/white"
android:textSize="25sp" />

22
</androidx.cardview.widget.CardView>

<androidx.cardview.widget.CardView
android:id="@+id/twitter"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_margin="10dp"
android:clickable="true"
app:cardBackgroundColor="@color/gray"
app:cardCornerRadius="12dp"
app:cardElevation="5dp"
tools:ignore="KeyboardInaccessibleWidget">

<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:layout_marginLeft="40dp"
android:layout_marginRight="10dp"
android:src="@drawable/twitter"
tools:ignore="ContentDescription" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="@font/opensans"
android:text="Twitter"
android:textColor="@color/white"
android:textSize="25sp" />
</androidx.cardview.widget.CardView>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="@font/opensans_light"
android:text="Version 1.0.0"
android:textColor="@color/white"
android:textSize="20sp" />
</LinearLayout>
</ScrollView >

2.2 CAONTACT
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
23
android:background="@drawable/btwoo"
android:padding="16dp"
android:gravity="center"
tools:context=".Contact">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
android:layout_marginTop="-50dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp">

<!-- <ImageView-->
<!-- android:id="@+id/profile"-->
<!-- android:layout_width="100dp"-->
<!-- android:layout_height="100dp"-->
<!-- android:background="@drawable/round_background"-->
<!-- android:padding="15dp"-->
<!-- android:src="@drawable/contact"-->
<!-- tools:ignore="ContentDescription" />-->

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/nameError"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
app:hintAnimationEnabled="true"
android:textColorHint="@color/black"
app:hintTextColor="@color/black"
app:boxStrokeColor="@color/black">

<EditText
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/name"
android:textSize="20sp"
android:fontFamily="@font/opensans"
android:inputType="textNoSuggestions"
android:background="@android:color/transparent"
android:textColor="@color/black"
android:textColorHint="@color/black"
android:maxLines="1"
android:singleLine="true"
android:importantForAutofill="no" />

</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/emailError"

24
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
app:hintAnimationEnabled="true"
android:textColorHint="@color/black"
app:hintTextColor="@color/black"
app:boxStrokeColor="@color/black">

<EditText
android:id="@+id/email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/prompt_email"
android:textSize="20sp"
android:fontFamily="@font/opensans"
android:inputType="textEmailAddress"
android:background="@android:color/transparent"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/black"
android:textColorHint="@color/black"
android:importantForAutofill="no" />

</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/messageError"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
app:hintAnimationEnabled="true"
android:textColorHint="@color/black"
app:hintTextColor="@color/black"
app:boxStrokeColor="@color/black">

<EditText
android:id="@+id/message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/message"
android:textSize="20sp"
android:fontFamily="@font/opensans"
android:background="@android:color/transparent"
android:inputType="text"
android:maxLines="20"
android:singleLine="true"
android:textColor="@color/black"
android:textColorHint="@color/black"
android:importantForAutofill="no" />

</com.google.android.material.textfield.TextInputLayout>

25
<Button
android:id="@+id/submit"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_margin="20dp"
android:background="@drawable/button_rounded"
android:text="@string/submit"
android:textColor="@android:color/white"
android:textSize="16sp"/>

</LinearLayout>
</LinearLayout>

2.3 Donate

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


<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black"
tools:context=".Donate">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/donate"
android:fontFamily="@font/opensans"
android:textSize="24sp"
android:textColor="@color/white"
android:layout_margin="20dp"/>

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center">
<androidx.cardview.widget.CardView
xmlns:Card_View="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="5dp"
android:padding="10dp"
app:cardBackgroundColor="@android:color/transparent"
Card_View:cardCornerRadius="5dp"
Card_View:cardElevation="0dp">

<LinearLayout
26
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:orientation="vertical">

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/nameError"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColorHint="@color/white"
app:hintTextColor="@color/white"
app:boxStrokeColor="@color/white">

<EditText
android:id="@+id/donorname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/donor_name"
android:textSize="20sp"
android:fontFamily="@font/opensans"
android:inputType="text"
android:textColor="@color/white"
android:textColorHint="@color/white"
android:backgroundTint="@android:color/transparent"
android:maxLines="1"
android:singleLine="true"
android:importantForAutofill="no"
tools:ignore="UnusedAttribute" />

</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/itemError"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:textColorHint="@color/white"
app:hintTextColor="@color/white"
app:boxStrokeColor="@color/white">

<EditText
android:id="@+id/fooditem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/food_name"
android:textSize="20sp"
android:fontFamily="@font/opensans"
android:textColor="@color/white"
android:textColorHint="@color/white"

27
android:inputType="text"
android:backgroundTint="@android:color/transparent"
android:maxLines="2"
android:singleLine="true"
android:importantForAutofill="no"
tools:ignore="UnusedAttribute" />

</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/phoneError"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:textColorHint="@color/white"
app:hintTextColor="@color/white"
app:boxStrokeColor="@color/white">

<EditText
android:id="@+id/phone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/phone_number"
android:textSize="20sp"
android:fontFamily="@font/opensans"
android:backgroundTint="@android:color/transparent"
android:maxLength="12"
android:inputType="phone"
android:textColor="@color/white"
android:textColorHint="@color/white"
android:maxLines="1"
android:singleLine="true"
android:importantForAutofill="no"
tools:ignore="UnusedAttribute" />

</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:textColorHint="@color/white"
app:hintTextColor="@color/white"
android:textSize="20sp"
android:fontFamily="@font/opensans"
app:boxStrokeColor="@color/white">

<EditText
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"

28
android:hint="@string/description"
android:textSize="20sp"
android:fontFamily="@font/opensans"
android:inputType="textMultiLine"
android:maxLines="10"
android:textColor="@color/white"
android:textColorHint="@color/white"
android:backgroundTint="@android:color/transparent"
android:importantForAutofill="no"
tools:ignore="UnusedAttribute" />

</com.google.android.material.textfield.TextInputLayout>

<fragment
android:id="@+id/google_map"
xmlns:map="http://schemas.android.com/apk/res-auto"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginTop="20dp"
map:uiZoomControls="true"
tools:ignore="FragmentTagUsage" />

<Button
android:id="@+id/submit"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_margin="20dp"
android:backgroundTint="@color/button_background_color"
android:text="@string/submit"
android:textColor="@color/button_text_color"
android:textSize="20sp"
tools:ignore="UnusedAttribute" />

</LinearLayout>
</androidx.cardview.widget.CardView>
</RelativeLayout>
</LinearLayout>
</ScrollView>

2.4 Food Map

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


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black"
android:foregroundServiceType="location"
tools:context=".FoodMap">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
29
android:text="@string/foodmap"
android:fontFamily="@font/opensans"
android:textSize="24sp"
android:textColor="@color/white"
android:layout_margin="20dp"/>
<fragment
android:id="@+id/google_map"
xmlns:map="http://schemas.android.com/apk/res-auto"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="70dp"
map:uiZoomControls="true"
/>
</RelativeLayout>

2.5 Signup

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


<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bthre"
android:padding="16dp"
android:gravity="center"
tools:context=".Signup">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
android:layout_marginTop="-50dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
tools:ignore="UselessParent">

<ImageView
android:id="@+id/profile"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="@drawable/round_background"
android:padding="15dp"
android:src="@drawable/add"
tools:ignore="ContentDescription" />

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/nameError"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
30
app:hintAnimationEnabled="true"
android:textColorHint="@color/black"
app:hintTextColor="@color/black"
app:boxStrokeColor="@color/black">

<EditText
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/name"
android:textSize="20sp"
android:fontFamily="@font/opensans"
android:inputType="textNoSuggestions"
android:background="@android:color/transparent"
android:textColor="@color/black"
android:textColorHint="@color/black"
android:maxLines="1"
android:singleLine="true"
android:importantForAutofill="no"/>

</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/emailError"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
app:hintAnimationEnabled="true"
android:textColorHint="@color/black"
app:hintTextColor="@color/black"
app:boxStrokeColor="@color/black">

<EditText
android:id="@+id/email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/prompt_email"
android:textSize="20sp"
android:fontFamily="@font/opensans"
android:inputType="textEmailAddress"
android:background="@android:color/transparent"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/black"
android:textColorHint="@color/black"
android:importantForAutofill="no"/>

</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/phoneError"

31
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
app:hintAnimationEnabled="true"
android:textColorHint="@color/black"
app:hintTextColor="@color/black"
app:boxStrokeColor="@color/black">

<EditText
android:id="@+id/phone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/phone_number"
android:textSize="20sp"
android:fontFamily="@font/opensans"
android:maxLength="13"
android:background="@android:color/transparent"
android:inputType="phone"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/black"
android:textColorHint="@color/black"
android:importantForAutofill="no"/>

</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/passError"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:passwordToggleEnabled="true"
android:layout_marginTop="5dp"
app:hintAnimationEnabled="true"
android:textColorHint="@color/black"
app:hintTextColor="@color/black"
app:boxStrokeColor="@color/black">

<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/prompt_password"
android:textSize="20sp"
android:fontFamily="@font/opensans"
android:inputType="textPassword"
android:background="@android:color/transparent"
android:maxLines="1"
android:singleLine="true"
android:textColor="@color/black"
android:textColorHint="@color/black"
android:importantForAutofill="no"/>

32
</com.google.android.material.textfield.TextInputLayout>

<Button
android:id="@+id/register"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_margin="20dp"
android:background="@drawable/button_rounded"
android:text="@string/register"
android:textColor="@android:color/white"
android:textSize="16sp"/>

<TextView
android:id="@+id/login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:gravity="center"
android:text="@string/not_register"
android:textColor="@color/white"
android:fontFamily="@font/opensans"
android:textSize="17sp"/>

</LinearLayout>
</LinearLayout>

2.6 Receive
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black"
tools:context=".Receive">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Receive"
android:fontFamily="@font/opensans"
android:textSize="24sp"
android:textColor="@color/white"
android:layout_margin="20dp"
tools:ignore="HardcodedText" />

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center">
<androidx.cardview.widget.CardView
xmlns:Card_View="http://schemas.android.com/apk/res-auto"
33
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_margin="5dp"
android:padding="10dp"
app:cardBackgroundColor="@android:color/transparent"
Card_View:cardCornerRadius="5dp"
Card_View:cardElevation="0dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:orientation="vertical">

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/nameError"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"

android:textColorHint="@color/white"
app:hintTextColor="@color/white"
app:boxStrokeColor="@color/white">

<EditText
android:id="@+id/receivername"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/receiver_name"
android:textSize="20sp"
android:fontFamily="@font/opensans"
android:inputType="text"
android:textColor="@color/white"
android:textColorHint="@color/white"
android:backgroundTint="@android:color/transparent"
android:maxLines="1"
android:singleLine="true"
android:importantForAutofill="no"
tools:ignore="UnusedAttribute" />

</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/descriptionError"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:passwordToggleEnabled="true"
android:layout_marginTop="5dp"
android:textColor="@color/white"
android:textColorHint="@color/white"
app:hintTextColor="@color/white"
android:textSize="20sp"
android:fontFamily="@font/opensans"
app:boxStrokeColor="@color/white">

<EditText
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
34
android:hint="@string/description"
android:textSize="20sp"
android:fontFamily="@font/opensans"
android:inputType="textMultiLine"
android:maxLines="10"
android:textColor="@color/white"
android:textColorHint="@color/white"
android:backgroundTint="@android:color/transparent"
android:importantForAutofill="no"
tools:ignore="UnusedAttribute" />

</com.google.android.material.textfield.TextInputLayout>

<fragment
android:id="@+id/google_map"
xmlns:map="http://schemas.android.com/apk/res-auto"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginTop="20dp"
map:uiZoomControls="true"
tools:ignore="FragmentTagUsage" />

<Button
android:id="@+id/submit"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_margin="20dp"
android:backgroundTint="@color/button_background_color"
android:text="@string/submit"
android:textColor="@color/button_text_color"
android:textSize="20sp"
tools:ignore="UnusedAttribute" />

</LinearLayout>
</androidx.cardview.widget.CardView>
</RelativeLayout>
</LinearLayout>
</ScrollView>

2.7 History
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black"
tools:context=".History">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:ignore="ScrollViewSize">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/history"

35
android:fontFamily="@font/opensans"
android:textSize="26sp"
android:textColor="@color/white"
android:layout_margin="20dp"/>

<LinearLayout
android:id="@+id/showdata"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:clickable="true"
app:cardBackgroundColor="@color/gray"
app:cardCornerRadius="12dp"
app:cardElevation="5dp"
tools:ignore="KeyboardInaccessibleWidget">

<TextView
android:id="@+id/data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:fontFamily="@font/opensans_light"
android:textColor="@color/white"
android:textSize="15sp" />

</androidx.cardview.widget.CardView>

<androidx.cardview.widget.CardView
android:id="@+id/delete"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="2dp"
android:layout_marginBottom="20dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:clickable="true"
app:cardBackgroundColor="@color/red"
app:cardCornerRadius="12dp"
app:cardElevation="5dp"
tools:ignore="KeyboardInaccessibleWidget">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="@font/opensans"
android:text="@string/delete"
android:textColor="@color/white"

36
android:textSize="18sp" />
</androidx.cardview.widget.CardView>
</LinearLayout>

</LinearLayout>
</androidx.core.widget.NestedScrollView >

3.JAVA ACTIVITY

3.1 About
package com.example.aahaarapp;

import androidx.appcompat.app.AppCompatActivity;
import androidx.cardview.widget.CardView;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;

public class About extends AppCompatActivity {

CardView instagram,facebook,twitter;

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

instagram = findViewById(R.id.instagram);
facebook = findViewById(R.id.facebook);
twitter = findViewById(R.id.twitter);

instagram.setOnClickListener(new View.OnClickListener ()
{
@Override
public void onClick(View v) {
Intent myWebLink = new Intent(android.content.Intent.ACTION_VIEW);
myWebLink.setData(Uri.parse("http://www.instagram.com"));
startActivity(myWebLink);
}
});
facebook.setOnClickListener(new View.OnClickListener ()
{
@Override
public void onClick(View v) {
Intent myWebLink = new Intent(android.content.Intent.ACTION_VIEW);
myWebLink.setData(Uri.parse("http://www.facebook.com"));
startActivity(myWebLink);
}
});
twitter.setOnClickListener(new View.OnClickListener ()

37
{
@Override
public void onClick(View v) {
Intent myWebLink = new Intent(android.content.Intent.ACTION_VIEW);
myWebLink.setData(Uri.parse("http://www.twitter.com"));
startActivity(myWebLink);
}
});
}

3.2 Contact
package com.example.aahaarapp;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.util.Patterns;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.material.textfield.TextInputLayout;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.firestore.CollectionReference;
import com.google.firebase.firestore.DocumentReference;
import com.google.firebase.firestore.FieldValue;
import com.google.firebase.firestore.FirebaseFirestore;
import com.google.firebase.firestore.GeoPoint;

import java.util.HashMap;
import java.util.Map;

public class Contact extends AppCompatActivity {


EditText name, email, message;
Button submit;
boolean isNameValid, isEmailValid, isMessageValid;
FirebaseAuth fAuth;
FirebaseFirestore fStore;
String userID;
public static final String TAG = "TAG";
TextInputLayout nameError, emailError, messageError;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

38
setContentView(R.layout.activity_contact);
name = (EditText) findViewById(R.id.name);
email = (EditText) findViewById(R.id.email);
message = (EditText) findViewById(R.id.message);
submit = (Button) findViewById(R.id.submit);
nameError = (TextInputLayout) findViewById(R.id.nameError);
emailError = (TextInputLayout) findViewById(R.id.emailError);
messageError = (TextInputLayout) findViewById(R.id.messageError);

fAuth=FirebaseAuth.getInstance();
fStore= FirebaseFirestore.getInstance();

submit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SetValidation();
}
});
}
public void SetValidation() {

// Check for a valid name.


if (name.getText().toString().isEmpty()) {
nameError.setError(getResources().getString(R.string.name_error));
isNameValid = false;
} else {
isNameValid = true;
nameError.setErrorEnabled(false);
}

// Check for a valid email address.


if (email.getText().toString().isEmpty()) {
emailError.setError(getResources().getString(R.string.email_error));
isEmailValid = false;
} else if (!Patterns.EMAIL_ADDRESS.matcher(email.getText().toString()).matches()) {
emailError.setError(getResources().getString(R.string.error_invalid_email));
isEmailValid = false;
} else {
isEmailValid = true;
emailError.setErrorEnabled(false);
}

// Check for a valid phone number.


if (message.getText().toString().isEmpty()) {
messageError.setError(getResources().getString(R.string.phone_error));
isMessageValid = false;
} else {
isMessageValid = true;
messageError.setErrorEnabled(false);
}

if (isNameValid && isEmailValid && isMessageValid ) {

39
String Name = name.getText().toString().trim();
String Email= email.getText().toString().trim();
String Message= message.getText().toString().trim();
userID = fAuth.getCurrentUser().getUid();
//DocumentReference documentReference =
fStore.collection("donate").document(userID);
CollectionReference collectionReference = fStore.collection("contact data");

Map<String,Object> user = new HashMap<>();


user.put("timestamp", FieldValue.serverTimestamp());
user.put("name",Name);
user.put("email",Email);
user.put("message",Message);
user.put("userid",userID);

collectionReference.add(user)
.addOnSuccessListener(new OnSuccessListener<DocumentReference>() {
@Override
public void onSuccess(DocumentReference documentReference) {

Toast.makeText(getApplicationContext(),"Success!",Toast.LENGTH_SHORT).show();
Log.d(TAG,"Successfully! We will shortly revert you back.");
//startActivity(new Intent(getApplicationContext(),MainActivity.class));
Intent intent = new Intent(Contact.this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP |
Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {

Toast.makeText(getApplicationContext(),"Error!",Toast.LENGTH_SHORT).show();
Log.w(TAG, "Error!", e);
}
});
}

}
}
3.3 Donate
package com.example.aahaarapp;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;

import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.location.Location;

40
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationServices;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.firestore.CollectionReference;
import com.google.firebase.firestore.DocumentReference;
import com.google.firebase.firestore.FieldValue;
import com.google.firebase.firestore.FirebaseFirestore;
import com.google.firebase.firestore.GeoPoint;
import com.google.firebase.firestore.ServerTimestamp;

import java.util.HashMap;
import java.util.Map;

public class Donate extends AppCompatActivity implements OnMapReadyCallback,


GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener,
com.google.android.gms.location.LocationListener {

private GoogleMap mMap;


GoogleApiClient mGoogleApiClient;
Location mLastLocation;
LocationRequest mLocationRequest;
private int REQUEST_CODE = 11;
SupportMapFragment mapFragment;
EditText mFullName,mFoodItem,mDescription,mPhone;
Button mSubmitBtn;
FirebaseAuth fAuth;
FirebaseFirestore fStore;
String userID;
public static final String TAG = "TAG";

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

41
mFullName = findViewById(R.id.donorname);
mFoodItem = findViewById(R.id.fooditem);
mPhone = findViewById(R.id.phone);
mDescription = findViewById(R.id.description);
mSubmitBtn=findViewById(R.id.submit);

fAuth=FirebaseAuth.getInstance();
fStore= FirebaseFirestore.getInstance();

mapFragment = (SupportMapFragment)
getSupportFragmentManager().findFragmentById(R.id.google_map);
if (ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION) ==
PackageManager.PERMISSION_GRANTED) {
mapFragment.getMapAsync(this);
} else {
ActivityCompat.requestPermissions(this, new
String[]{Manifest.permission.ACCESS_FINE_LOCATION}, REQUEST_CODE);
}
}

@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
buildGoogleApiClient();
if (ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED
&& ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_COARSE_LOCATION) !=
PackageManager.PERMISSION_GRANTED) {
return;
}
mMap.setMyLocationEnabled(true);
}

protected synchronized void buildGoogleApiClient(){


mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(LocationServices.API)
.build();
mGoogleApiClient.connect();
}

@Override
public void onLocationChanged(@NonNull Location location) {
mLastLocation = location;
LatLng latLng = new LatLng(location.getLatitude(),location.getLongitude());

//MarkerOptions markerOptions1 = new MarkerOptions().position(latLng).title("You are


here");
//mMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));
//mMap.animateCamera(CameraUpdateFactory.zoomTo(15));

42
//mMap.addMarker(markerOptions1).showInfoWindow();

MarkerOptions markerOptions = new MarkerOptions().position(latLng).title("You are here");


mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng,15));
mMap.addMarker(markerOptions).showInfoWindow();

mSubmitBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String fullname = mFullName.getText().toString().trim();
String fooditem= mFoodItem.getText().toString().trim();
String description= mDescription.getText().toString().trim();
String phone= mPhone.getText().toString().trim();
String type= "Donor";

if(TextUtils.isEmpty(fullname))
{
mFullName.setError("Name is Required.");
return;
}

if(TextUtils.isEmpty(fooditem))
{
mFoodItem.setError("Required.");
return;
}

if(phone.length() < 10)


{
mPhone.setError("Phone Number Must be >=10 Characters");
return;
}

userID = fAuth.getCurrentUser().getUid();
//DocumentReference documentReference =
fStore.collection("donate").document(userID);
CollectionReference collectionReference = fStore.collection("user data");

GeoPoint geoPoint = new GeoPoint(location.getLatitude(),location.getLongitude());


Map<String,Object> user = new HashMap<>();
user.put("timestamp", FieldValue.serverTimestamp());
user.put("name",fullname);
user.put("food item",fooditem);
user.put("phone",phone);
user.put("description",description);
user.put("location",geoPoint);
user.put("userid",userID);
user.put("type",type);

collectionReference.add(user)
.addOnSuccessListener(new OnSuccessListener<DocumentReference>() {
@Override

43
public void onSuccess(DocumentReference documentReference) {

Toast.makeText(getApplicationContext(),"Success!",Toast.LENGTH_SHORT).show();
Log.d(TAG,"Success!");
//startActivity(new Intent(getApplicationContext(),MainActivity.class));
Intent intent = new Intent(Donate.this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP |
Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {

Toast.makeText(getApplicationContext(),"Error!",Toast.LENGTH_SHORT).show();
Log.w(TAG, "Error!", e);
}
});
}
});
}

@Override
public void onConnected(@Nullable Bundle bundle) {
mLocationRequest = new LocationRequest();
mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
if (ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED
&& ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_COARSE_LOCATION) !=
PackageManager.PERMISSION_GRANTED) {
return;
}
LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient,
mLocationRequest, this);

@Override
public void onConnectionSuspended(int i) {

@Override
public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {

}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
@NonNull int[] grantResults) {

if (requestCode == REQUEST_CODE){

44
if(grantResults.length > 0 && grantResults[0] ==
PackageManager.PERMISSION_GRANTED){
mapFragment.getMapAsync(this);
}else{
Toast.makeText(this,"Permission Denied", Toast.LENGTH_SHORT).show();
}
}
}
}

3.4 History
package com.example.aahaarapp;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.Timestamp;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.firestore.CollectionReference;
import com.google.firebase.firestore.FirebaseFirestore;
import com.google.firebase.firestore.GeoPoint;
import com.google.firebase.firestore.QueryDocumentSnapshot;
import com.google.firebase.firestore.QuerySnapshot;

import java.text.SimpleDateFormat;
import java.util.Date;

public class History extends AppCompatActivity {

private FirebaseFirestore db = FirebaseFirestore.getInstance();


private CollectionReference notebookref = db.collection("user data");
public static final String TAG = "TAG";
private TextView textViewData;
FirebaseAuth fAuth;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_history);
fAuth= FirebaseAuth.getInstance();
textViewData=findViewById(R.id.data);

45
loadNotes();
}

public void loadNotes() {


notebookref.get()
.addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
@Override
public void onComplete(@NonNull Task<QuerySnapshot> task) {
if (task.isSuccessful()) {
String data="";
for (QueryDocumentSnapshot document : task.getResult()) {
Log.d(TAG, document.getId() + " => " + document.getData());//
if (document.contains("name") && document.contains("description") &&
document.contains("user type") && document.contains("userid")) {

String name = (String) document.get("name");


String type = (String) document.get("user type");
String description = (String) document.get("description");
String Userid = (String) document.get("userid");
String userID = fAuth.getCurrentUser().getUid();
Timestamp ts = (Timestamp) document.get("timestamp");
//String dateandtime=String.valueOf(ts);
String dateandtime=String.valueOf(ts.toDate());
//String dateandtime = ts.toString();

if(Userid.equals(userID)) {
data += "Name: " + name + "\nUser Type: " + type + "\nDescription: " +
description + "\nDate & Time: " + dateandtime + "\n\n";
//data += "Name: " + name + "\nUser Type: " + type + "\nDescription: " +
description + "\n";
}
textViewData.setText(data);
}
}
//textViewData.setText(data);
} else {
Log.d(TAG, "Error fetching data: ", task.getException());
}
}
});
}
}

3.5 Landingpage
package com.example.aahaarapp;

import androidx.appcompat.app.AppCompatActivity;
import androidx.cardview.widget.CardView;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

46
import com.google.firebase.auth.FirebaseAuth;

public class landingpage extends AppCompatActivity {

CardView login,register,about;
FirebaseAuth fAuth;

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

login = findViewById(R.id.cardLogin);
register = findViewById(R.id.cardRegister);
about = findViewById(R.id.cardAboutus);

fAuth= FirebaseAuth.getInstance();
if(fAuth.getCurrentUser() !=null){
Intent intent = new Intent(landingpage.this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP |
Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}

login.setOnClickListener(new View.OnClickListener ()
{
@Override
public void onClick(View v) {
startActivity(new Intent(getApplicationContext(), Logup.class));
}
});
register.setOnClickListener(new View.OnClickListener ()
{
@Override
public void onClick(View v) {
startActivity(new Intent(getApplicationContext(), Signup.class));
}
});
about.setOnClickListener(new View.OnClickListener ()
{
@Override
public void onClick(View v) {
startActivity(new Intent(getApplicationContext(), About.class));
}
});
}

3.6 MainActivity
package com.example.aahaarapp;

47
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;
import androidx.cardview.widget.CardView;

import com.google.firebase.auth.FirebaseAuth;

public class MainActivity extends AppCompatActivity {

CardView donate, receive, logout, foodmap, about, contact, mypin, history;


FirebaseAuth fAuth;

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

donate = findViewById(R.id.cardDonate);
receive = findViewById(R.id.cardReceive);
logout = findViewById(R.id.cardLogout);
foodmap = findViewById(R.id.cardFoodmap);
mypin = findViewById(R.id.cardMyPin);
history = findViewById(R.id.cardHistory);
about = findViewById(R.id.cardAboutus);
contact = findViewById(R.id.cardContact);

fAuth= FirebaseAuth.getInstance();
if(fAuth.getCurrentUser() ==null){
Intent intent = new Intent(MainActivity.this, landingpage.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP |
Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}

donate.setOnClickListener(new View.OnClickListener ()
{
@Override
public void onClick(View v) {
Intent intent = new Intent(getApplicationContext(), Donate.class);
startActivity(intent);
}
});
receive.setOnClickListener(new View.OnClickListener ()
{
@Override
public void onClick(View v) {
Intent intent = new Intent(getApplicationContext(), Receive.class);
startActivity(intent);
}
});

48
foodmap.setOnClickListener(new View.OnClickListener ()
{
@Override
public void onClick(View v) {
Intent intent = new Intent(getApplicationContext(), FoodMap.class);
startActivity(intent);
}
});
about.setOnClickListener(new View.OnClickListener ()
{
@Override
public void onClick(View v) {
Intent intent = new Intent(getApplicationContext(), About.class);
startActivity(intent);
}
});
mypin.setOnClickListener(new View.OnClickListener ()
{
@Override
public void onClick(View v) {
Intent intent = new Intent(getApplicationContext(), MyPin.class);
startActivity(intent);
}
});
history.setOnClickListener(new View.OnClickListener ()
{
@Override
public void onClick(View v) {
Intent intent = new Intent(getApplicationContext(), UserdataActivity.class);
startActivity(intent);
}
});
contact.setOnClickListener(new View.OnClickListener ()
{
@Override
public void onClick(View v) {
Intent intent = new Intent(getApplicationContext(), Contact.class);
startActivity(intent);
}
});
logout.setOnClickListener(new View.OnClickListener ()
{
@Override
public void onClick(View v) {
FirebaseAuth.getInstance().signOut();
Intent intent = new Intent(MainActivity.this, landingpage.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP |
Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
});
}
}

49
6.output
1.MY SCREEN

2 Register Page

50
3.Login Page

4.My Dashboard

51
5.Donate Screen

6. Receive Screen

52
7.Food Map

8.History

53
9.AboutUS

54
7.Testing
As the project is on bit large scale, we always need testing to make it successful if each components work
properly in all respect and gives desired output for all kind of inputs then project is said to be tested.
The testing done was system testing checking whether the user requirements were satisfied. The codde for
new system has been written completely using JAVA as the coding language and Android Studio as the
interface for front end designing. The new system has been tested well with the help of the users and all the
applications have been verified from every nook and corner of the users.
Although Some applications were founded to be erroneous these applications have been corrected before being
implemented. The flow of the forms has been founded to be very much inn accordance with the actual flow
of data.

Level of Testing
In order to uncover the errors present in different phases we have the concept of level of testing. The basic
level of testing:-

A series of testing is done for the proposed system before the system is ready for the user acceptance
testing.
The Steps involved in testing are:-
• Unit Testing:
Unit testing focuses verification efforts on the smallest unit of the software design, the
module. This is also known as “Module Testing”. The modules are tested separately. This testing
carried out during programming stage itself. In this testing each module is found to be working
satisfactorily as regards to the expected output from the module.
• Integration Testing:
Data can be grossed across an interface; one module can have adverse efforts on another.
Integration testing is systematic testing for construction the program structure while at the same time
conducting tests to uncover errors associated with in the interface. The objective is to take unit tested
modules and build a program structure. All the modules are combined and tested as a whole. Here

55
correction is difficult because the isolation of cause is complicate by the vast expense of the entire
program. Thus in the integration testing stop, all the errors uncovered are corrected for the text testing
steps.
• System Testing:
System testing is the stage of implementation that is aimed at ensuring that the system works
accurately and efficiently for live operation commences. Testing is vital to the success of the system.
System testing makes a logical assumption that if all the parts of the system are correct, then goal will
be successfully achieved.

• Validation Testing:
At the conclusion of integration testing software is completely assembled as a package,
interfacing errors have been uncovered and corrected and a final series of software tests begins,
validation test begins. Validation test can be defined in many ways. But the simple definition is that
validation succeeds when the software function in a manner that can reasonably expected by the
customer. After validation test has been conducted one of two possible conditions exists. 70 One is
the function or performance characteristics confirm to specifications and are accepted and the other
is deviation from specification is uncovered and a deficiency list is created. Proposed system under
consideration has been tested by using validation testing and found to be working satisfactorily.

• Output Testing:
After performing validation testing, the next step is output testing of the proposed system
since no system could be useful if it does not produce the required output in the specified format.
Asking the users about the format required by them tests the outputs generated by the system under
consideration. Here the output format is considered in two ways, one is on the screen and other is the
printed format. The output format on the screen is found to be correct as the format was designed in
the system designed phase according to the user needs. For the hard copy also the output comes as
the specified requirements by the users. Hence output testing does not result any corrections in the
system.

• User Acceptance Testing:


User acceptance of a system is the key factor of the success of any system. The system
under study is tested for the user acceptance by constantly keeping in touch with the prospective
system users at the time of developing and making changes wherever required.

56
Test Cases
Registration: To begin with login, user need to register by filling up basic registration details. There are
multiple fields in registration page and every field has to fill by user. User cannot use character in the login
id field.
Login: - Login id and password are kept compulsory fields, and if the id or password doesn’t match then it
will show an error message.
VALIDATION CRITERIA
1. In each form, no field which is not null able should be left blank.
2. All numeric fields should be checked for non-numeric values. Similarly, text fields like names should not
contain any numeric characters.
3. All primary keys should be automatically generated to prevent the user from entering any existing key.
4. Use of error handling for each Save, Edit, delete and other important operations.
5. Whenever the user Tabs out or Enter from a text box, the data should be validated and if it is invalid,
focus should again be sent to the text box with proper message.

57
8.SWOT ANALYSIS
Strength of our application
1. Reduce Hunger
2. Improves Health
3. Reduce landfill use
4. Offers the possibilities to turn waste streams into valuable resources and improves sustainability of
argriculture and food production.
5. Potential for green jobs and economic activity if sustainability concern addressed.

Weakness of our application


1. Commercial demonstration of technologies lags behind inter alia due to high costs financing constraints and a
current lack of demand pull effects.
2. Sustainability risks exits even for an industry existing uses and environmental functions.

58
9.CONCLUSION
We would like to conclude that our project shall aim at helping the needy by connecting them with the donors
by using the an intermediary who shall do their job aided by the applications that we shall provide them. Our
applications shall aim to mitigate issues like lack of awareness among donors lack of transparency in the
donation process and thus acts as a bridge between the people in need.

Future Scope
India is a developing nation and problems such as hunger and other issues are still prevalent to a large degree.
We shall try to contribute out best by connecting the people in need with the providers and donors. We shall
try and expand our application scope to other platforms such as IOS and also shall try to expand our reach and
the amount of help we provide. We also try to add new features in this as we try donor donate all the necessary
item,

59
10.Reference
• Google for problem solving
• https://lottiefiles.com/editor
• https://github.com/hdodenhof/CircleImageView
• https://relevant.software/blog/top-8-flutter-advantages-and-why-youshould-try-
flutter-on-your-next-project/
• http://www.javatpoint.com/java-tutorial
• https://firebase.google.com/docs/flutter/setup?platform=ios
• https://docs.flutter.dev/development/data-and-backend/firebase
• https://www.applozic.com/blog/android-note -app-tutorial-usingandroid-
studio/

• https://firebase.google.com/codelabs/firebase-android#0

60
1

You might also like