Food Donation App Review3-Converted (3) .. - Abhishek Datta
Food Donation App Review3-Converted (3) .. - Abhishek Datta
Food Donation App Review3-Converted (3) .. - Abhishek Datta
Submitted by
ABHISHEK DATTA
(1613101031)
BACHELOR OF TECHNOLOGY
IN
COMPUTER SCIENCE AND ENGINEERING
BONAFIDE CERTIFICATE
Certified that this project report “ FOOD DONATION APP ” is the bonafide
3 PROPOSRD SYSTEM 6
4 PROJECT LIFECYCLE 7
5 PROJECT DESIGN 8
7 CODING 42
8 SNAPSHOTS 65
9.1 Testing 67
9.2 Levels of Testing 68
9.3 Test Cases 71
10 ADVANTAGES & LIMITATIONS 72
10.1 Advantages 72
10.2 Limitations 72
10.3 Features 73
11 CONCLUSION 74
12 BIBIIOGRAPHY 75
First Step capstone project objective is to handle donations and connect the
donators with the nearest/appropriate needy person through a social mobile
application. The application handles different services such as the reviews of
the searched needy person and displays their contacts and their location.
The application allows users to create a profile for themselves and the
information about a certain family that needs help. This profile will be shown
to donators who are looking for someone to donate to. Mainly only
information is exchanged. The donators are able to post/see reviews about
other people’s profiles.
This application is aimed to help the Moroccan society and create a sense of
solidarity through modern techniques. The social implications it will have after
being launched will certainly aim at closing the gap in terms of quality of life
for the less fortunate citizens.
INTRODUCTION
1
Scope and Objective
2
Modules and their Description
1. Admin
• Login: Admin can login using credentials.
• Manage Restaurant: Admin can manage restaurant by adding new
restaurant.
• Manage NGO: Admin can manage NGO’s
2. Restaurant
• Login: Restaurant can login using credentials.
• Profile: Restaurant can make their profile by their details.
• Change Password: Restaurant can also change their password in
case of emergency.
• Home: Todays Access food list accepted by NGO and yet to pick up.
• Food Access Request: Access Food details will be added here.
• Food History: Restaurant will show Pending/Accepted/Previous
food history.
• Pending: Todays Access Food list which are yet to accept by NGO
• Accepted: Todays Access Food list which are accepted by NGO
• Previous: Previous History for Access Food & details.
• Notification: They will get the notifications of request and accepted
request.
3
3. NGO
• Login: NGO can login using credentials.
• Profile: They can make their profile providing details of NGO
• Change Password: They can change their password.
• Restaurant Request: List of Access Food initiated by the
Restaurant, See the Restaurant and Food Details, Accept the
Request and Assign an Employee to Pick & Deliver it.
• NGO Request: NGO can view added request and the previous
accepted request, when it facing shortage of food.
• Manage Employee: NGO can add, update and delete the employee
details for NGO food pick and drop.
• History: NGO can see rest of the history of food delivered and
picked details.
• Notifications: NGO will get notify on new restaurant order, or
request accepted for food.
4
Existing System & Proposed System
5
PROPOSED SYSTEM
6
Project Lifecycle Details
Waterfall Model
Description
The waterfall Model is a linear sequential flow. In which progress is seen
as flowing steadily downwards (like a waterfall) through the phases of software
implementation. This means that any phase in the development process begins
only if the previous phase is complete. The waterfall approach does not define
the process to go back to the previous phase to handle changes in
requirement. The waterfall approach is the earliest approach that was used for
software development.
7
PROJECT DESIGN
E-R Diagram
Gender Name
Address
Admin_id
Email id
User id Admin
Login
Password
has
Manage Restaurant
Password
id Manage NGO
Food History
NGO Request
8
Use Case Diagram
9
Fig. Use Case Diagram of Restaurant
10
Fig. Use Case Diagram of NGO
11
Sequence Diagram
12
Fig. Sequence Diagram of Restaurant
13
Fig. Sequence Diagram of NGO
14
Activity Diagram
15
Fig. Activity Diagram of NGO
16
Class Diagram
New Registration
Admin
- Name : String
- User_id : String - DOB : Int
- Password : String - Gender : String
- Address : String
+ Login() - Mobile No. : Int
+ btn_Click () - Email id : String
+ Logout () - User id : String
- Password : String
Restaurant
+ Submit ()
- User_id : String
+ btn_Click ()
- Password : String
+ Login()
+ btn_Click ()
+ Logout ()
NGO
- User_id : String
- Password : String
+ Login()
+ btn_Click ()
+ Logout ()
17
Data Flow Diagram (DFD’s)
18
A DFD is also known as a “bubble Chart” has the purpose of clarifying
system requirements and identifying major transformations that will become
programs in system design. So it is the starting point of the design to the lowest
level of detail. A DFD consists of a series of bubbles joined by data flows in the
system.
DFD SYMBOLS:
In the DFD, there are four symbols
1. A square defines a source(originator) or destination of system data
2. An arrow identifies data flow. It is the pipeline through which the information
flows
3. A circle or a bubble represents a process that transforms incoming data flow
into outgoing data flows.
4. An open rectangle is a data store, data at rest or a temporary repository of
data
Data flow
Data Store
19
CONSTRUCTING A DFD:
A DFD typically shows the minimum contents of data store. Each data
store should contain all the data elements that flow in and out.
Questionnaires should contain all the data elements that flow in and out.
Missing interfaces redundancies and like is then accounted for often through
interviews.
1. The DFD shows flow of data, not of control loops and decision are
controlled considerations do not appear on a DFD.
2. The DFD does not indicate the time factor involved in any process whether
the data flows take place daily, weekly, monthly or yearly.
3. The sequence of events is not brought out on the DFD.
20
TYPES OF DATA FLOW DIAGRAMS
1. Current Physical
2. Current Logical
3. New Logical
4. New Physical
CURRENT PHYSICAL:
In Current Physical DFD process label include the name of people or their
positions or the names of computer systems that might provide some of the
overall system-processing label includes an identification of the technology used
to process the data. Similarly, data flows and data stores are often labels with
the names of the actual physical media on which data are stored such as file
folders, computer files, business forms or computer tapes.
CURRENT LOGICAL:
The physical aspects at the system are removed as much as possible so
that the current system is reduced to its essence to the data and the processors
that transform them regardless of actual physical form.
NEW LOGICAL:
This is exactly like a current logical model if the user were completely
happy with the user were completely happy with the functionality of the current
system but had problems with how it was implemented typically through the
new logical model will differ from current logical model while having additional
functions, absolute function removal and inefficient flows recognized.
21
NEW PHYSICAL:
The new physical represents only the physical implementation of the new
system.
DATA STORE
1) Data cannot move directly from one data store to another data store,
a process must move data.
2) Data cannot move directly from an outside source to a data store, a
process, which receives, must move data from the source and place
the data into data store
3) A data store has a noun phrase label.
SOURCE OR SINK
The origin and /or destination of data.
22
DATA FLOW
1) A Data Flow has only one direction of flow between symbols. It may
flow in both directions between a process and a data store to show a
read before an update. The later it usually indicated however by two
separate arrows since these happen at different type.
2) A join in DFD means that exactly the same data comes from any of two
or more different processes data store or sink to a common location.
3) A data flow cannot go directly back to the same process it leads. There
must be at least one other process that handles the data flow produce
some other data flow returns the original data into the beginning
process.
4) A Data flow to a data store means update (delete or change).
5) A data Flow from a data store means retrieve or use.
23
Data Flow Diagrams (DFD’s)
Query 0.0
Food Donation
User Database
Management
DB
DATABASE DETAIL
24
1.0
Query
User Process Check for user
Request Requirement
User need
1.1
Feedback For
Relevant Database
User Data
LEVEL 1 DFD
25
Query 2.0
User Accept
Query
2.2
26
System Architecture
27
PROJECT IMPLEMENTATION
1. Laptop or PC
❖ Software Requirement:
1. Laptop or PC
➢ Windows 7 or higher.
➢ Java
➢ Android Studio
2. Android Phone or Tablet
➢ Android v5.0 or Higher
28
Introduction to Android
Android Studio is the official Integrated Development Environment (IDE) for
Android app development, based on IntelliJ IDEA . On top of IntelliJ's powerful
code editor and developer tools, Android Studio offers even more features
that enhance your productivity when building Android apps, such as:
• A unified environment where you can develop for all Android devices
• Instant Run to push changes to your running app without building a new
APK
• Code templates and GitHub integration to help you build common app
features and import sample code
29
Project Structure
Each project in Android Studio contains one or more modules with source
code files and resource files. Types of modules include:
• Library modules
• manifests: Contains
the AndroidManifest.xml file.
• res: Contains all non-code resources, such as XML layouts, UI strings, and
bitmap images.
30
The Android project structure on disk differs from this flattened
representation. To see the actual file structure of the project,
select Project from the Project dropdown (in figure 1, it's showing asAndroid).
2. The navigation bar helps you navigate through your project and open files
for editing. It provides a more compact view of the structure visible in
the Project window.
3. The editor window is where you create and modify code. Depending on
the current file type, the editor can change. For example, when viewing a
layout file, the editor displays the Layout Editor.
4. The tool window bar runs around the outside of the IDE window and
contains the buttons that allow you to expand or collapse individual tool
windows.
31
5. The tool windows give you access to specific tasks like project
management, search, version control, and more. You can expand them and
collapse them.
6. The status bar displays the status of your project and the IDE itself, as well
as any warnings or messages.
You can organize the main window to give yourself more screen space by
hiding or moving toolbars and tool windows. You can also use keyboard
shortcuts to access most IDE features.
At any time, you can search across your source code, databases, actions,
elements of the user interface, and so on, by double-pressing the Shift key, or
clicking the magnifying glass in the upper right-hand corner of the Android
Studio window. This can be very useful if, for example, you are trying to locate
a particular IDE action that you have forgotten how to trigger.
32
Tool Windows
Instead of using preset perspectives, Android Studio follows your
context and automatically brings up relevant tool windows as you work. By
default, the most commonly used tool windows are pinned to the tool window
bar at the edges of the application window.
• To expand or collapse a tool window, click the tool’s name in the tool
window bar. You can also drag, pin, unpin, attach, and detach tool windows.
• To return to the current default tool window layout, click Window > Restore
Default Layout or customize your default layout by clicking Window > Store
Current Layout as Default.
• To show or hide the entire tool window bar, click the window icon in the
bottom left-hand corner of the Android Studio window.
• To locate a specific tool window, hover over the window icon and select the
tool window from the menu.
Navigation
Here are some tips to help you move around Android Studio.
• Switch between your recently accessed files using the Recent Files action.
Press Control+E (Command+E on a Mac) to bring up the Recent Files action.
By default, the last accessed file is selected. You can also access any tool
window through the left column in this action.
• View the structure of the current file using the File Structure action. Bring up
the File Structure action by pressing Control+F12 (Command+F12 on a Mac).
Using this action, you can quickly navigate to any part of your current file.
33
• Search for and navigate to a specific class in your project using the Navigate
to Class action. Bring up the action by pressing Control+N(Command+O on a
Mac). Navigate to Class supports sophisticated expressions, including camel
humps, paths, line navigate to, middle name matching, and many more. If
you call it twice in a row, it shows you the results out of the project classes.
• Navigate to a file or folder using the Navigate to File action. Bring up the
Navigate to File action by pressing Control+Shift+N (Command+Shift+O on a
Mac). To search for folders rather than files, add a / at the end of your
expression.
• Find all the pieces of code referencing the class, method, field, parameter,
or statement at the current cursor position by pressing Alt+F7
• Create multiple APKs for your app, with different features using the same
project and modules.
34
By employing the flexibility of Gradle, you can achieve all of this without
modifying your app's core source files. Android Studio build files are
namedbuild.gradle. They are plain text files that use Groovy syntax to
configure the build with elements provided by the Android plugin for Gradle.
Each project has one top-level build file for the entire project and separate
module-level build files for each module. When you import an existing project,
Android Studio automatically generates the necessary build files.
Inline debugging
Use inline debugging to enhance your code walk-throughs in the debugger
view with inline verification of references, expressions, and variable values.
Inline debug information includes:
35
• Lambda and operator expressions
• Tooltip values
Performance monitors
Allocation tracker
36
Code inspections
The Lint tool checks your Android project source files for potential bugs and
optimization improvements for correctness, security, performance, usability,
accessibility, and internationalization.
37
FEASIBILITY REPORT
➢ Technical Feasibility
➢ Economic Feasibility
➢ Operational Feasibility
In this phase, we study the feasibility of all proposed systems, and pick the
best feasible solution for the problem. The feasibility is studied based on three
main factors as follows.
38
❖ Technical Feasibility
Languages : JAVA
39
❖ Economic Feasibility
40
❖ Operational Feasibility
41
CODING
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.annotation.TargetApi;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.util.Patterns;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.Toast;
42
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import com.demo.fwm_admin.util.LoginSharedPref;
import com.demo.fwm_admin.webservice.JSONParser;
import com.demo.fwm_admin.webservice.RestAPI;
import com.google.android.material.snackbar.Snackbar;
import org.json.JSONArray;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.Arrays;
Dialog cd;
private UserLoginTask mAuthTask = null;
String uid;
// UI references.
private EditText mUserNameView;
private EditText mPasswordView;
@Override
protected void onCreate(Bundle savedInstanceState) {
43
super.onCreate(savedInstanceState);
uid = LoginSharedPref.getUidKey(this);
if (uid.length()>0) {
Intent intentLogin = new Intent(this, MainActivity.class);
startActivity(intentLogin);
finish();
}
else {
setContentView(R.layout.login);
getSupportActionBar().hide();
mUserNameView = findViewById(R.id.user);
mPasswordView = (EditText) findViewById(R.id.pass);
Button mEmailSignInButton = (Button) findViewById(R.id.submit);
mEmailSignInButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
attemptLogin(view);
}
});
}
}
44
{
mAuthTask=new
UserLoginTask(mUserNameView.getText().toString(),mPasswordView.getText()
.toString());
mAuthTask.execute();
}
else
{
Snackbar.make(view,"Enter
Password",Snackbar.LENGTH_SHORT).show();
mPasswordView.requestFocus();
}
}
else
{
Snackbar.make(view,"Enter Email",Snackbar.LENGTH_SHORT).show();
mUserNameView.requestFocus();
}
}
45
mPassword = password;
dailog();
}
@Override
protected String doInBackground(Void... params) {
String result = null;
RestAPI restAPI = new RestAPI();
try {
JSONObject jsonObject = null;
jsonObject = restAPI.ALogin(mUserName, mPassword);
JSONParser jsonParser = new JSONParser();
result = jsonParser.parseJSON(jsonObject);
} catch (Exception e) {
e.printStackTrace();
result = e.getMessage();
}
return result;
}
@Override
protected void onPostExecute(final String result) {
cd.cancel();
Log.d("REPLY login", result);
if (result.contains("Unable to resolve host")) {
AlertDialog.Builder ad = new AlertDialog.Builder(LoginActivity.this);
46
ad.setTitle("Unable to Connect!");
ad.setMessage("Check your Internet Connection,Unable to connect
the Server");
ad.setNeutralButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
ad.show();
} else {
try {
JSONObject json = new JSONObject(result);
String ans = json.getString("status");
if (ans.compareTo("false") == 0) {
Snackbar.make(mUserNameView, "Login credentials Incorrect",
Snackbar.LENGTH_SHORT).show();
mPasswordView.requestFocus();
} else if (ans.compareTo("true") == 0) {
LoginSharedPref.setUidKey(LoginActivity.this,"uid");
startActivity(new Intent(LoginActivity.this, MainActivity.class));
finish();
} else if (ans.compareTo("error") == 0) {
String error = json.getString("Data");
Toast.makeText(LoginActivity.this, error,
Toast.LENGTH_SHORT).show();
}
47
} catch (Exception e) {
Toast.makeText(LoginActivity.this, e.getMessage(),
Toast.LENGTH_SHORT).show();
}
}
}
}
}
Restaurant (Login Activity):
package com.demo.fwm_restaurant;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
48
import android.graphics.drawable.ColorDrawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.util.Patterns;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import com.demo.fwm_restaurant.util.LoginSharedPref;
import com.demo.fwm_restaurant.webservice.JSONParser;
import com.demo.fwm_restaurant.webservice.RestAPI;
import com.google.android.material.snackbar.Snackbar;
import org.json.JSONArray;
import org.json.JSONObject;
import java.util.regex.Pattern;
49
Dialog cd;
private UserLoginTask mAuthTask = null;
String uid;
// UI references.
private EditText mUserNameView;
private EditText mPasswordView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
uid = LoginSharedPref.getUidKey(this);
if (uid.length()>0) {
Intent intentLogin = new Intent(this, MainActivity.class);
startActivity(intentLogin);
finish();
}
else {
setContentView(R.layout.login);
getSupportActionBar().hide();
mUserNameView = findViewById(R.id.user);
mPasswordView = (EditText) findViewById(R.id.pass);
Button mEmailSignInButton = (Button) findViewById(R.id.submit);
mEmailSignInButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
50
attemptLogin(view);
}
});
}
}
if(Patterns.EMAIL_ADDRESS.matcher(mUserNameView.getText().toString()).m
atches())
{
if(mPasswordView.getText().toString().length()>0)
{
mAuthTask=new
UserLoginTask(mUserNameView.getText().toString(),mPasswordView.getText()
.toString());
mAuthTask.execute();
}
else
{
Snackbar.make(view,"Enter
Password",Snackbar.LENGTH_SHORT).show();
mPasswordView.requestFocus();
}
}
else
51
{
Snackbar.make(view,"Invalid Email
Address",Snackbar.LENGTH_SHORT).show();
mUserNameView.requestFocus();
}
}
else
{
Snackbar.make(view,"Enter Email",Snackbar.LENGTH_SHORT).show();
mUserNameView.requestFocus();
}
}
@Override
protected String doInBackground(Void... params) {
String result = null;
52
RestAPI restAPI = new RestAPI();
try {
JSONObject jsonObject = null;
jsonObject = restAPI.Rlogin(mUserName, mPassword);
JSONParser jsonParser = new JSONParser();
result = jsonParser.parseJSON(jsonObject);
} catch (Exception e) {
e.printStackTrace();
result = e.getMessage();
}
return result;
}
@Override
protected void onPostExecute(final String result) {
cd.cancel();
Log.d("REPLY login", result);
if (result.contains("Unable to resolve host")) {
AlertDialog.Builder ad = new AlertDialog.Builder(LoginActivity.this);
ad.setTitle("Unable to Connect!");
ad.setMessage("Check your Internet Connection,Unable to connect
the Server");
ad.setNeutralButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
53
});
ad.show();
} else {
try {
JSONObject json = new JSONObject(result);
String ans = json.getString("status");
if (ans.compareTo("false") == 0) {
Snackbar.make(mUserNameView, "Login credentials Incorrect",
Snackbar.LENGTH_SHORT).show();
mPasswordView.requestFocus();
} else if (ans.compareTo("ok") == 0) {
JSONArray jarr=json.getJSONArray("Data");
JSONObject jobj=jarr.getJSONObject(0);
LoginSharedPref.setUidKey(LoginActivity.this,jobj.getString("data0"));
startActivity(new Intent(LoginActivity.this, MainActivity.class));
finish();
} else if (ans.compareTo("error") == 0) {
String error = json.getString("Data");
Toast.makeText(LoginActivity.this, error,
Toast.LENGTH_SHORT).show();
}
} catch (Exception e) {
Toast.makeText(LoginActivity.this, e.getMessage(),
Toast.LENGTH_SHORT).show();
54
}
}
}
}
}
NGO (Login Activity):
package com.android.foodwastage;
import android.Manifest;
import android.app.Activity;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Color;
55
import android.graphics.drawable.ColorDrawable;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import com.airbnb.lottie.LottieAnimationView;
import com.android.foodwastage.R;
import com.android.foodwastage.utils.EmailValidation;
import com.android.foodwastage.utils.LoginSharedPref;
import com.android.foodwastage.webservices.JSONParser;
import com.android.foodwastage.webservices.RestAPI;
import com.google.android.material.snackbar.Snackbar;
import com.google.android.material.textfield.TextInputEditText;
56
import com.google.android.material.textfield.TextInputLayout;
import org.json.JSONArray;
import org.json.JSONObject;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//check for logged in or not
if (!LoginSharedPref.getNidKey(LoginActivity.this).isEmpty()) {
//already loggedin
Intent regIntent = new Intent(LoginActivity.this,
NavigationUserActivity.class);
startActivity(regIntent);
finish();
57
}
setContentView(R.layout.activity_login);
initUI();
}
@Override
public void onClick(View v) {
int id = v.getId();
if (id == R.id.btn_login) {
permissionCheck();
}
hideKeyboard(v);
}
58
private void permissionCheck() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
//dynamic location permission
if (ContextCompat.checkSelfPermission(LoginActivity.this,
Manifest.permission.WRITE_EXTERNAL_STORAGE)
!= PackageManager.PERMISSION_GRANTED) {
//ask for permission since not granted
requestPerm();
Log.d("TAG", "onCreate: shouldShowReq else");
} else {
Log.d("TAG", "onCreate> persmissions granted");
validationAndLogin();
}
}else {
Log.d("TAG", "onCreate> persmissions granted, <M");
validationAndLogin();
}
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[]
permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions,
grantResults);
if (requestCode == RCODE_PERM) {
59
if (grantResults.length == 1 && grantResults[0] ==
PackageManager.PERMISSION_GRANTED) {
//ok
validationAndLogin();
} else {
requestPerm();
}
}
}
60
loginSuccess();
}
61
public void hideKeyboard(View view) {
InputMethodManager inputMethodManager = (InputMethodManager)
getSystemService(Activity.INPUT_METHOD_SERVICE);
inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(),
0);
}
@Override
protected void onPreExecute() {
super.onPreExecute();
startAnimation();
}
@Override
protected String doInBackground(String... strings) {
62
String result;
RestAPI restAPI = new RestAPI();
try {
JSONObject jsonObject;
jsonObject = restAPI.Nlogin(strings[0], strings[1]);
@Override
protected void onPostExecute(String s) {
super.onPostExecute(s);
Log.d("reply", s);
if (s.contains("Unable to resolve host")) {
AlertDialog.Builder ad = new AlertDialog.Builder(LoginActivity.this);
ad.setTitle("Unable to Connect!");
ad.setMessage("Check your Internet Connection,Unable to connect
the Server");
ad.setNeutralButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
63
}
});
ad.show();
} else {
try {
JSONObject json = new JSONObject(s);
String ans = json.getString("status");
Log.d("reply::", ans);
if (ans.compareTo("false") == 0) {
Snackbar.make(frameLayout, "Login credentials do not match",
Snackbar.LENGTH_SHORT).show();
} else if (ans.compareTo("ok") == 0) {
JSONArray array = json.getJSONArray("Data");
JSONObject jsonObject = array.getJSONObject(0);
LoginSharedPref.setNidKey(LoginActivity.this,
jsonObject.getString("data0"));
LoginSharedPref.setNameKey(LoginActivity.this,
jsonObject.getString("data1"));
Intent intentLogin = new Intent(LoginActivity.this,
NavigationUserActivity.class);
startActivity(intentLogin);
finish();
}
Log.i("TAG", "onPostExecute: " +
LoginSharedPref.getNameKey(LoginActivity.this) +
LoginSharedPref.getNidKey(LoginActivity.this));
if (ans.compareTo("error") == 0) {
64
String error = json.getString("Data");
Toast.makeText(LoginActivity.this, error,
Toast.LENGTH_SHORT).show();
}
} catch (Exception e) {
Toast.makeText(LoginActivity.this, "Error : " + e.getMessage(),
Toast.LENGTH_SHORT).show();
}
stopAnimation();
}
}
}
}
Snapshots
Admin Page
65
Resturant Page
NGO Page
66
TESTING
The testing done here was System Testing checking whether the user
requirements were satisfied. The code for the 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 user.
67
Levels of Testing
A series of testing is done for the proposed system before the system
is ready for the user acceptance testing.
✓ 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.
68
✓ 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 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.
69
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.
70
Test Cases
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.
71
ADVANTAGES OF PROJECT
Advantage:
• Needy people will get food to eat.
• Food will not get wasted.
• NGO’s will not be facing food shortage.
Limitations
• This application requires active internet connection.
• User need to put correct data or else it behaves abnormally.
72
Features
1) Load Balancing:
Since the system will be available only the admin logs in the
amount of load on server will be limited to time period of admin access.
2) Easy Accessibility:
Records can be easily accessed and store and other information
respectively.
3) User Friendly:
The application will be giving a very user-friendly approach for all
user.
5) Easy maintenance:
Food Donation App is design as easy way. So maintenance is also
easy.
73
CONCLUSION
This was our project of System Design about “Food Donation App”
developed in Android based on Java language. The Development of this system
takes a lot of efforts from us. We think this system gave a lot of satisfaction to
all of us. Though every task is never said to be perfect in this development field
even more improvement may be possible in this application. We learned so
many things and gained a lot of knowledge about development field. We hope
this will prove fruitful to us.
74
BIBLIOGRAPHY
► Websites
✓ en.wikipedia.org
75