You are on page 1of 55

Sabz Cafe

“An Android Application For Sabzazaar KIU”

Nouman Karim
2015-KIU-0442

Department of Computer Science, Faculty of Natural


Science and Engineering, KIU, Gilgit.
i
Sabz Cafe
“An Android Application For Sabzazaar KIU”

By

Nouman Karim

2015-KIU-0442

A thesis submitted in partial fulfillment of the requirement for the


degree of

BS

in

Computer Sciences

Department of Computer Science, Faculty of Natural Science and


Engineering, KIU, Gilgit
ii
In the Name of Allah Almighty
The Most Beneficent
The Most Merciful

iii
CERTIFICATE OF APPROVAL

This Project “Sabz Cafe” is hereby approved in partial fulfillment of the

requirement for the degree of Bachelor of Science in Computer Sciences

“Department of Computer Sciences, Karakoram International University, Gilgit”

Thesis Supervisor

(Ms. Ponum Almas)

Chairperson/Chairman/HOD

(Aftab Ahmed Khan,


PhD)

External Examiner

(External Examiner)

iv
DECLARATION

I’m dedicate this project is a presentation of our own work and that it has

not been submitted anywhere for any award. I also warrant, that I have not received

outside assistance or involved the external contributions, if received/involved I will

acknowledge in written statement to authorities, otherwise I will be liable for the

cancellation of our thesis thereby the degree that will be awarded.

Signature
Signature

Scholar Name: _____________

Supervisor Name: ____________________


Reg: ______________________

Date: ______________________________
Date: _____________________

v
ACKNOWLEDGMENTS

First of all, I am Thankful to Almighty Allah that I was able to do this project.
After that I want to thank my Parents for supporting me throughout my studies
from the start till now.
My supervisor Ms. Ponum Almas guided me so nicely and helped me to do this
project, I am also very thankful to her.

Nouman Karim

vii
ABSTRACT

Sabz Cafe is based-on Android mobile platform which help user to buy food

items online through an Android based Smart Phone by just sitting anywhere with

the availability of internet connection.

After installing the sabz cafe app, the users have to register and then they

can start looking for the food items of their choice from the list of menus. This

application is only for the Karakoram International University canteen (Sabzazar).

Cafeteria or Canteens play very important role in every schools, colleges, and

universities because it is the place where we can buy and eat to energized ourselves.

Customers (Students, faculty and other staff) went directly to the cafe, place

their order and get food at cafe. Due to increasing number of customers at

sabzazaar, a lot of time is wasted and seating facility is also limited. Therefore, this

app provides another facility to customers of sabzazaar to place their order using

their smart phones, admin process the order, and they can enjoy their order at their

required place within KIU in some clicks.

This app is user friendly, effective and efficient application with significant

facilities for smart phone users.

viii
TABLE OF CONTENTS

CERTIFICATE OF APPROVAL................................................................................................iv
DECLARATION......................................................................................................................v
ACKNOWLEDGMENTS.........................................................................................................vii
ABSTRACT............................................................................................................................viii
TABLE OF CONTENTS...........................................................................................................ix
LIST OF FIGURES..................................................................................................................xii
LIST OF TABLES...................................................................................................................xiv
ACRONYMS AND ABBREVIATION...................................................................................xv
Chapter 1...................................................................................................................................1
INTRODUCTION................................................................................................................1
1.1. Background...........................................................................................................1
1.2. Project Overview..................................................................................................1
1.3. Project Motivation................................................................................................1
1.4. Study Rationale and Relevance.............................................................................2
1.5. Problem Statement................................................................................................2
1.6. Aims and Objective..............................................................................................3
1.7. Main Modules of Project......................................................................................3

1.7.1. Admin Module...................................................................................................3


1.7.2. Customer Module..............................................................................................4
Chapter 2...................................................................................................................................6
REVIEW OF LITERATURE...............................................................................................6
1.1. Introduction to Existing System............................................................................6
1.2. Deficiencies of Existing System...........................................................................6

1.2.1. Heavy Size.........................................................................................................6


1.2.2. Not Compatible.................................................................................................6
1.2.3. Complex............................................................................................................7
Chapter 3...................................................................................................................................8
REQUIREMENT SPECIFICATION...................................................................................8
3.1. Non-Functional Requirements..............................................................................8

3.1.1. Efficient.............................................................................................................8

ix
3.1.2. User Friendly....................................................................................................8
3.1.3. Maintainability..................................................................................................8
3.1.4. Cost and Effective.............................................................................................8
3.2. Functional Requirements......................................................................................8

3.2.1. Login/Authentication........................................................................................8
3.2.2. Check/ Delete Orders........................................................................................9
3.2.3. Add Items...........................................................................................................9
3.2.4. Menu.................................................................................................................9
3.2.5. Setting.............................................................................................................10
3.2.6. Complaint Box.................................................................................................10
3.3 . System Environment.........................................................................................10

3.3.1. Hardware Requirements.................................................................................10


3.3.2. Software Requirements....................................................................................11
3.4. Required Tools and Technologies.......................................................................11

3.4.1. Client Side.......................................................................................................11


3.4.2. Server Side......................................................................................................14
Chapter 4.................................................................................................................................15
SYSTEM DESIGN.............................................................................................................15
4.1. Introduction........................................................................................................15
4.2. System Design....................................................................................................15
4.3. Database.............................................................................................................15

4.3.1. Design of Database.........................................................................................15


4.4. Flowchart............................................................................................................17

4.4.1. Users Flowchart..............................................................................................17


4.4.2. Admin Flowchart.............................................................................................17
4.5. Data Flow Diagram............................................................................................18

4.5.1. Context Level Diagram (level 0).....................................................................18


4.5.2. DFD Level 1....................................................................................................19
Chapter 5.................................................................................................................................20
SYSTEM IMPLEMENTATION........................................................................................20
5.1 . System Architecture..........................................................................................20
Chapter 6.................................................................................................................................21
SYSTEM TESTING AND EVALUATION.......................................................................21
6.1. Introduction........................................................................................................21

x
6.2. Testing................................................................................................................21
6.3. System Testing...................................................................................................21
6.4. Unit Testing........................................................................................................21
6.5. Integration and System.......................................................................................21
6.6. Test Cases...........................................................................................................22
6.7. Screenshots.........................................................................................................27

6.7.1. Client Side.......................................................................................................27


6.7.2 Server Side......................................................................................................36
Chapter 7.................................................................................................................................37
CONCLUSION..................................................................................................................37
REFERENCES........................................................................................................................38
Books References...............................................................................................................38
Websites 39
Appendix A.............................................................................................................................40
Structure of JAVA Coding.................................................................................................40
Appendix B..............................................................................................................................41
Structure of XML in Android Studio..................................................................................41
Structure of Firebase database............................................................................................41

xi
LIST OF FIGURES

Figure 3. 1 Android Studio......................................................................................................11


Figure 3. 2 XML.....................................................................................................................12
Figure 3. 3 JAVA....................................................................................................................13
Figure 3. 4 Firebase.................................................................................................................14
Figure 3. 5 Firebase Database.................................................................................................14
Figure 4. 1 User Flowchart......................................................................................................17
Figure 4. 2 Admin Flowchart..................................................................................................17
Figure 4. 3 Context Diagram...................................................................................................18
Figure 4. 4 Data Flow Diagram...............................................................................................19
Figure 5. 1 System Architecture..............................................................................................20
Figure 6. 1 Android Studio......................................................................................................27
Figure 6. 2 Splash Screen........................................................................................................27
Figure 6. 3 Main Screen .....................................................................................................27
Figure 6. 4 Sign Up Screen.....................................................................................................28
Figure 6. 5 Admin Login ................................................................................................28
Figure 6. 6 User Login .......................................................................................................29
Figure 6. 7 Dashboard .......................................................................................................29
Figure 6. 8 Navigation Drawer................................................................................................30
Figure 6. 9 Item Detail Screen ...........................................................................................30
Figure 6. 10 Search Item ............................................................................................31
Figure 6. 11 User Cart Screen ............................................................................................31
Figure 6. 12 Confirm Order Screen.........................................................................................32
Figure 6. 13 Complaint Box ...............................................................................................32
Figure 6. 14 Profile Setting .................................................................................................33
Figure 6. 15 Dashboard Screen ..........................................................................................33
Figure 6. 16 Admin Order List ...........................................................................................34
Figure 6. 17 Adding Item Screen............................................................................................35
Figure 6. 18 Firebase...............................................................................................................36
Appendix A. 1 Java Codding..................................................................................................39
xii
Appendix B. 1 Android Studio XML.....................................................................................41
Appendix B. 2 Firebase database............................................................................................41

xiii
LIST OF TABLES
Figure 3. 1 Android Studio.....................................................................................................11

Figure 3. 2 XML.......................................................................................................................12

Figure 3. 3 JAVA......................................................................................................................13

Figure 3. 4 Firebase.................................................................................................................14

Figure 3. 5 Firebase Database.................................................................................................14

xiv
ACRONYMS AND ABBREVIATION

SZC SABZ CAFE


SDK SOFTWARE DEVELOPMENT KIT
JDK JAVA DEVELOPMENT KIT
HTTP HYPER TEXT TRANSFER PROTOCOL
RAM RANDOM ACCESS MEMORY
ROM READ ONLY MEMORY
APP APPLICATION
DFD DATA FLOW DIAGRAM
WORA WRITE ONCE RUN ANYWHERE
WIFI WIRELESS FIDELITY
KIU KARAKORAM INTERNATIONAL UNIVERSITY
CS COMPUTER SCIENCES
IT INFORMATION TECHNOLOGY

xv
Chapter 1

INTRODUCTION

1.1. Background
Nowadays everyone has got smart phones in their hands and that too
expensive ones whether they are teenagers, adults or old people.
This has benefitted the mankind a lot and has made lives of everyone easy and
convenient that no one might have ever imagined that things will get this much
simpler and easier. And there are so many social networking websites and application
services which provides almost every type of services and these social networking
websites and apps have took the internet by storm. This Android app is like an
ecommerce apps or websites where we buy some items then the items will be
delivered to our location or address. Once the user will be registered in our app then
the user will easily buy items.
After the delivery of the items the user has to give the extra 10 rupees for the
delivery charges. If you have issues about the item, delivery, or even the prices, then
you should be able to complain by using this app.

1.2. Project Overview


This App is only for the Campus of Karakoram International University
canteen (Sabzazaar) and is based on a new concept. Using this Android Application
user can easily buy food items and also if something is wrong with the items,
delivery or even with the application then the user can easily complain using
complain box option in App.
For the usage of this app the user must be familiar with the installation and
usage of the smart phones because without knowing it one can never use it easily.

1.3. Project Motivation


The number of Smartphone’s users is increasing in Pakistan due to the large
influx of Chinese Smartphone’s brands in the country. According to the latest
statistical data by PTA’s telecom indicators, the number of mobile phone users in
Pakistan has reached 161.183 million, as of May 2019, who wants everything in
mobile phone like ecommerce applications where they don’t have to go to the
Shopping Mall for shopping. So Sabz Cafe is a mobile application and it is like an e-

1
commerce app where we search and buy food items from university cafe, these items
will be delivered to our required location. We are familiar with the need of canteen,
cafes at Schools, colleges and universities and also with the problems of
canteens/cafeteria that the students/employees usually faced. Being a student at KIU I
realized the limitation of services the sabzazaar cafe is providing to their customers
(students, faculty, employees), this point motivated me to develop this APP to
facilitate the customers to place their order in some click at their required place.

1.4. Study Rationale and Relevance


This app will be helpful for students, faculty and admin staff by providing
facility of their required food, at required time on required place. This will save their
time as compare to ordinary manual system. Going to cafe, order and wait for order
delivery wasted a lot of time. There are a lot of issues or the problems which the
students, professors or the staffs are facing nowadays like the distance of the
cafeteria is so far, attending classes at lunch time and also the finance issues.

If a student got minimum time lifted to attend the lecture and at that time,
she/he is too hungry and wants something to eat, then he/she have to go to the
cafeteria, buy something, eat and then attend the lecture, so this way he/she have
to face a problems. The daily cash transaction of the cafeteria is store in cash
book, what if the cash book is lost or is not maintained.

This application will provide the following benefits

 Makes the ordering process easier.


 Efficient customer and order management.
 Free and cheap marketing.
 Better customer’s data.
 The convenience of mobile ordering.
 Get food order at required time and place

1.5. Problem Statement


Sabzazar is a cafe service provider in KIU which provide food services to
faculty, staff and students. Customers go to the sabzazaar, place their order manually,
and wait on seats for their order. Due to increasing number of customers and limited

2
amount of seat sometime it become difficult to place order. Also, it is a time-
consuming process, therefore another facility of online service was always needed.
Everyone is using cell phone therefore an android base application is developed for
sabzazaar KIU, this application facilitates the customers (faculty, students, admin
staff) to search and order food items at their required place on required time. This
application also provides an option of suggestion/complain box to get their customer
feedback on food items and delivery process.

1.6. Aims and Objective


The main objective and aim of this app are:
 To provide the easy access for those people who will not be able to go to
the cafeteria due to some reasons like timing or other issues.
 To search food item and place order using smart phones.
 To provide a convenient and time saving systems so that customers can
order items online instead of going to the cafeteria, the items will be
delivered.
 To store and manage data of the student and the finance or transactions of
cafeteria in the database.

1.7. Main Modules of Project


In this application there will be two main modules. The admin module and the
user module.

1.7.1. Admin Module


This module is only for the admin where the admin check and delete orders and
also the admin has the authority to add some new items from the categories of the items.
Features of the Admin module is given below.
 Login

In this feature the admin will logged in to his dashboard where he will
manage the orders, food items.
 Add Food Items

When the Admin logged in to its dashboard then the first thing, they need to
do is to tap on the one of the categories of the item. After that the admin will have
to write the item name, description, price and for image uploading the admin will

3
have to tap on the image icon.
After filling the fields and image the admin will tap on the ADD
PRODUCT button.
 Customers Order

In this feature the admin will check the new orders from the users and also the
admin has the authority to delete the orders after delivered.
 Maintain Food Items

In this feature the admin has the authority to manage items. For example:
If an item is finished in the cafeteria or not available then the admin will tell
the user that this product isn’t available for now.

1.7.2. Customer Module


In this module the user has to register first and after logged in, if the user wants to
buy some items he/she will easily do that by just clicking on an item or if a user wants to
search an item, he/she will choice the search option from navigation drawer or if a user wants
to edit his profile he/she will choice the setting option from navigation drawer or also if the
user wants to complain about the food, prices or delivery then the user have to choice the
complaint box from the navigation drawer.
Features of the User module is given below.
 Menu
When the user logged in the first screen that appears is the menu, where all the
items will show and if a user wants to buy an item, just tap on one of the items. After tap
on the item the complete detail of the item will be show.
 Cart
In this feature the user can see all the items which the user has ordered. For
adding the new items to the cart list the user has to tap on the one of the items from
the menu after that the new screen will appear then the user has to tap on round Cart
Icon for adding the item.
 Search
In this feature the user can easily search item. This feature is similar but it is
import in android applications because sometimes we don’t have that much time to
scroll up and down to see the item that we want. For search an item the user has to tap
on the search option from the navigation drawer.

4
 Setting
In this feature where user edit his/her profile by tapping the setting option
from the navigation drawer. This feature allows changing phone number, name, address and
picture.
 Complaint Box
If something goes wrong with the items, prices, delivery or with the
application then this feature allows you to submit complains. Most of the android
applications don’t have this feature.

5
Chapter 2

REVIEW OF LITERATURE

1.1. Introduction to Existing System


Nowadays everyone has got smart phones in their hands and that too
expensive ones whether they are teenagers, adults or old people. This has benefitted
the mankind a lot and has made lives of everyone easy and convenient. I have
researched a lot of applications like sabz cafe but I have found few which are quick
similar to this app. Such as Food panda, Hifood and Food Genie. These are one of the
most popular food delivery applications. As time changes things gets changed with
time so these android applications have also to be changed because we live in an era
nowadays where people want simple and convenient things not such things which
takes too much time, and doesn’t even provide proper system. Following are the
deficiencies between this app and those apps.

1.2. Deficiencies of Existing System

1.2.1. Heavy Size


Apps like these have one of the major issues that they are too heavy in size
which takes too much space in your mobile phone storage and also consumes too
much RAM which causes your mobile to load everything slow and even your phone
gets heat up which the users will never want to let it happen with their mobile phones.
Whereas this app is less in size and consumes a very little RAM and can
perform much faster than the other apps.

1.2.2. Not Compatible


Most of the apps are also not compatible with different type of mobile phones
such as if someone is using Android’s version of 4.4 or lower then it will not support
on that version of Android because most of the developers focus only on the high
rated cell phones. And our app will support every kind of Android device so that
everyone will be able to use this app properly.

6
1.2.3. Complex
Most of the apps like this are very complicated to use and every user who are
not so much familiar with mobile phones cannot use those apps easily. While this app
is totally user friendly and very simple to use, almost everyone who has even a
smaller knowledge about smart phones can use this app easily.

7
Chapter 3

REQUIREMENT SPECIFICATION

3.1. Non-Functional Requirements

3.1.1. Efficient
After installing this app on smartphones, it will give the complete solution for
the problem of users in an efficient manner.

3.1.2. User Friendly


This app has been designed very simply and beautifully where any of the user
having such a little knowledge about android device can easily use this app.

3.1.3. Maintainability
As this app is designed in a user-friendly way so its maintenance is very easy
and as we know maintenance is always an important factor in any kind of system.
Users can change their password anytime they want to secure their account and can
also change their personal details so their profiles will always remain up to date.

3.1.4. Cost and Effective


Instead of going by yourself for ordering items the user can simply order the
item using this app so this can save the precious time of the users by quick response.

3.2. Functional Requirements


The application has two actors who will use the app, one will be the admin and
the other one will be the user.
The admin can see every order which has been done by him/her and the admin
can also manage to delete the old bookings through this. The admin will perform the
following procedure to use the application.

3.2.1. Login/Authentication
Description:

This is the first screen after splash in the application. The admin must
be identifying in order to access any options.

8
Functional Requirement:

This screen contains two fields to enter valid details in order to access
dashboard.
 Phone Number
 Password

3.2.2. Check/ Delete Orders


Description:
After accessing the dashboard, the admin will tap on Check Orders
button to see the new orders from the user.

Functional Requirement:
This screen will contain only the orders from the user and if the order
is successfully delivered, the admin has to tap on the order to delete.

3.2.3. Add Items


Description:
The admin has the authority to add new items by tapping on one of the
categories of items on dashboard.
Functional Requirement:
This screen contains three fields, one image icon and a button to enter
valid details in order to add item
 Item Image
 Item Name
 Item Description
 Item price
 Add Item

3.2.4. Menu
Description:
This is the place where all the items will show and if a user wants to buy
an item, just tap on one of the items. After tap on the item the complete detail of
the item will be show.
Functional Requirement:
This screen contains the details of the item and also the Add to cart list
icon.

9
 Item Image
 Item Name
 Item Description
 Item Price
 Item Description
 Added to Cart Button

3.2.5. Setting
Description:
The user will edit his/her profile.
Functional Requirement:
This screen contains the details of the user.
 User Image
 User Phone Number
 User Name
 User Address

3.2.6. Complaint Box


Description:
This is the place where you can complain about the items, prices and
delivery.
Functional Requirement:
This screen contains three text editors and a button.
 Title
 Item
 Description
 Submit

3.3. System Environment

3.3.1. Hardware Requirements


 Processor: Core i3, Processor 2.0 GHz (minimum)
 Hard Disk: 100 GB Hard Drive
 RAM: 4GB (minimum)
 Android Smart Phone: 1GB RAM (minimum), Version 4.4 Kitkat

10
3.3.2. Software Requirements
 Operating System for PC: Windows 8/8.1 or updated
 Operating System for Mobile: Android 4.4 Kitkat or updated
 Tools: Android Studio
 Front end: JAVA, XML
 Back end: Firebase

3.4. Required Tools and Technologies

3.4.1. Client Side

Figure 3. 1 Android Studio

Android Studio IDE is selected to build the front end of application. It is the
official IDE for Android mobile development launched by Google in 2013. This IDE
is the right choice because it is built and tailored for Android mobile development to
make the development process faster and easier. In addition to other related tools, it is
also open source to encourage the development of more and more android
applications, and makes android newcomers easier to learn, especially with the vast
android development community, the community provides thousands of free Online
tutorials and platforms to assist developers.

11
Figure 3. 2 XML

XML full form is Extensible Markup Language. Extensible Markup


Language (XML) is a simple, very flexible text format. Originally designed to meet
the challenges of large-scale electronic publishing, XML is also playing an
increasingly important role in the exchange of a wide variety of data on the Web and
elsewhere [I.]
It is used to store data and transfer data from process to another. It is design to
both human readable and machine readable.
In computing, 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.

 Year Started
1996
 Developed by
World Wide Web Consortium
 Extension
.xml
 Declaration

12
Figure 3. 3 JAVA

JAVA is a very strong language. In Android programing JAVA is use for


back end programming. The extension of java file is “.java”. Java is a general-
purpose computer programming language that is concurrent, class-based, object-
oriented, and specifically designed to have as few implementation dependencies as
possible. It is intended to let application developers “write once, run anywhere”
(WORA)[II.], meaning that compiled Java code can run on all platforms that support
Java without the need for recompilation.
 First Appeared
May 23, 1995; 21 years ago
 Developer
Sun Microsystems (now owned by Oracle Corporation)
 Extension
.java, .class, .jar
 Versions
i. JDK 1.0 (January 23, 1996)
ii. JDK 1.1 (February 19, 1997)
iii. J2SE 1.2 (December 8, 1998)
iv. J2SE 1.3 (May 8, 2000)
v. J2SE 1.4 (February 6, 2002)
vi. J2SE 5.0 (September 30, 2004)
vii. Java SE 6 (December 11, 2006)
viii. Java SE 7 (July 28, 2011)
ix. Java SE 8 (March 18, 2014)
 Example
“Hello world”
The traditional "Hello, world!" program can be written in Java as:

13
Figure 3.4. 1 Java Code

3.4.2. Server Side

Figure 3. 4 Firebase

Firebase first product was the Firebase Real-time Database, an API that
synchronizes application data across IOS, Android, and Web devices, and stores it on
Firebase’s cloud. The product assists software developers in building real-time,
collaborative applications. It is a mobile and web application development platform
developed by Firebase, Inc. in 2011, then acquired by Google in 2014 .[III.] As of
October 2018, the Firebase platform has 18 products, [IV.] which are used by 1.5million
apps.[V.] Firebase is a NoSQL database, it is just a big JSON object where we will be
able to store our data. Unlike SQL there’s no schema for the database, no tables, no
columns, its’ just a combination of key/value pairs. For example

Figure 3. 5 Firebase Database

This figure shows database of sabz cafe.

14
Chapter 4

SYSTEM DESIGN

4.1. Introduction
System designing is an important part of every system and application in this
chapter we will discuss the front-end and back-end design of our Android application
Sabz Cafe.

4.2. System Design


As we already know that the main objective of this app is to provide a facility
where people can easily order items on time and also provide them such facility
where the users can complain about the items, prices and delivery.
This app is only developed on Android based operating system so only
Android smart phone users can use this app. Moreover, this app has been designed in
such a way that it takes way too much less space in your smart phones and does not
affect on the speed of RAM of the phone.

4.3. Database

4.3.1. Design of Database


Database is main and very important part of every application as it stores all
the information and data of any application. Size of database depends upon size of
data stored. Following are the main features of the Firebase database.
 Firebase Auth
Firebase Auth is a service that can authenticate users using only client-side
code. It supports social login providers Facebook, GitHub, Twitter and Google
Additionally, it includes a user management system whereby developers can enable
user authentication with email and password login stored with Firebase.[VI.]
 Firebase Cloud Firestore
On January 31st 2019, Cloud Firestore was officially brought out of beta ,
[VII.]

making it an official product of the Firebase line-up. It is the successor to Firebase’s


original data basing system, Real-time Database, and allows for nested documents and
fields rather than the tree-view provided in the Real-time Database.

15
 Firebase Storage
Firebase Storage provides secure file uploads and downloads for Firebase
apps, regardless of network quality. The developer can use it to store images, audio,
video, or other user-generated content. Firebase Storage is backed by Google Cloud
Storage. [VIII.]
 Firebase Hosting
Firebase Hosting is a static and dynamic web hosting service that lanched on
May 13, 2014. It supports hosting static files such as CSS, HTML, JavaScript and
other files, as well as support through Cloud Functions. [IX.]
The service delivers files
over a content delivery network (CDN) through HTTP Secure (HTTPS) and Secure
Sockets Layer encryption (SSL). Firebase partners with Fastly, a CDN, to provide the
CDN backing Firebase Hosting. The company states that Firebase Hosting grew out
of customer requests; developers were using Firebase for its real-time database but
needed a place to host their content. [X.][XI.]
 Crashlytics
Crash Reporting creates detailed reports of the errors in the app. Errors are
grouped into clusters of similar stack traces and triaged by the severity of impact on
app users. In addition to automatic reports, the developer can log custom events to
help capture the steps leading up to crash. [XII.]
Before acquiring Crashlytics, Firebase
was using its own Firebase Crash Reporting.
 Firebase Test Lab
Firebase Test Lab for provides cloud-based infrastructure for testing Android
and ios app. With one operation, developers can initiate testing of their apps across a
wide variety of devices and device configurations. Test results—including logs,
videos, and screenshots—are made available in the project in the Firebase console.
Even if a developer hasn’t written any test code for their app, Test Lab can exercise
the app automatically, looking for crashes. [XIII.]

16
4.4. Flowchart

4.4.1. Users Flowchart


Below this figure shows the flowchart of user activities for sabz cafe app.

Figure 4. 1 User Flowchart

4.4.2. Admin Flowchart


Below this figure shows the flowchart of admin activities for sabz cafe app.

Figure 4. 2 Admin Flowchart

17
4.5. Data Flow Diagram
A data flow diagram (DFD) is a graphical representation of the "flow" of
data through an information system, modeling its process aspects. A DFD is often
used as a preliminary step to create an overview of the system without going into
great detail, which can later be elaborated.
 External Entity
External entity is an outside system which is used to receive or send data or
information to the system
Round corner rectangle is used to represent external entities.
 Process
Process changes data produce an output based on computations or sort data
based on logic. Short labels are used to describe the process such as “locate”. Oval
shapes are used to show a process.
 Data Store
File and repositories that store data and information for later use.
 Data Flow
Data flow is the routes through which data are transferred between different
entities. Data flow represented by a line with arrow head.

4.5.1. Context Level Diagram (level 0)


DFD level 0 also known as context diagram is the basic overview of any
system or process which is to be analyzed.
It is a high-level view of any system it is designed to at a glance view of
system showing single high-level process with the relationship to external entities.
It should be understandable by a wide audience including developers,
stakeholders and business analysts etc.
Below this figure shows the flow of user and admin activity.

Figure 4. 3 Context Diagram

18
4.5.2. DFD Level 1

Below this figure shows the flow of user and admin activity.

Figure 4. 4 Data Flow Diagram

19
Chapter 5

SYSTEM IMPLEMENTATION

5.1. System Architecture


The system architecture includes how the app has been designed and on which
programming languages, frameworks and backend tools it has been developed. Sabz
Cafe main architecture has been based on Java Programming language as the Android
operating system supports Java Programming language. Moreover, its designing part
where the user interacts with the device so that part is based on XML (Extensible
Markup Language).
And the main part which we call the backend where all the database of the user
is stored is based on firebase. Firebase is a NoSQL database; it is just a big JSON
object where we will be able to store our data. Unlike SQL there’s no schema for the
database, no tables, no columns, its’ just a combination of key/value pairs. In our
case, Firebase database takes care of processing requests (HTTP) coming from the
client tier regarding the data stored on the Real Time Firebase Database to be then
returned and displayed on the client side. And also, it takes care of ensuring that the
authentication is done successfully. Below this figure shows the system architecture.

Figure 5. 1 System Architecture

20
Chapter 6

SYSTEM TESTING AND EVALUATION

6.1. Introduction
Before launching any app, testing and implementation is very important
process because through this step, we get to know whether the application is working
properly or not and working according to our requirements. To check the
functionalities, we put some inputs and observe the output of the system to check if
there are any bugs or errors in the application so it can be removed. The main purpose
of this phase is to check the overall functionalities and fulfill the user requirements.

6.2. Testing
Before handover the application or any system to users. The developer or
programmers of that application/system have to test the application in order to check
the defects in the application and the application is working properly or not. If any
defect or bug is found then it needs to be removed first and this process will repeat
until every small bug is removed. If the developer is satisfied with the process then
testing process will end and the application will be ready to handover to the end-user.

6.3. System Testing


Sabz Cafe application contains many modules and units. All units Add items,
Search items, Messages, Settings and Complaint Box display have been tested under
different calculation units and got proper output as we expected from this application.

6.4. Unit Testing


Each unit of Sabz Cafe service was gone through testing and each unit is
giving proper output with its all functionalities. It has been tested many times during
development phase. Data is inputted to all modules to ensure that the user’s
requirement is fulfilled.

6.5. Integration and System


At last we check all the sub components of the system. The purpose is to

21
ensure that the integrated sub-components are giving proper functions or not. System
iteration is the process through which sub-components are combined together to make
a whole one system. So that here this test had implemented and results are according
to the functions what are required.

6.6. Test Cases


Test case #1

Software: Sabz Cafe Modulation: User Activity

User Interface: Login Operation: User Login

Precondition: User must be registered.

Table 1

Action Input Expected Output Status

Type valid phone 03144451062 Login to the app with Pass


number and password appropriate permission and
12345678
and click login button. redirected to the user
dashboard.

Type valid phone 03144451062 Display error message Pass


number and keep “password field can’t be
password empty and empty”
click login button.

Type invalid phone 03144455566 Display error message “Invalid Pass


number and password phone no. and password, try
87654321
and click login button. again. ”

Keep email and Display error message “Fields Pass


password empty and can’t be empty”
click login button

Table 6. 1: Test case #1

Above this figure shows the test results of user registration in sabz cafe app.

22
Test case #2

Software: Sabz Cafe Modulation: User Dashboard Activity

User Interface: Dashboard Operation: Select Items

Table 2

Action Input Expected Output Status

Select Food items Chips, Samosa Food Items will store in the Pass
from the dashboard. user cart list.

If not selected food Cart list will empty Pass


items from the
dashboard.

Table 6. 2 Test case #2

Above this figure shows the test results of dashboard in sabz cafe app.

Test case #3

Software: Sabz Cafe Modulation: User Activity

User Interface: Cart List Operation: Sending Items

Table 3

Action Input Expected Output Status

If Cart List have at Chips, Click on Confirm Order Pass


least one item. Button, it will display a
Computer
message “Your Order has been
Then type the Science, Room
successfully placed, you will
description. 211.
receive a confirmation
message”.

If Cart List is empty. Display error message “Please Pass

23
add Food items from the
dashboard”

Table 6. 3 Test case #3

Above this figure shows the test results of cart list in sabz cafe app.

Test case #4

Software: Sabz Cafe Modulation: User Activity

User Interface: Logout Operation: User Logout

Precondition: User must be logged in.

Table 4

Action Input Expected Output Status

Click logout Option Logout User redirected to the Login Pass


from the Navigation Activity
Drawer

Table 6. 4 Test case #4

Above this figure shows the test results of user sign out in sabz cafe app.

Test case #5

Software: Sabz Cafe Modulation: Admin Activity

Admin Interface: Login Operation: Admin Login

Table 5

Action Input Expected Output Status

Type valid phone 03401259977 Login to the app with Pass


number and password appropriate permission and
11223344
and click login button. redirected to the Admin

24
dashboard.

Type valid phone 03401259977 Display error message Pass


number and keep “password field can’t be
password empty and empty”
click login button.

Type invalid phone 03144455566 Display error message “Invalid Pass


number and password phone no. and password, try
87654321
and click login button. again. ”

Keep email and Display error message “Fields Pass


password empty and can’t be empty”
click login button

Table 6. 5 Test case #5

Above this figure shows the test results of login activity in sabz cafe app.

Test case #6

Software: Sabz Cafe Modulation: Admin Activity

Admin Interface: Check Orders Operation: Check Orders

Table 6

Action Input Expected Output Status

If Order list have at Send a message to the user Pass


least one user order.
“Your items will be arrived
within 5 min”.

If Order list is empty. Display error message “Order Pass


List is empty.”

Table 6. 6 Test case # 6

Above this figure shows the test results of user orders in sabz cafe app.

25
Test case #7

Software: Sabz Cafe Modulation: Admin Activity

User Interface: Logout Operation: Admin Logout

Precondition: Admin must be logged in.

Table 7

Action Input Expected Output Status

Click logout Option Logout Admin redirected to the Login Pass


from the Dashboard Activity.

Table 6. 7 Test case #7

Above this figure shows the test results of admin sign out in sabz cafe app.

26
6.7. Screenshots

6.7.1. Client Side

Figure 6. 1 Android Studio

 Splash
The figure 6.2 is the first screen that appears when the application is
launched. It just contains the logo of the application.

Figure 6. 2 Splash Screen

27
 Main Screen

This Figure 6.3 is the Main Screen that appears after the splash screen. If you
are not registered yet, you should tap on the GET STARTED button and if you
already registered, just tap on the LOGIN button.

Figure 6. 3 Main Screen Figure 6. 4 Sign Up Screen

 Sign Up Screen
The Figure 6.4 is the Sign-Up screen where you have to create your account.

28
 Login Activity
The Figure 6.5 and Figure 6.6 is the Login screens for user and admin, where
you have to type phone number and password to use sabz cafe application.

Figure 6. 5 Admin Login Figure 6. 6 User Login

29
 User Activity
The Figure 6.7 is the Main Screen/Dashboard for user and it contain all the list
of food items, where users have to select the desired items.

Figure 6. 7 Dashboard Figure 6. 8 Navigation Drawer

The Figure 6.8 is the Navigation Drawer Screen; it contains a lot of options for
the user such as Cart, Search, Setting, Complaint Box and Logout.

30
The Figure 6.9 is the Item Detail Screen that appears when you tapped on the
item from main screen. It contains item name, description, price and increment
decrement button. This button shows the quantity of the item/product.

Figure 6. 9 Item Detail Screen Figure 6. 10 Search Item

The Figure 6.10 is the Search Item Screen for user which allows you to search
an item. To search an item, you have to capitalize the first letter of the item name and
then tap on the search button.

31
The Figure 6.11 is the Cart Screen, which contain all the items which you
selected from main screen/ dashboard and the Figure 6.12 is the Confirm Order
Screen, where you have to type your name, phone number and the location of your
where you want your order to be delivered.

Figure 6. 11 User Cart Screen Figure 6. 12 Confirm Order Screen

32
The Figure 6.13 is the Complain Screen, which allows you to complain about
items, prices, delivery, or even with the app then this screen allows you to submit you
complain to the admin.

Figure 6. 13 Complaint Box Figure 6. 14 Profile Setting

The Figure 6.14 is the User Profile Setting Screen for user, which allows you
to edit your profile.

33
 Admin Activity
The Figure 6.15 is the Dashboard Screen for the admin. It allows the admin to
view and delete the users order and also adding new food items.

Figure 6. 15 Dashboard Screen Figure 6. 16 Admin Order List

The Figure 6.16 is the Order Screen; it contains all the orders of the users.

34
The Figure 6.17 is the adding new items screen for admin. It appears when you
tapped on one of the collection of items from dashboard. For adding new item, you
have to type the new item name, description, price and also the image.

Figure 6. 17 Adding Item Screen

35
6.7.2 Server Side
 Firebase
This is the firebase database screen, where all users and the admin data store in
JSON format.

Figure 6. 18 Firebase

36
Chapter 7

CONCLUSION

In the end we can conclude that this Sabz Cafe app can make the whole
system easy for those people who want something for lunch, instead of going to the
cafeteria.
The main idea of this project was to provide such service for the students,
professors and staff, who don’t want to miss their class or don’t want to waste their
time by going to the cafeteria.
So, this app can help those people by just registered to this app. After the
registration and login, the user dashboard will be appeared, this is the screen where
user will select the item and the item will be delivered within 3 or 5min.

37
REFERENCES

Books References

I. “XML and Semantic Web W3C Standards Timeline” Dblab.ntua.gr.


Retrieved 14 August 2016.
II. "Write once, run anywhere?” Computer Weekly. May 2, 2002.
Retrieved 2009-07-27.
III. Tamplin, James. "Firebase is Joining Google!". Firebase, Inc.
Retrieved October 22, 2014.
IV. "Firebase Products". Firebase, Inc. Retrieved October 31, 2018.
V. Ma, Francis. "What's new at Firebase Summit 2018". Firebase, Inc.
Retrieved October 31, 2018.
VI. "Firebase Auth". Firebase, Inc. Retrieved May 19, 2016.
VII. "NoSQL for the serverless age: Announcing Cloud Firestore general
availability and updates". Google Cloud Blog. Retrieved 2019-04-30.
VIII. "Firebase Storage". Google Developers. Retrieved 2016-05-28.
IX. dynamic Node.js support through Cloud Functions
X. Lardinois, Frederic (May 13, 2014). "Firebase Adds Web Hosting To
Its Database Platform". TechCrunch. Retrieved June 12, 2014.
XI. Novet, Jordan (May 13, 2014). "Firebase adds hosting to make app
development even easier". VentureBeat. Retrieved June 12, 2014.
XII. "Firebase Crash Reporting". Google Developers. Retrieved 2016-05-
28.
XIII. "Firebase Test Lab for Android". Google Developers. Retrieved 2016-
05-28.

38
Websites

https://www.webopedia.com/TERM/J/Java.html

https://stackoverflow.com/

https://www.w3.org/XML/

http://www.theserverside.com/definition/Java

https://simple.wikipedia.org/wiki/Java_(programming_language)

https://en.wikipedia.org/wiki/Firebase

https://gonehybrid.com/firebase-database-best-practices/

https://www.techjuice.pk/mobile-phone-users-in-pakistan-crosses-161-

million-mark/

39
Appendix A

Structure of JAVA Coding

Appendix A. 1 Java Codding

40
Appendix B

Structure of XML in Android Studio

Appendix B. 1 Android Studio XML

Structure of Firebase database

Appendix B. 2 Firebase database

41

You might also like