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

VISVESVARAYA TECHNOLOGICALUNIVERSITY

BELAGAVI, KARNATAKA, INDIA

A MINI-PROJECT REPORT
ON

“FEED-FOOD WASTE MANAGEMENT


APP”
Submitted in partial fulfillment of the requirement for the VI semester BE in
Information Science and Engineering
Mobile application development mini-project-18CSM6P68
Submitted by
SAHANA A [1SG18IS089]
SUHANA S [1SG18IS109]

Under the guidance of


Prof. VEENA DHAVALGI
Assistant Professor
Dept. of I.S.E., S.C.E.

DEPARTMENT OF INFORMATION SCIENCE & ENGINEERING


SAPTHAGIRI COLLEGE OF ENGINEERING
Bengaluru-57
2020-21
SAPTHAGIRI COLLEGE OF ENGINEERING
14/5, Chikkasandra, Hesaraghatta Main Road, Bengaluru-560057
[AFFILIATED TO VISVESVARAYA TECHNOLOGICAL UNIVERSITY, BELAGAVI]

Department of Information Science & Engineering

CERTIFICATE
Certified that the project work entitled “FEED- FOOD WASTE MANAGEMNET
APP” carried out by SAHANA A [1SG18IS089], SUHANA S [1SG18IS109] bonafide
students of 6th semester, department of Information Science & Engineering carried out at
our college Sapthagiri College of Engineering, Bengaluru in partial fulfillment for the 6th
Semester BE, MOBILE APPLICATION DEVELOPMENT Mini-Project-18CSMP68 by
Visvesvaraya Technological University, Belagavi during the year 2020-21. It is certified
that all corrections/suggestions indicated for Internal Assessment have been incorporated in
the Report deposited in the departmental library. The project report has been approved as it
satisfies the academic requirements in respect of Project work prescribed for the said Degree.
.

Signature of the Guide Signature of the HOD

Prof. Veena Dhavalgi Dr H R Ranganatha

Assistant Professor HOD, I.S.E., S.C.E.

External Viva
Name of the Examiners Signature of the Examiners with date
1. …………………………………… 1.………………………..
2. …………………………………… 2.…………………………
ABSTRACT

Food wastage is increasingly becoming a topic of concern due primarily to the negative impact
it has on the economic and agricultural industry. Research has shown that in many countries,
households seems to be the highest producers of food waste and some of this, is as a result of
food being disposed because they are expired. The main objective of this application was to
provide a viable solution that allows mobile users to track the life cycle of their food inventory
efficiently. If anyone has wastage foods, they can enter their food quantity details and their
details in that application. The donator can create the account and whenever they are having
wastage food, they can login. The receiver will also login and can see the food details and the
location of the foods can also be seen by the receiver. This project is can be an enormously
successful social innovation that tackles food waste and food poverty if applied and used
correctly with some enhancements.
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 app is an internet-based android
application that basically aims at charity through donations.
ACKNOWLEDGEMENT

Any achievement doesn’t depend solely on the individual efforts but on the guidance,
encouragement and co-operation of intellectuals, elders and friends. A number of
personalities have helped us. We would like to take this opportunity to thank them all.

We would like to express our heart-felt gratitude to Dr. H Ramakrishna, Principal,


Sapthagiri College of Engineering, Bengaluru, for his help and inspiration during the tenure
of the course.

It is great privilege to extend our deep sense of gratitude to Dr. H R Ranganatha, Head of
the Department, Information Science and Engineering, Sapthagiri College of Engineering,
Bengaluru, who patronized throughout our career, for his constant support and
encouragement and for the facilities provided to carry out this work successfully.

We wish to express our sincere thanks to our guide Prof. Veena Dhavalgi, Assistant
Professor, Department of Information Science and Engineering, Sapthagiri College of
Engineering, Bengaluru for helping us throughout and guiding us from time to time. We
also extend our sense of gratitude and sincere thanks to non-teaching staff members of
Information Science and Engineering, Sapthagiri College of Engineering, Bengaluru for
their views and encouraging ideas.

Finally, we also thank our family and friends for their co-operation and motivation.

SAHANA A (1SG18IS089)

SUHANA S (1SG18IS109)
TABLE OF CONTENTS

Chapter 1: INTRODUCTION 1

Chapter 2: SYSTEM ANALYSIS 5


2.1 Literature Survey 5
2.2 Existing System 5

2.3 Proposed System 6


2.3.1 Scope of the Project 6
2.3.2 Aim of the Project 7

Chapter 3: REQUIREMENT SPECIFICATIONS 8

3.1 System Requirements 8

3.1.1 Hardware Configuration 8

3.1.2 Software Configuration 8

3.2 Development Environment 8

Chapter 4: SYSTEM DESIGN 11

4.1 Project Flow Chart 11

4.2 Design using XML 12

Chapter 5: SYSTEM IMPLEMENTION 18

Chapter 6: SNAPSHOTS 23

CONCLUSION AND FUTURE ENHANCEMENT 31


REFERENCES 32
LIST OF FIGURES

Figure No. Figure name Page No.

3.1 STRUCTURE LAYOUT OF ANDROID STUDIO 09

4.1 FLOW CHART OF THE PROJECT 11

4.2.1 SPLASH SCREEN DESIGN 12

4.2.2 GRID VIEW DESIGN 14

6.1 OPENING SCREEN 23

6.2 SIGN-IN SCREEN 24

6.2 SIGN-UP SCREEN 25

6.3 DONATIONS OR RECEIVERS SCREEN 26

6.4 MY FOOD DONATIONS SCREEN 27

6.5 FOOD AVAILABILITY SCREEN 28

6.6 SELECTED FOOD DETAILS SCREEN 29

6.7 DONAR LOCATION SCREEN 30


Mobile Application Development

CHAPTER 1

INTRODUCTION

1.1 PROJECT OVERVIEW

Food is one of the main human needs. Though food is the source of energy obtained. In its
development, food today is not only used as a filler of energy needs, but more than that food
has become an art and has added value. Food is the major thing for the survival of human
beings. The main concern in today’s world is the wastage of food. More than 900 million
tons of food sold to households, retailers, restaurants and other food services were wasted
in 2019. Instead of wasting the foods it can be distributed to the group of people who suffer
due to hunger.

The platform used is Android which is an open-source technology that can help in better
availability of the environment for the user. It is a completely free and easy to use mobile
Application.

1.2 MOBILE APPLICATION DEVELOPMENT

Mobile application development is the process of creating software applications that run
on a mobile device, and a typical mobile application utilizes a network connection to
work with remote computing resources.

HISTORY:

The first mobile phones were invented whose microchips required the most basic
software to send and receive voice calls.
On 3rd of April 1973, Martin Cooper of Motorola made the first call on the
mobile phone to Dr.Joel S. Engel of the Bell Labs.
The R&D department of IBM Simon came up with the first mobile app for
Smartphones in 1993 exactly two decades after the first call was made.

Department of ISE 2020-21 Page 1


Mobile Application Development

EPOC, first operating system developed by Psion, released in the early 90s, this was
first of the recognizable apps.
Palm OS, developed by Palm Inc. in the year 1996, these were mainly designed for
personal digital assistants and were known as Garnet OS.
The wireless markup language was specifically designed for devices that were
dependent on XML and could be run across wireless application protocols.
Java ME or J2ME or JME – it was first introduced as JSR 68. It was given various
shapes and forms for use via Phones, embedded devices, and even PDAs.
Symbian, developed by Symbian Ltd, which was a joint venture from Ericsson,
Motorola, Nokia and PSION, this was a further developed version of PSION EPOC
OS.
Later on, the smartphones and iPhones that we use today evolved, making lives a
lot easier for people.

ADVANTAGES:

Improves Efficiency.

Offers High Scalability.

Secures the App Data.

Easy to Maintain.

Improves Customer Relationship.

Facilitates New Client Data Retrieval.

Provides Real-time Project Access.

Ease in Project Management.

1.3 ANDROID STUDIO


Android Studio is the official Integrated Development Environment (IDE) for Android app
development, based on IntelliJ IDEA software. It provides the fastest tools forbuilding apps
on every type of android device. It is a purpose-built for android to accelerate the
development and helps to build the highest-quality apps for every android device.

Department of ISE 2020-21 Page 2


Mobile Application Development

FEATURES:

A flexible Gradle-based build system.

A unified environment where one can develop for all Android devices.

Apply Changes to push code and resource changes to the running app without
restarting the app.
Extensive testing tools and frameworks.

Lint tools to catch performance, usability, version compatibility, and other


problems C++ and NDK support.
Built-in support for Google Cloud Platform, making it easy to integrate Google
Cloud Messaging and App Engine.

1.4 JAVA

Java is an object-oriented programming language created by James Gosling, Mike


Sheridan, and Patrick Naughton in 1991. It is a high-level, class-based language that is
designed to have a few implementation dependencies as possible. It is a general-purpose
programming language intended to let android developers run the compiled Java code on
all platforms that support Java without any need for recompilation.

FEATURES OF JAVA:

Simple: Java is designed to be easy to learn.

Secure: With Java’s secure feature it enables to develop virus-free, tamper-free


systems. Authentication techniques are based on public-key encryption.

Architecture-neutral: Java compiler generates an architecture-neutral object file


format, which makes the compiled code executable on many processors, with the
presence of Java runtime system.
Portable: Being architecture-neutral and having no implementation dependent
aspects of the specification makes Java portable. The compiler in Java is written in
ANSI C with a clean portability boundary, which is a POSIX subset.
Robust: Java makes an effort to eliminate error-prone situations by emphasizing
mainly on compile time error checking and runtime checking.

Department of ISE 2020-21 Page 3


Mobile Application Development

Multithreaded: With Java’s multithreaded feature it is possible to write programs


that can perform many tasks simultaneously. This design feature allows the
developers to construct interactive applications that can run smoothly.
Interpreted: Java byte code is translated on the fly to native machine instructions
and is not stored anywhere. The development process is more rapid and analytical
since the linking is an incremental and light-weight process.
High Performance: With the use of Just-In-Time compilers, Java enables high
performance.

Distributed: Java is designed for the distributed environment of the internet.

Dynamic: Java is considered to be more dynamic than C or C++ since it is designed


to adapt to an evolving environment. Java programs can carry an extensive amount
of run-time information that can be used to verify and resolve accesses to objects at
run-time.

1.5 XML

Extensible Markup Language (XML) is a markup language that defines a set of rules for
encoding documents in a format that is both human-readable and machine-readable. The
design goals of XML focus on simplicity, generality, and usability across the Internet. It
is a textual data format with strong support via Unicode for different human languages.
Although the design of XML focuses on documents, the language is widely used for the
representation of arbitrary data structures such as those used in web services.

FEATURES OF XML:

XML focuses on data rather than how it looks.

Easy and efficient data sharing.

Compatibility with other markup language HTML.

Supports platform transition.

Allows XML validation.

Adapts technology advancements.

XML supports Unicode.

Department of ISE 2020-21 Page 4


Mobile Application Development

CHAPTER 2

SYSYTEM ANALYSIS

2.1 LITERATURE SURVEY

The use of mobile devices such as, smartphone or tablets has increased significantly in the
past decade. All these devices use Applications that are created for them. These
Applications can provide many different services including, social media, music streaming,
video streaming, online shopping, and video games. Some of these apps need to be
constantly connected to the internet to function properly, while others can work offline. A
mobile app or most commonly known simply as an app refers to an Application Software
that is created to be run on a mobile device such as, smartphone or tablets.

The sharp increase in the amount of wastage in terms of food, clothes, books, etc. makes
the need for charity in terms of donation. This app presents ‘Helping Hands’, a new
internet-based application that provides a platform for donating old stuff and leftover food
to all needy people/organizations. Food is important for physical and mental well-being. It
is more than just a primary factorfor survival for some, for others, it is a major factor which
can change a grumpy mood into frivolous one. There is huge group of community who
suffer and die due to hunger. A small amount of food can be of a great help to them for
their survival.

To find a proper source of food availability is difficult. That’s why we havecome up with
the idea of FEED food waste management app which provides receiver of the availability
of food that the donar has donated. In today’s this app can help people survive.

2.2 EXISTING SYSTEM


In existing system if anyone have extra food because of any function or in their home it will
be become waste because instantly there is no way to share with anyone if they are having
lots of food. Even if they want to give that extra food to any orphanage or poor people they
don’t have time or don’t have an idea about that. So that we have create a application for
sponsor that extra food to poor people or nearby orphanage.

Department of ISE 2020-21 Page 5


Mobile Application Development

2.3 PROPOSED SYSTEM


In proposed system we are reduce that food wastage using that application. This project is
food redistribution is an enormously successful social innovation that tackles food waste and
food poverty. The donar enters the details of the foods through this application using the app
“FEED- FOOD WASTE MANAGEMENT APP” then provide to nearest orphanages or poor
people. After entering the details of the food the details are visible to the receiver through this
way we can reduce food wastage problem. The proposed application is android-based,
developed on Android Studio using java and xml requires internet connection and will provide
a platform for donars and seekers after they successfully register into the system. If a user
wishes to donate something, he/she can enter that in application. The user interface of this
system will be simple and user-friendly, and the targeted system is android. At present, we
are aiming to avoid the major wastage that usually happens in India and that is foodstuffs.

2.3.1 SCOPE OF PROJECT

The purpose of creating this Application is to eradicate hunger in the most possible way.
FEED is a real-time app which aims to reduce wastage of food. In this app, any person can
register themselves as a user and either donate or receive food. Whenever a user donates
food, it gets sorted in the real-time database. Information is retrieved from the database.
Information is retrieved from the database every time any user wants to receive food. The
one who wishes to receive is then directed to Google Maps for Location of the donar. The
Food waste management app is an Android Application which provides the donars to
donate the food and the receivers to receive the food. The donar has to login and then enter
the details of the food which includes their name, place, phone number, the name of the
food they have and the quantity of the food they have.

Department of ISE 2020-21 Page 6


Mobile Application Development

ADVANTAGES:

Reduces the food wastage

Ease of Use and Implementation.

Structured UI.

Offline availability of foods.

The system has a friendly user interface for quick and easy Navigation.

The app houses a collection of foods integrated within the app itself, which the
receiver can access anytime.

Provided with relevant information.

2.3.2 AIM OF THE PROJECT

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.
Our aim is to help eradicate the hunger in today’s world and provide food to every living
individual.

Department of ISE 2020-21 Page 7


Mobile Application Development

CHAPTER 3

REQUIREMENT SPECIFICATION

3.1 SYSTEM REQUIREMENTS

3.1.1 Hardware Configuration

Processor: Intel(M) Core™ CPU @ 2.30Ghz on Windows® 10 64-Bit

RAM: 8GB (IDE + Android SDK + Android Emulator)/ 4GB (minimum)

Memory: 256GB Hard drive

Keyboard: MS compatible keyboard

Mouse: MS compatible mouse

3.1.2 Software Configuration

Operating system: Windows® 10 64-Bit

Tool kit: Android SDK (Software development kit), Java development kit (JDK)

IDE: Android Studio

3.2 DEVELOPMENT ENVIRONMENT

ANDROID PROGRAMMING LANGUAGES: In Android, basically, programming is


done in two languages JAVA or C++ and XML (Extension Markup Language). Nowadays
KOTLIN is also preferred. The XML file deals with the design, presentation, layouts,
blueprint, etc. (as a front-end) while the JAVA or KOTLIN deals with theworking
of buttons, variables, storing, etc. (as a back-end).

ANDROID COMPONENTS:
Department of ISE 2020-21 Page 8
Mobile Application Development
Activities: It deals with the UI and the user interactions to the screen. In other words, it is
a User Interface that contains activities.
Services: Services are the background actions performed by the app; these might be long-
running operations. A service might need other sub-services so as to perform specific tasks.
Content Provider: Content Provider is used to transferring the data from one application
to the others at the request of the other application.

Broadcast Receivers: A Broadcast is used to respond to messages from other applications


or from the System. For example, when the battery of the phone is low, then the Android
OS fires a Broadcasting message to launch the Battery Saver function or app, after receiving
the message the appropriate action is taken by the app.

STRUCTURAL LAYOUT OF ANDROID STUDIO:

SNAPSHOT 3.1: STRUCTURE LAYOUT OF ANDROID STUDIO

Department of ISE 2020-21 Page 9


Mobile Application Development

Manifest Folder: Android Manifest is an XML file that is the root of the project source
set. It describes the essential information about the app and the Android build tools, the
Android Operating System, and Google Play. It contains the permission that an app might
need in order to perform a specific task. It also contains the Hardware and the Software
features of the app, which determines the compatibility of an app on the Play Store. It also
includes special activities like services, broadcast receiver, content providers, package
name, etc.

Java Folder: The JAVA folder consists of the java files that are required to perform the
background task of the app. It consists of the functionality of the buttons, calculation,
storing, variables, toast (small popup message), programming function, etc. The number
of these files depends upon the type of activities created.

Resource Folder: The res or Resource folder consists of the various resources that are used
in the app. This consists of sub-folders like drawable, layout, mipmap, raw, and values. The
drawable consists of the images. The layout consists of the XML files that define the user
interface layout. These are stored in res.layout and are accessed as R.layout class. The raw
consists of the Resources files like audio files or music files, etc. These are accessed
through R.raw.filename.values are used to store the hardcoded strings (considered safe to
store string values) values, integers, and colors.

Gradle Files: Gradle is an advanced toolkit, which is used to manage the build process that
allows defining the flexible custom build configurations. Each build configuration can
define its own set of code and resources while reusing the parts common to all versions of
the app.

Department of ISE 2020-21 Page 10


Mobile Application Development

CHAPTER 4

SYSTEM DESIGN

4.1 PROJECT FLOW

FIG 4.1: FLOW CHART OF THE PROJECT

Once the app is installed in the android mobile phone, the user will be able to open
the app and the sign in page appears on the screen as the app starts. If the user has as account
then he can enter the details and login into the donations and receiver page. In case the user
doesn’t have an account then he will have to click on the signup page will be redirected to
the signup page. Once his account is created then he will be directly redirected to the
donations and receiver page. The donar has to click on My Food Donations to enter the
details of the food he has. The receiver has to click on the Food Receiver to look for the
leftover food. Once the receiver has selected the food, he will be redirected to the location
page i.e. the google maps.

Department of ISE 2020-21 Page 11


Mobile Application Development

4.2 DESIGN USING XML

4.2.1 Splash Screen design

FIG 4.2.1: SPLASH SCREEN

A splash screen is mostly the first screen of the app when it is opened. It is a constant screen
which appears for a specific amount of time, generally shows for the first time when the app is
launched. The Splash screen is used to display somebasic introductory information such as the
company logo, content, etc. just beforethe app loads completely.
 ImageView class is used to display any kind of image resource in the android
application either it can be android.graphics.Bitmap or
android.graphics.drawable.Drawable (it is a general abstraction for anything that
can be drawn in Android).
 LinearLayout is a view group that aligns all children in a single direction,
vertically or horizontally. All children of a LinearLayout are stacked one after the
other, so a vertical list will only have one child per row, no matter how wide they
are, and a horizontal list will only be one row high (the height of the tallest child,
plus padding). A LinearLayout respects margins between children and the gravity
(right, center, or left alignment) of each child.

Department of ISE 2020-21 Page 12


Mobile Application Development

Activity_main.xml:

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


<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<ImageView
android:id="@+id/imageView"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="#000010"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"

app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/logo"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

Department of ISE 2020-21 Page 13


Mobile Application Development

4.2.2 Grid View design

FIG 4.2.2: GRID VIEW

 A GridView is a type of AdapterView that displays items in a two-dimensional


scrolling grid. Items are inserted into this grid layout from a database or from an
array. The main function of the adapter in GridView is to fetch data from a
database or array and insert each piece of data in an appropriate item that will be
displayed in GridView.
 An adapter acts like a bridge between a data source and the user interface. It
reads data from various data sources, coverts it into View objects and provides it
to the linked Adapter view to create UI components.
 ListSelector: It is a drawable used to indicate the currently selected item in the
list.
Activity_second.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:weightSum="2.0"
>
<Button

Department of ISE 2020-21 Page 14


Mobile Application Development

android:id="@+id/donate"
style="?attr/buttonBarButtonStyle"
android:layout_width="match_parent"
android:layout_height="305dp"
android:layout_weight="1"
android:background="@drawable/myfooddonation"
android:textColor="#4da7ff"
android:textSize="30sp" />
<Button
android:id="@+id/recieve"
style="?attr/buttonBarButtonStyle"
android:layout_width="match_parent"
android:layout_height="297dp"
android:background="@drawable/receiver"
android:layout_weight="1"
android:textColor="#4da7ff"
android:textSize="30sp"
/>
</LinearLayout>

Department of ISE 2020-21 Page 15


Mobile Application Development

4.2.3 Strings

A string resource provides text strings for the application with optional list styling and
formatting. String array is a XML resource that provides an array of strings.

Strings.xml:

<resources>
<string name="app_name">FEED</string>
<string name="title_activity_register">RegisterActivity</string>
<string name="your_name">Your name</string>
<string name="food_name">Food name</string>
<string name="contact_number">Contact number</string>
<string name="donate">Donate</string>
<string name="food_quantity">Food quantity</string>
</resources>

4.2.4 Manifest

Android Manifest is an XML file that is the root of the project source set.

AndroidManifest.xml:

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


<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:dist="http://schemas.android.com/apk/distribution"
package="com.example.feed">

<dist:module dist:instant="true" />

<uses-permission android:name="android.permission.INTERNET" />


<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="com.sec.android.provider.badge.permission.WRITE" />

Department of ISE 2020-21 Page 16


Mobile Application Development
<uses-permission android:name="com.sec.android.provider.badge.permission.WRITE" />

<application
android:allowBackup="true"

android:icon="@drawable/logo"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".DisplayActivity"></activity>
<activity android:name=".RecieveActivity" />
<activity android:name=".DonateActivity" />
<activity
android:name=".RegisterActivity"
android:label="@string/title_activity_register"
android:theme="@style/AppTheme.NoActionBar" />
<activity android:name=".SecondActivity" />
<activity android:name=".FirstActivity" />
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

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


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

</manifest>

Department of ISE 2020-21 Page 17


Mobile Application Development

CHAPTER 5

SYSTEM IMPLEMENTATION

5.1 MAIN ACTIVITY:

 An intent is to perform an action on the screen. It is mostly used to start activity,


send broadcast receiver, start services and send message between two activities.
There are two intents available in android as Implicit Intents and Explicit Intents.
Here is a sample example to start new activity with old activity.
 Android Bundles are generally used for passing data from one activity to another.
Basically here concept of key-value pair is used where the data that one wants to
pass is the value of the map, which can be later retrieved by using the key.
Bundles are used with intent and values are sent and retrieved in the same fashion,
as it is done in the case of Intent. It depends on the user what type of values the
user wants to pass, but bundles can hold all types of values (int, String, boolean,
char) and pass them to the new activity.
 An Adapter View is capable of displaying millions of items on the User Interface,
while keeping the memory and CPU usage very low and without any noticeable
lag. The data source or dataset can be an Array object, a List object etc. The
ListView and GridView are subclasses of AdapterView and they can be populated
by binding them to an Adapter, which retrieves data from an external source and
creates a View that represents each data entry.
 A listener (or observer) is an abstract class or interface that is used to provide
functionality for an interactable UI component (e.g., a button). It is a part of the
observer design pattern that detects any events related to the UI; for example,
clicking or tapping a part of the screen executes a certain action. Every listener
has a function (callback method) that is overridden when implementing a concrete
listener.

Department of ISE 2020-21 Page 18


Mobile Application Development
MainActivity.java:
package com.example.feed;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

public class MainActivity extends AppCompatActivity {

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

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


@Override
public void run() {
Intent intent = new Intent(MainActivity.this, FirstActivity.class);
startActivity(intent);
finish();
}
},2000);
}
}

5.2 SPLASH SCREEN:

A splash screen is mostly the first screen of the app when it is opened. It is a constant
screen which appears for a specific amount of time, generally shows for the first time
when the app is launched. The Splash screen is used to display some basic introductory

Department of ISE 2020-21 Page 19


Mobile Application Development
information such as the company logo, content, etc just before the app loads completely.

SplashScreen.java:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<ImageView
android:id="@+id/imageView"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="#000010"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"

app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/logo"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

5.3 GEO LOCATION ACTIVITY:

A data class representing a geographic location.A location may consist of a latitude,


longitude, timestamp, and other information such as bearing, altitude and velocity.All
locations generated through locationmanager are guaranteed to have a valid latitude,
longitude, and timestamp (both UTC time and elapsed real-time since boot). All other
parameters are optional.

Department of ISE 2020-21 Page 20


Mobile Application Development
Geolocation activity.java:
package com.example.feed;
import android.Manifest;
import android.content.Context;
import android.content.pm.PackageManager;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.widget.Toast;
import androidx.core.content.ContextCompat;
class GeoLocation implements LocationListener {
Context context;
public GeoLocation(Context c) {
this.context = c;
}
public Location getLocation() {
LocationManager lm = (LocationManager)
context.getSystemService(Context.LOCATION_SERVICE);
assert lm != null;
boolean onGPS = lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
if (onGPS) {
if
(ContextCompat.checkSelfPermission(context,Manifest.permission.ACCESS_FINE_LOCATI
ON) != PackageManager.PERMISSION_GRANTED ){
return null;
}
lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 6000, 10, this);
Location l = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);
return l;
}
else{
Toast.makeText(context,"Enable GPS",Toast.LENGTH_SHORT).show();
}
return null;
Department of ISE 2020-21 Page 21
Mobile Application Development
}
@Override
public void onLocationChanged(Location location) {
}
@Override
public void onStatusChanged(String s, int i, Bundle bundle) {
}
@Override
public void onProviderEnabled(String s) {
}
@Override
public void onProviderDisabled(String s) {
}
}

Department of ISE 2020-21 Page 22


Mobile Application Development

CHAPTER 6

SNAPSHOTS
6.1. Opening screen.

SNAPSHOT 6.1: OPENING SCREEN

As the user opens the app, opening screen i.e., Splash Screen appears until the app loads
completely. It displays the app logo.

Department of ISE 2020-21 Page 23


Mobile Application Development

6.2. Sign-in Screen

SNAPSHOT 6.2: SIGN-IN SCREEN

After the app is loaded, the sign-in screen appears. In this screen the user has to enter his
details if he has an account already created. If he a fresh or a new user the he will have
an option called sign up. If he clicks that the he will be redirected to the sign-up screen.

Department of ISE 2020-21 Page 24


Mobile Application Development

6.3. Sign-up Screen

SNAPSHOT 6.3: SIGN-UP SCREEN

If the user is new to this app then he will have to create an account or he will have to register
himself with this app either to make the donations or to receive the food. Once he enters his
details then he can go to the donations or receivers screen.

Department of ISE 2020-21 Page 25


Mobile Application Development

6.4. Donations or Receivers Screen

SNAPSHOT 6.4: Donation or Receiver Screen

Here the user can see the two options. One says “My food donations” where the user can
donate the food he has and the other is “Food Receiver” where the person who is in need for
the food can search for the it.

Department of ISE 2020-21 Page 26


Mobile Application Development

6.5. My Food Donations Screen

SNAPSHOT 6.5: FOOD DONATION SCREEN

This screen askes for the details of the donar and also the details of the food he has. The
donar has to enter the name of the donar, name of the food he has, the quantity of food
he has, and his phone number. Then there is an option called DONATE, by clicking this
option the donar donates the food

Department of ISE 2020-21 Page 27


Mobile Application Development

6.6. Food Availability Screen

SNAPSHOT 6.6: FOOD AVAILABILITY SCREEN

Here the food receivers can see the list of foods that are available. He can then select one food
among them.

Department of ISE 2020-21 Page 28


Mobile Application Development

6.7. Selected Food Details Screen

SNAPSHOT 6.7: SELECTED FOOD DETAILS SCREEN

Once the receiver has selected the food from the list of foods, he will be directed to the page
where he can see the details of the donar and the food and the quantity. There is also an option
called “VIEW LOACTION”, by clicking this option the receiver will be redirected to Google
Maps which shows the exact location of the donar.

Department of ISE 2020-21 Page 29


Mobile Application Development

6.8. Donar Location Screen

SNAPSHOT 6.8: DONAR LOCATION SCREEN

Once the receiver clicks the option “VIEW LOCATION”, he will be directed to the Google
Maps where he can see the location of the donar.

Department of ISE 2020-21 Page 30


Mobile Application Development

CONCLUSION AND FUTURE ENHANCEMENT

The proposed application shall reduce food wastage and also fulfill other requirements of food.
As mentioned above 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 donars (reducing the carbon footprint and
wastage), and the needy
In future work,
 There was no standard food information system on food packages that gives the user
the information of both the name of the food, as well as its expiry date.
 The viable improvement would be getting the food name from the product bar code and
read the expiry date using OCR tools.
 However, the level of ease of using this option is only slightly greater than using the
manual option of filling the food information.
 Some companies have started trials with using QR code on their food packages to
provide detailed information.
 Not with standing, there is still lot of hurdles to pass for it to become a standard. But for
the meantime, this application presents a viable and effective solution

Department of ISE 2020-21 Page 31


Mobile Application Development

REFERENCES

1) www.google.com

2) www.youtube.com

3) www.github.com

4) www.w3schools.com

5) www.tutorialspoint.com

6) https://developer.android.com

7) https://ijcsmc.com/docs/papers/October2019/V8I10201907.pdf

Department of ISE 2020-21 Page 32

You might also like