Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Final Thesis Smart Home Food Delivery App

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

Government Polytechnic, Murtizapur

Institute Code: 1241

Department of Computer Engineering


Project Report on

“Smart Home Food Delivery App”


Subject: -Capstone Project (22060)

GUIDED BY: -
Prof. H.P.Gathode
(Lecturer in Computer Engineering)

SUBMITTED BY:-

Roll No. Name Enrollment


No.
46 Nitin Ravindra Thakare 1912410046

42 Salim Aajam Shaikh 1912410042

09 Rohan Ramkrushna Aru 1912410003

35 Aditya Gajanan Mundhe 1912410046


CERTIFICATE
This is to certify that the Project Report on

SMART HOME FOOD DELIVERY APP


Is a bonafide work and it is submitted to
Maharashtra State Board of Technical Education
By
Nitin Ravindra Thakare 1912410046

Salim Aajam Shaikh 1912410042

Rohan Ramkrushna Aru 1912410003

Aditya Gajanan Mundhe 1912410046

For partial fulfillment of the


Diploma in Computer Engineering
Smart Home Food Delivery App
Sixth Semester

During the academic year 2021 – 2022


Under the guidance of
Prof. H.P.Gathode

Name of Guide External Examiner


Prof. H.P.Gathode

Prof. V.D.Kale Dr.P.M.Bhansali


Head Department of CO Principal

Department of Computer Engineering


Government Polytechnic, Murtizapur
2021-2022
ACKOWLEDGEMENT

We take this opportunity to express our profound gratitude and the whole
hearted thanks to our project guide, Prof H.P.Gathode, LECTURER,
DEPARTMENT OF COMPUTER ENGINEERING, for her valuable guidance,
kind suggestions and constant encouragement and providing us the opportunity
to work in an exciting and challenging field of Android Application. Our in
interaction with him has been of immense help in defining our project goal and
in identifying ways to achieve the goal.
We are also very much indebted to, head Prof V.D.KALE HEAD OF
DEPARTMENT OF COMPUTER ENGINEERING for motivation and effective
support. We also thank all Non- Teaching Staff of the Department for their
comment and opinions and above all valuable guidance and timely
suggestion to accomplish the project dissertation .
Last but not the least, we would like to thank all our friend who helped us
directly or indirectly for the success of our project and the team spirit shown by
all has made a project report work successful.

Nitin Ravindra Thakare


Salim Aajam Shaikh
Rohan Ramkrushna Aru
Aditya Gajanan Mundhe
ABSTRACT
The aim of the project was to build a responsive online application for restaurant which
helps customers to order foods online. Along with this, the application needs to be responsive
as the application can be accessed through devices with different size of screens. One of big
problem while ordering online is trust. Social media App play a vital role to attract customers
and make trust on their mind. Hence, Google Map API is integrated to the application. So,
customers trust the quality and attract to order online when they see the reviews and likes of
their friends and relatives who used the service earlier. To address these functionalities, a
deep research has been made on the earlier works for automating the food ordering
processes.
Android framework has been used to develop the backend of the system and CMP
framework used for developing the responsive frontend. After developing the system,
different testing methods have been used to find bugs in the system and ensure the quality.

Keywords QR Code, Smart Parking, Slot Allocation, Android Application.


Index

Sr. No Chapter No. Description

1.1. Preface
1.2. Motivation
1.3. Problem Statement
1 Chapter 1: 1.4. Objectives of project
INTRODUCTION 1.5. Scope and
Limitations of project
1.6. Organization of
Report

Chapter 2: 2.1. Literature Review


2 LITERATURE REVIEW

3.1Software Requirements
3.2 Functional
Requirement
Chapter 3:
3.3 Non-Functional
3 REQUIREMENTS Requirements
3.4 Hardware
Requirements
3.5Database
3.6 Programming
Language
4 Chapter 4: 4.1. Methodology
METHODOLOGY
5.1. 5.1 Working Module
5.2. 5.2 Working Of Drone
Base
5.3. 5.3 User System
Interaction
5.4. 5.4 Location Tracking
5.5. 5.5 Route
5.6. 5.6 Advantages Of
Proposed System
5 Chapter 5 :
5.7. 5.7 Software Platform
RELATED WORK Used
5.8. 5.7.1 Smart Food
Shopping App Android
Application
5.9. 5.7.2 Admin/Restaurant
Android Application.
5.7.3 Code: XML Code

6 Chapter 6: RESULT 6.1 Result And


Application
AND
APPLICATION

7 Chapter 7: FUTURE 7.1 Future Scope


SCOPE

8 Chapter 8: 8.1 Conclusion


CONCLUSION And Future
Work

9 Chapter 9: 9.1 References


REFRENCES
Smart Home Food Delivery App

Chapter 1

INTRODUCTION

This chapter deals with the problem statement that we are intending to solve, the
objectives of our project, the future work that can be done and the limitations of our
project.

1.1 Preface

Most cities in India, suffers from the day-to-day nightmare of traffic congestion.
Currently, the ongoing construction in various parts of the city is makingit difficult for
delivery executives to reach their destination on time, and this isespecially turning out
to be the proverbial Achilles’ heel for many of food-related startups in the city
.However, a company has decided to tackle this problem by flying right over it [1]

They have decided to implement drones to make sure that the food you have
ordered, reaches you hot and fresh! The company has divided Lucknow into 4 zones,
and each zone has its own hub. The food reaches the hub from the restaurant via road,
and the drone then takes the package from one hub to the destination hub, from where
another delivery executive takes the food to the Smart Food Shopping App’s house. But
in theseprocess authentication is not provided.[1]

The existing technology that we studied is called “AMAZON PRIME AIR”


which uses IOT and android application for the delivery of parcel.[7]

The proposed method as we call it the “Smart Food Shopping App” uses IOT
and android application and overcomes almost all the limitations of the existing
methods.

This project can be divided into 3 modules: -

 Tracking Smart Food Shopping App location

 Provide authentication

 Feedback and returned to its original location.

Government Polytechnic, Murtizapur Page | 1


Smart Home Food Delivery App

 In the first module, by using GPS system, admin will track the location of Smart Food
Shopping App.
 In the second module, to reach the parcel of food to the right Smart Food
Shopping App we have provided an authentication by using Location verification.
 In the final module, after releasing the parcel of food to the authenticated Smart
Food Shopping App, the driver will return to its original position.

1.2 Motivation
Polytechnic and Engineering as we all know is the application of science to the
optimum conversion of the resources of nature to the uses of human kind. Engineering
has evolved a lot since its inception and lots of problems has been solved by creating its
applications. But there are still many problems unsolved and so we started our research
to find that one problem which really needed development. During this investigation,
we came across the problem of “authentication” and how it is still an unresolved issue.
Therefore, we started to explore more about it and got to know that the existing solution
is quite ineffective and costly too. This made us think that how can we propose a
system that will be both efficient and cost effective?

Finally, we came up with the idea that we call the “SMART FOOD SHOPPING
APP” which works on Android App. Though there’s much work needed to make the
proposed system more efficient, however it will surely be an immense improvement
in the existing solutions.

1.3 Problem Statement


Just as E-commerce Website like Amazon, Flipkart and food delivery Apps like
Zomato, Swiggy and UberEats has very pick point of delivering the parcel that it need
lots of delivery men. To overcome the cost of delivery we can use this app instead of
delivery man. This service has lack of security.[5]

Drones have recently become a promising solution for rapid parcel delivery due
to advances in battery technology and navigation systems. Drones have inherited
limitations in battery capacity and payload, which make their efficient operation and
management a critical problem for a successful delivery system. Adopting modularity
in the drone design can provide operational benefits to increase overall fleet readiness
Government Polytechnic, Murtizapur Page | 2
Smart Home Food Delivery App

and reduce overall fleet size. We propose an optimization method for security purpose.
Drones can save delivery time and energy consumption during a delivery operation over
manual delivery system.

Smart Food Shopping App’s current location is important for sending the parcel
by drone using navigation System. In this project our main objectives is based on
security. Aim of the project is to deliver the parcel to authenticate Smart Food
Shopping App. Authentication will be done by security parameters. By taking feedback
of authenticate user the drone will return back to its location.

1.4 Objectives of project


i. To provide quick food delivery service as per Smart Food Shopping Apps need.
ii. To provide an authentication to the user to reach the parcel of food to the
rightSmart Food Shopping App using verification.
iii. To reduce the traffic congestion and to save valuable time.

1.5 Scope and Limitations of project


A] Scope
i. Fast and Secure Delivery

ii. Not Much man power used

iii. Road Traffic is reduced, means Pollution is reduced.

B] Limitations
i. Non-modular drone is unavailable for delivery for more than one hour
whenrecharging the battery.
ii. Drones can carry products up to 2 kg.

iii. If the drone strike is happened then it will affect public health due to
theirchemical contents.
iv. Heavy rain resilient and withstand damage from bad weather and animals.

v. Autonomous accident avoidance while flying at high speeds.

vi. Direct Drone Communications using cellular networks.

Government Polytechnic, Murtizapur Page | 3


Smart Home Food Delivery App

1.6 Organization of Report


Chapter 1: Introduction of the Project and the problem statement
Chapter 2: Survey of the research work that has already done.
Chapter 3: The detailed problem statement and the use case of the proposed
methodology.

Chapter 4: Design work needed for the proposed solution.


Chapter 5: Implementation and installation of the required software and hardware.
Chapter 6: Conclusion of the project.

Government Polytechnic, Murtizapur Page | 4


Smart Home Food Delivery App

Chapter 2

2.1 LITERATURE SURVEY


Sr. no Title Author Publication Background

Package delivery Aditya International The aspect of this journal


system using GPS Bhardwaj Journal of is the future of
1
drones Achira Basu Engineering technology. The manual
Dr. A.Senthil Research & delivery will not be able
Selvi Technology to satisfy the demands of

(IJERT) human race in the future.

A Hardware/
Software Pablo royo IEEE This paper presents an
Architecture for Enrich pastor embedded
2 Conference
UAV Payload and hardware/software
paper
Mission Control architecture specially
designed to be applied on
mini/micro unmanned
aerial vehicles

Joint Ground and Sawadsitang, IEEE We have proposed the


Aerial Package S., Niyato, D., Transactions joint ground and aerial

3
Delivery Services Tan, P.-S., & on Intelligent delivery service
Wang, P. Transportatio optimization and
(2018). n Systems planning (GADOP)
framework.

Government Polytechnic, Murtizapur Page | 5


Smart Home Food Delivery App

Drones for Simran Brar Berkeley These paper includes the


Deliveries university of information about the
california current players and

4 Ralph Rabbat technology related to


drones

Vishal
Raithatha

George Runcie
Andrew Yu
Analysis of Faculty of This study proposes an
environmental Engineering, alternative
impacts of drone King implementation of online
delivery on an Jarotwan Mongkut's Shopping delivery
5 online shopping Koiwanit Institute of systems in which
System Technology Smart Food Shopping
Apps can get their
Ladkrabang, groceries at their
Bangkok doorstep within a short
10520, period of time.
Thailand

Table 1: Literature survey

Government Polytechnic, Murtizapur Page | 6


Smart Home Food Delivery App

Chapter 3
REQUIREMENTS
3.1. Software Requirements:
 Window 8.1 or above
 RAM 4 GM Minimum
 HDD 500
 SDD 256
 XAMPP
 POSTMAN
 Android Studio
 NotePad++

3.2 Functional Requirement:


1. The app should be able to let the Smart Food Shopping App to make registration, login and
edit account.
2. The app should be able to detect the current location of the tracker before Smart Food
Shopping App giving an order
2. The app should be able to detect the current location of the tracker of Restaurant at the time of
dashboard.
4. The app should be able to guide the Restaurant at the time of food delivery to the Smart Food
Shopping App using Smart Food Shopping App location.
5. The app should be able to provide two-ways communication for the Restaurant to
communicate with their Smart Food Shopping App as needed.
6. The app should be able to trigger an alert whenever the tracker is entering or leaving the set
geo-fence.
7. The app should be able to trace the history of the route went through by the tracker.

Government Polytechnic, Murtizapur Page | 7


Smart Home Food Delivery App

3.3 Non-Functional Requirements:


1. The location of the tracker should be retrieve when order given by Smart Food Shopping App
at outdoor in a stable GPS and network connection.
2. The alert should be trigger with the maximum allowed delay of not more than 5s.
3. The server must have a minimum up-time of 99%.
4. The system should be able to cope with minimum 50 user connection.

3.4. Hardware Requirements:


1. Minimum 4 GB Ram
2.500 GB HDD
3.256 SDD
4. Keyboard
5.Compatible Mouse

3.5 Database

1. My SQL
2. PHP Web Service

3.6 Programming Language

1. Java
2. XML
3. CPP
4. C
5. PHP
6. MYSQL

Government Polytechnic, Murtizapur Page | 8


Smart Home Food Delivery App

Chapter 4
4.1 METHODOLOGY
The process used to collect data and information for the purpose of making decision.
Methodology includes research, questionnaire, interviews, observation, survey, case studies and
etc. suitable methodology should be identify for the successful implementation of system since
involves development process and phases. The aim of the research is to collect data and
information from the user (Customer) by direct interview session and distribute the questionnaire
about proposed system which is Child Tracking System. By conducting this method some
problem could be clarified. This research will be focus on analyses user.

Information gather can come from a range of sources. There are variety of techniques to use
when gathering primary data and information. The method used to propose systems are interview
and questionnaire. The questionnaire is distributed to several parents through by hand since this
system proposed for parents themselves. The result from the questionnaires collect generates it
into graph. Interview is involves direct questioning to certain parents.

In this project, all the data were collected from user (Customer) will be analyze to get the
solution for the problem and design the solution they need as the information gather from
interview and questionnaire. The method for analyses data is by using Google Docs. Google
Docs can import, create, edit and update documents in various fonts and file formats, combining
text with formulas, lists, tables and images. By using Google Docs, the questionnaire has been
done smoothly. Using Google Docs can analyze the result by statistics, pie chart, graph and
comment.

Government Polytechnic, Murtizapur Page | 9


Smart Home Delivery

Chapter 5

RELATED WORK

5.1 Working Module

Flowchart of Working Module of Drones. The base or the warehouse receives


signal for the dispatch of the package. The base then transfers the signal to the allotted
drone. It flies out rising to a higher altitude to avoid obstacles and disturbances. The
path is set to the delivery location and the drone tarts towards its destination. After it
flies to the higher altitude, the drone is provided with the immediate location of the
Smart Food Shopping App and it is constantly updated that is it tracks the location as it
moves towards its destination. According to the architecture diagram, the GPS position
of the distribution point will be read by the drone. After reading the exact position it
will continuously monitor the current location and take it away from the base. It will fly
tothe delivery point and confirm the package to the correct Smart Food Shopping App
by asking for the OTP sent to the verified device. After confirmation it will deliver the
package and take it back from the delivery point to the base. In case the OTP is not
valid that is, it does not verify, the drone will not lower itself and fly back to the base.
The process will repeat itself until the package is reached to its Smart Food Shopping
App.[2]

Figure 1: Base interaction with Smart Food Shopping App

SSGMCE, Shegaon Page | 10


Smart Home Delivery

5.2 Working Of Drone Base

The working of drone base. This is an abstract of a drone base created in a


particular area that will operate in a specific zone. In case the delivery location is out of
its boundary it will communicate with nearest bases. Then it delivers the packageto
the nearest base to the delivery location. Figure 6 shows how the base communicates
with the Smart Food Shopping App and sends a drone with the required package on its
path to deliver it to the Smart Food Shopping App. The drone will deliver the package
to the Smart Food Shopping App only if it is 100 meters within the delivery location
(the location provided at the timeof order).[1][2]

Figure 2: Drone Base

SSGMCE, Shegaon Page | 11


Smart Home Delivery

5.3 User System Interaction

The user system interaction Long distance vehicles carrying more payloads require
more energy and batteries for each unit of travel. Larger multi-stop vehicles carry more
battery and payload and pay for it in drag. Vehicles are conservatively sized to be able
to traverse the entire delivery route and return to the fulfillment centerwith all packages.
The burden of irreversible packages increases with each additional package and with
compounds. On the delivery date the information is sent to the Smart Food Shopping
App’s phone and he updates the system with either his live location. If the payment is
received on delivery the drone collects the payment in a safe-box installedin the central
controlling head. The drone reached the users location but before lowering itself, the
OTP is confirmed. The drone has to be provided with a unique feature so that there is
no interchange with some other Smart Food Shopping App's packages to ensure that the
Smart Food Shopping App will be provided with a code during the creation of the
package on its designated route. As soon as the package reaches the Smart Food
Shopping App, the code will be asked and matched to the number given in the drone. In
this way delivery of the correct package will be assured.[1]

Figure 3: User System Interaction

SSGMCE, Shegaon Page | 12


Smart Home Delivery

5.4 Location Tracking


Figure 9 shows the location tracking. The location tracking is an important part of this
project to ensure confirm and correct delivery of the package to the Smart Food
Shopping App. The location tracking of the Smart Food Shopping App will work in
two parts. First the Smart Food Shopping App will provide their location at the time of
ordering the product. Then package will be transferred to the nearest main warehouse
of that city, and then it will be further transferred to the nearest sub warehouse of the
locality. The drones will then take thepackage from the nearest warehouse and fly to
the location of the Smart Food Shopping App provided at the time of ordering the
product. The drones will track the Smart Food Shopping App’s location through his
phone and he should be present within the 100 meters of the provided location, only
then the package will delivered otherwise it drone will itself cancel thedelivery and fly
back to the warehouse from where it picked up the package.[4]

Figure 4: Location Tracking Flowchart

SSGMCE, Shegaon Page | 13


Smart Home Delivery

5.5 Route
In Food delivery system, the drones will not be travelling on the present features of the
map because they only provide navigation through the road but drones requires a
different route that is it have to fly over buildings and reach location as fastas they can.
The drones will be provided with different route just like flights. Flights have their own
route to travel from one city to another. The drones will be provided with same route as
flight but on small scale that is within the city. They will fly over buildings and cover
the shortest distance to reach their Smart Food Shopping App.[4]

Figure 5: Drone Route

SSGMCE, Shegaon Page | 14


Smart Home Delivery

5.6 Advantages Of Proposed System


Efficiency of proposed method over other methods of package delivery:

 It is fast and reliable

 It has the features on in hand delivery

 It will avoid thefts and hassle faced by Smart Food Shopping App

 Smart Food Shopping App will not have to wait in a fixed location to collect the parcel

 It is robust and spontaneous

 Very efficient over short distances

 Can be controlled with gestures if modified.

 Self-updating of user location.

SSGMCE, Shegaon Page | 15


Smart Home Delivery

5.7 Software Platform Used

5.7.1 Smart Food Shopping App Android Application


In this Android Application, we have to first register the restaurants in the area. When
there is some sufficient types of restaurants are registered then we can launch our Smart
Food Shopping App application publically. Public can see the restaurants of nearby area
and offers given by them.

Process to Order:
5.7.1.1 Create account

5.7.1.2 Search product which you like

5.7.1.3 Add to card

5.7.1.4 Enter a shipping address

5.7.1.5 Payment Information

5.7.1.6 Submit Order

SSGMCE, Shegaon Page | 16


Smart Home Delivery

Figure 6: Login Activity Figure 7: Registration Activity

SSGMCE, Shegaon Page | 17


Smart Home Delivery

Figure 8: Menu page Figure 9 Product page

SSGMCE, Shegaon Page | 18


Smart Home Delivery

Figure 10: Set Location Activity Figure 11 : Address Activity

SSGMCE, Shegaon Page | 19


Smart Home Delivery

Figure 12: Payment Activity Figure 13: Profile Page

SSGMCE, Shegaon Page | 20


Smart Home Delivery

Figure 14: Review

SSGMCE, Shegaon Page | 21


Smart Home Delivery

5.7.2 Admin/Restaurant Android Application.

Process of Registration by Restaurant:

5.7.2.1 Monitoring on Smart Food Shopping App all activities

5.7.2.2 Warehouse Receive Signal

5.7.2.3 Allocate signal to drone

5.7.2.4 Path is set to delivery location

5.7.2.5 Constantly update

5.7.2.6 Verify the Smart Food Shopping App

5.7.2.7 Dispatch the product

5.7.2.8 Take it back to base point

SSGMCE, Shegaon Page | 22


Smart Home Delivery

Figure 15: Sign Up Figure 16: Homepage

SSGMCE, Shegaon Page | 23


Smart Home Delivery

Figure 17: View Order

SSGMCE, Shegaon Page | 24


Smart Home Delivery

Figure 18: Restaurant Location Figure 19: Order Location

SSGMCE, Shegaon Page | 25


Smart Home Delivery

5.7.3 Code: XML Code

activity_splash.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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=".SplashScreen"
android:background="@drawable/backgroundsplash"
>

<ImageView
android:layout_width="150dp"
android:layout_height="150dp"
android:id="@+id/circle1"
android:src="@drawable/circle"
android:layout_marginLeft="-50dp"
android:layout_marginTop="-20dp"/>

<ImageView
android:layout_width="120dp"
android:layout_height="120dp"
android:id="@+id/circle2"
android:src="@drawable/circletransparant"
android:layout_toRightOf="@+id/circle1"
android:layout_marginTop="-20dp"
android:layout_marginLeft="-50dp"
android:background="@drawable/circletransparant"/>

<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_centerInParent="true"
android:id="@+id/img_logo"
android:src="@drawable/logo"/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/txt_title"
android:layout_below="@+id/img_logo"
android:gravity="center"
android:text="Smart Home Delivery"
android:textSize="24dp"
android:textColor="@color/mehdi_color"
android:textStyle="bold"
android:fontFamily="sans-serif-condensed-medium"/>

<ImageView
android:layout_width="150dp"
android:layout_height="150dp"
android:id="@+id/circle3"
android:src="@drawable/circle"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginRight="-50dp"

SSGMCE, Shegaon Page | 26


Smart Home Delivery

android:layout_marginBottom="-20dp"/>

<ImageView
android:layout_width="120dp"
android:layout_height="120dp"
android:id="@+id/circle4"
android:src="@drawable/circletransparant"
android:layout_alignParentBottom="true"
android:layout_toLeftOf="@+id/circle3"
android:layout_marginBottom="-20dp"
android:layout_marginRight="-50dp"/>

</RelativeLayout>

activity_login.xml

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


<RelativeLayout 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=".LoginScreen"
tools:ignore="VectorDrawableCompat">

<androidx.appcompat.widget.Toolbar
android:id="@+id/bgHeader"
android:layout_width="match_parent"
android:layout_height="220dp"
android:background="@drawable/header_login"
android:elevation="5dp" />

<TextView
android:id="@+id/tvDesc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginTop="40dp"
android:elevation="5dp"
android:text="Welcome"
android:textColor="@color/colorWhite"
android:textSize="17sp" />

<TextView
android:id="@+id/tvLogin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tvDesc"
android:transitionName="tvLogin"
android:layout_alignLeft="@+id/tvDesc"
android:elevation="5dp"
android:text="Login to unloack awesome food"
android:textColor="@color/colorWhite"
android:textSize="16sp"
android:textStyle="bold" />

<ImageView
android:layout_width="16dp"

SSGMCE, Shegaon Page | 27


Smart Home Delivery

android:layout_height="16dp"
android:src="@drawable/logo_16"
android:layout_below="@+id/bgHeader"
android:layout_marginTop="-70dp"
android:layout_marginLeft="100dp"/>

<TextView
android:layout_width="match_parent"
android:layout_height="30dp"
android:text="Smart Home Delivery"
android:textColor="@color/mehdi_color"
android:textStyle="bold"
android:textSize="18dp"
android:layout_below="@+id/bgHeader"
android:layout_marginTop="-70dp"
android:layout_marginLeft="125dp"/>

<ImageView
android:layout_width="32dp"
android:layout_height="32dp"
android:src="@drawable/foodicon"
android:layout_below="@+id/bgHeader"
android:layout_marginTop="-30dp"
android:layout_marginLeft="70dp"/>

<TextView
android:layout_width="match_parent"
android:layout_height="30dp"
android:text="Great \nFood"
android:textColor="@color/black"
android:textStyle="bold"
android:textSize="12dp"
android:layout_below="@+id/bgHeader"
android:layout_marginTop="-30dp"
android:layout_marginLeft="110dp"/>

<ImageView
android:layout_width="32dp"
android:layout_height="32dp"
android:src="@drawable/droneicon"
android:layout_below="@+id/bgHeader"
android:layout_marginTop="-30dp"
android:layout_marginLeft="180dp"/>

<TextView
android:layout_width="match_parent"
android:layout_height="30dp"
android:text="Drone \nDelivery"
android:textColor="@color/black"
android:textStyle="bold"
android:textSize="12dp"
android:layout_below="@+id/bgHeader"
android:layout_marginTop="-30dp"
android:layout_marginLeft="220dp"/>

<ImageView
android:id="@+id/circle1"
android:layout_width="134dp"
android:layout_height="134dp"
android:layout_below="@+id/bgHeader"

SSGMCE, Shegaon Page | 28


Smart Home Delivery

android:layout_alignParentRight="true"
android:layout_marginTop="-80dp"
android:layout_marginRight="-100dp"
android:src="@drawable/circletransparant1" />

<ImageView
android:id="@+id/circle2"
android:layout_width="134dp"
android:layout_height="134dp"
android:layout_alignParentBottom="true"
android:layout_marginLeft="-100dp"
android:layout_marginBottom="50dp"
android:src="@drawable/circletransparant1" />

<ImageView
android:id="@+id/circle3"
android:layout_width="182dp"
android:layout_height="182dp"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginRight="-80dp"
android:layout_marginBottom="-30dp"
android:src="@drawable/circle1" />

<ImageView
android:id="@+id/circle4"
android:layout_width="134dp"
android:layout_height="134dp"
android:layout_alignParentBottom="true"
android:layout_marginRight="-50dp"
android:layout_marginBottom="-50dp"
android:layout_toLeftOf="@+id/circle3"
android:src="@drawable/circletransparant1" />

<ScrollView
android:id="@+id/sv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/bgHeader">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<androidx.cardview.widget.CardView
android:id="@+id/cv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="20dp"
app:cardCornerRadius="10dp"
app:cardElevation="4dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="50dp">

<TextView
android:layout_width="wrap_content"

SSGMCE, Shegaon Page | 29


Smart Home Delivery

android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="Username"
android:textColor="@color/mehdi_color"
android:textSize="14sp"
android:textStyle="bold" />

<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/edt_username"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:drawableLeft="@drawable/usernameicon"
android:inputType="text" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="Password"
android:textColor="@color/mehdi_color"
android:textSize="14sp"
android:textStyle="bold" />

<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/til_password"
app:passwordToggleEnabled="true"
app:passwordToggleDrawable="@drawable/icon_selector"
app:passwordToggleTint="@color/colorPurple"
>

<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/edt_password"
android:layout_below="@+id/txt_password"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:inputType="textPassword"
android:drawableLeft="@drawable/passwordicon"
android:paddingRight="10dp"/>

</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>

<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/cv"
android:layout_alignLeft="@+id/cv"
android:layout_alignRight="@+id/cv"
android:layout_marginTop="-50dp"
android:layout_marginLeft="35dp"
android:layout_marginRight="35dp"
android:elevation="10dp">

SSGMCE, Shegaon Page | 30


Smart Home Delivery

<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/btn_login"
android:background="@drawable/btn_fb_bg"
android:text="Login"
android:textAllCaps="false"
android:textColor="@color/colorWhite" />
</RelativeLayout>

<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/cv"
android:layout_alignRight="@+id/cv"
android:layout_marginTop="-20dp"
android:layout_marginRight="-20dp"
android:elevation="10dp">

<ImageButton
android:id="@+id/img_btn_register"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="@drawable/bg_ui"
android:src="@drawable/ic_add" />
</RelativeLayout>

<TextView
android:id="@+id/txt_forgot_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/cv"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:elevation="5dp"
android:text="Forgot your password?"
android:textSize="14sp" />

</RelativeLayout>
</ScrollView>

<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/progress"
android:layout_centerInParent="true"
android:visibility="gone"/>

</RelativeLayout>

SSGMCE, Shegaon Page | 31


Smart Home Delivery

activity_registration.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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=".LoginScreen"
tools:ignore="VectorDrawableCompat">

<androidx.appcompat.widget.Toolbar
android:id="@+id/bgHeader"
android:layout_width="match_parent"
android:layout_height="220dp"
android:background="@drawable/header_login"
android:elevation="5dp" />

<TextView
android:id="@+id/tvDesc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginTop="40dp"
android:elevation="5dp"
android:text="Welcome"
android:textColor="@color/colorWhite"
android:textSize="17sp" />

<TextView
android:id="@+id/tvLogin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tvDesc"
android:transitionName="tvLogin"
android:layout_alignLeft="@+id/tvDesc"
android:elevation="5dp"
android:text="Login to unloack awesome food"
android:textColor="@color/colorWhite"
android:textSize="16sp"
android:textStyle="bold" />

<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:src="@drawable/logo_16"
android:layout_below="@+id/bgHeader"
android:layout_marginTop="-70dp"
android:layout_marginLeft="100dp"/>

<TextView
android:layout_width="match_parent"
android:layout_height="30dp"
android:text="Smart Home Delivery"
android:textColor="@color/mehdi_color"
android:textStyle="bold"
android:textSize="18dp"
android:layout_below="@+id/bgHeader"
android:layout_marginTop="-70dp"
android:layout_marginLeft="125dp"/>

SSGMCE, Shegaon Page | 32


Smart Home Delivery

<ImageView
android:layout_width="32dp"
android:layout_height="32dp"
android:src="@drawable/foodicon"
android:layout_below="@+id/bgHeader"
android:layout_marginTop="-30dp"
android:layout_marginLeft="70dp"/>

<TextView
android:layout_width="match_parent"
android:layout_height="30dp"
android:text="Great \nFood"
android:textColor="@color/black"
android:textStyle="bold"
android:textSize="12dp"
android:layout_below="@+id/bgHeader"
android:layout_marginTop="-30dp"
android:layout_marginLeft="110dp"/>

<ImageView
android:layout_width="32dp"
android:layout_height="32dp"
android:src="@drawable/droneicon"
android:layout_below="@+id/bgHeader"
android:layout_marginTop="-30dp"
android:layout_marginLeft="180dp"/>

<TextView
android:layout_width="match_parent"
android:layout_height="30dp"
android:text="Drone \nDelivery"
android:textColor="@color/black"
android:textStyle="bold"
android:textSize="12dp"
android:layout_below="@+id/bgHeader"
android:layout_marginTop="-30dp"
android:layout_marginLeft="220dp"/>

<ImageView
android:id="@+id/circle1"
android:layout_width="134dp"
android:layout_height="134dp"
android:layout_below="@+id/bgHeader"
android:layout_alignParentRight="true"
android:layout_marginTop="-80dp"
android:layout_marginRight="-100dp"
android:src="@drawable/circletransparant1" />

<ImageView
android:id="@+id/circle2"
android:layout_width="134dp"
android:layout_height="134dp"
android:layout_alignParentBottom="true"
android:layout_marginLeft="-100dp"
android:layout_marginBottom="50dp"
android:src="@drawable/circletransparant1" />

<ImageView
android:id="@+id/circle3"

SSGMCE, Shegaon Page | 33


Smart Home Delivery

android:layout_width="182dp"
android:layout_height="182dp"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginRight="-80dp"
android:layout_marginBottom="-30dp"
android:src="@drawable/circle1" />

<ImageView
android:id="@+id/circle4"
android:layout_width="134dp"
android:layout_height="134dp"
android:layout_alignParentBottom="true"
android:layout_marginRight="-50dp"
android:layout_marginBottom="-50dp"
android:layout_toLeftOf="@+id/circle3"
android:src="@drawable/circletransparant1" />

<ScrollView
android:id="@+id/sv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/bgHeader">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<androidx.cardview.widget.CardView
android:id="@+id/cv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="20dp"
app:cardCornerRadius="10dp"
app:cardElevation="4dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="50dp">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="Username"
android:textColor="@color/mehdi_color"
android:textSize="14sp"
android:textStyle="bold" />

<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/edt_username"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:drawableLeft="@drawable/usernameicon"
android:inputType="text" />

SSGMCE, Shegaon Page | 34


Smart Home Delivery

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="Password"
android:textColor="@color/mehdi_color"
android:textSize="14sp"
android:textStyle="bold" />

<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/til_password"
app:passwordToggleEnabled="true"
app:passwordToggleDrawable="@drawable/icon_selector"
app:passwordToggleTint="@color/colorPurple"
>

<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/edt_password"
android:layout_below="@+id/txt_password"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:inputType="textPassword"
android:drawableLeft="@drawable/passwordicon"
android:paddingRight="10dp"/>

</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>

<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/cv"
android:layout_alignLeft="@+id/cv"
android:layout_alignRight="@+id/cv"
android:layout_marginTop="-50dp"
android:layout_marginLeft="35dp"
android:layout_marginRight="35dp"
android:elevation="10dp">

<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/btn_login"
android:background="@drawable/btn_fb_bg"
android:text="Login"
android:textAllCaps="false"
android:textColor="@color/colorWhite" />
</RelativeLayout>

<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/cv"
android:layout_alignRight="@+id/cv"
android:layout_marginTop="-20dp"

SSGMCE, Shegaon Page | 35


Smart Home Delivery

android:layout_marginRight="-20dp"
android:elevation="10dp">

<ImageButton
android:id="@+id/img_btn_register"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="@drawable/bg_ui"
android:src="@drawable/ic_add" />
</RelativeLayout>

<TextView
android:id="@+id/txt_forgot_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/cv"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:elevation="5dp"
android:text="Forgot your password?"
android:textSize="14sp" />

</RelativeLayout>
</ScrollView>

<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/progress"
android:layout_centerInParent="true"
android:visibility="gone"/>

</RelativeLayout>

SSGMCE, Shegaon Page | 36


Smart Home Delivery

activity_home.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout
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:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">

<include
layout="@layout/app_bar_home_page"
android:layout_width="match_parent"
android:layout_height="match_parent" />

<com.google.android.material.navigation.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_home_page"
app:menu="@menu/activity_home_page_drawer" />

</androidx.drawerlayout.widget.DrawerLayout>

content_home_page.xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Activity.HomePage"
android:orientation="vertical"
>

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

<!-- layout before your slide show -->


<ViewFlipper
android:id="@+id/viewFlipper1"
android:layout_width="match_parent"
android:layout_height="139dp" >

<LinearLayout
android:layout_width="match_parent"
android:layout_height="139dp"
>
<ImageView
android:id="@+id/image_view_flip1"

SSGMCE, Shegaon Page | 37


Smart Home Delivery

android:layout_width="match_parent"
android:layout_height="139dp"
android:contentDescription=""
android:src="@drawable/pic1" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="200dp"
android:orientation="vertical">
<ImageView
android:id="@+id/image_view_flip2"
android:layout_width="match_parent"
android:layout_height="139dp"
android:layout_gravity="center_vertical"
android:contentDescription=""
android:src="@drawable/pic1" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="139dp" >
<ImageView
android:id="@+id/image_view_flip3"
android:layout_width="match_parent"
android:layout_height="139dp"
android:layout_gravity="center_vertical"
android:contentDescription=""
android:src="@drawable/pic1" />
</LinearLayout>
</ViewFlipper>
<!-- rest of your layout -->

<!-- Horizontal categories of food start-->


<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@color/light_grey"
android:layout_marginTop="4dp"
android:scrollbars="horizontal"
>

<androidx.cardview.widget.CardView
android:layout_width="100dp"
android:layout_height="120dp"
android:id="@+id/hori_cardview1"
android:elevation="10dp"
app:cardCornerRadius="10dp"
app:cardBackgroundColor="@color/white"
android:layout_marginLeft="5dp"
android:layout_marginBottom="5dp">

<LinearLayout
android:layout_width="match_parent"

SSGMCE, Shegaon Page | 38


Smart Home Delivery

android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dp"
android:layout_margin="10dp"
android:gravity="center"
android:layout_gravity="center">

<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:id="@+id/img_vegeterian"
android:src="@drawable/veg"/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/txt_vegeterian"
android:text="Pure Veg Place"
android:textSize="10dp"
android:textAlignment="center"
android:layout_marginTop="5dp"
android:fontFamily="sans-serif-condensed-medium"/>

</LinearLayout>

</androidx.cardview.widget.CardView>

<androidx.cardview.widget.CardView
android:layout_width="100dp"
android:layout_height="120dp"
android:id="@+id/hori_cardview2"
android:elevation="10dp"
app:cardCornerRadius="10dp"
app:cardBackgroundColor="@color/light_grey"
android:layout_marginLeft="5dp"
android:layout_marginBottom="5dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dp"
android:layout_margin="10dp"
android:gravity="center"
android:layout_gravity="center">

<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:id="@+id/img_non_veg"
android:src="@drawable/non_veg"/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/txt_non_veg"
android:text="Non Veg Place"
android:textSize="10dp"
android:textAlignment="center"
android:layout_marginTop="5dp"

SSGMCE, Shegaon Page | 39


Smart Home Delivery

android:fontFamily="sans-serif-condensed-medium"/>

</LinearLayout>

</androidx.cardview.widget.CardView>

<androidx.cardview.widget.CardView
android:layout_width="100dp"
android:layout_height="120dp"
android:id="@+id/hori_cardview3"
android:elevation="10dp"
app:cardCornerRadius="10dp"
app:cardBackgroundColor="@color/white"
android:layout_marginLeft="5dp"
android:layout_marginBottom="5dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dp"
android:layout_margin="10dp"
android:gravity="center"
android:layout_gravity="center">

<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:id="@+id/img_south_indian"
android:src="@drawable/south_indian"/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/txt_south_indian"
android:text="South Indian"
android:textSize="10dp"
android:textAlignment="center"
android:layout_marginTop="5dp"
android:fontFamily="sans-serif-condensed-medium"
/>

</LinearLayout>

</androidx.cardview.widget.CardView>

<androidx.cardview.widget.CardView
android:layout_width="100dp"
android:layout_height="120dp"
android:id="@+id/hori_cardview4"
android:elevation="10dp"
app:cardCornerRadius="10dp"
app:cardBackgroundColor="@color/light_grey"
android:layout_marginLeft="5dp"
android:layout_marginBottom="5dp"
android:layout_marginRight="5dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"

SSGMCE, Shegaon Page | 40


Smart Home Delivery

android:orientation="vertical"
android:padding="10dp"
android:layout_margin="10dp"
android:gravity="center"
android:layout_gravity="center">

<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:id="@+id/img_pizza"
android:src="@drawable/pizza"/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/txt_pizza"
android:text="Pizza"
android:textSize="10dp"
android:textAlignment="center"
android:layout_marginTop="5dp"
android:fontFamily="sans-serif-condensed-medium"/>

</LinearLayout>

</androidx.cardview.widget.CardView>

</LinearLayout>

</HorizontalScrollView>

<!-- Horizontal categories of food end-->

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/tv_no_record"
android:text="No Record"
android:visibility="gone"/>

<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/progress"
android:visibility="gone"
android:layout_centerInParent="true"/>

<!-- first cardview veg start-->


<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="10dp"
app:cardElevation="10dp"
app:cardBackgroundColor="@color/white"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp">

<LinearLayout

SSGMCE, Shegaon Page | 41


Smart Home Delivery

android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>

<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">

<TextView
android:layout_width="150dp"
android:layout_height="wrap_content"
android:id="@+id/txt_category_type_pure_veg"
android:textSize="16dp"
android:textStyle="bold"
android:textColor="@color/black"
android:layout_margin="16dp"
android:layout_alignParentLeft="true"/>

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btn_view_all1"
android:text="View All"
android:textColor="@color/white"
android:textSize="14dp"
android:textStyle="bold"
android:textAlignment="center"
android:layout_marginTop="4dp"
android:layout_marginRight="16dp"
android:layout_alignParentRight="true"
android:background="@drawable/bg_ui"
/>

</RelativeLayout>
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<ImageView
android:layout_width="120dp"
android:layout_height="120dp"
android:id="@+id/img_veg_restaurant_image"
android:src="@drawable/profileimage"/>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:layout_width="match_parent"

SSGMCE, Shegaon Page | 42


Smart Home Delivery

android:layout_height="wrap_content"
android:id="@+id/txt_veg_restaurant_name"
android:textColor="@color/black"
android:textSize="14dp"
android:textStyle="bold"/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/txt_veg_restaurant_desc"
android:textSize="12dp"
android:textStyle="bold"
android:layout_marginTop="3dp"/>

<RatingBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/rating_veg_restaurant"
android:numStars="5"
android:layout_marginTop="4dp"
android:scaleX="0.5"
android:scaleY="0.5"
android:isIndicator="true"
/>

</LinearLayout>

</LinearLayout>

</LinearLayout>

</androidx.cardview.widget.CardView>

<!-- first cardview veg end-->

<!-- Second Cardview Non-veg Start-->


<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="10dp"
app:cardElevation="10dp"
app:cardBackgroundColor="@color/white"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>

<RelativeLayout
android:layout_width="wrap_content"

SSGMCE, Shegaon Page | 43


Smart Home Delivery

android:layout_height="wrap_content">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/txt_category_type_non_veg"
android:textSize="16dp"
android:textStyle="bold"
android:textColor="@color/black"
android:layout_gravity="left"
android:gravity="left"
android:layout_margin="16dp"
android:layout_alignParentLeft="true"/>

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btn_view_all2"
android:text="View All"
android:textColor="@color/white"
android:textSize="14dp"
android:textStyle="bold"
android:textAlignment="center"
android:layout_marginTop="4dp"
android:layout_marginRight="16dp"
android:layout_alignParentRight="true"
android:background="@drawable/bg_ui"

/>

</RelativeLayout>

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<ImageView
android:layout_width="120dp"
android:layout_height="120dp"
android:id="@+id/img_non_veg_restaurant_image"
android:src="@drawable/profileimage"/>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/txt_non_veg_restaurant_name"
android:textColor="@color/black"
android:textSize="14dp"
android:textStyle="bold"/>

<TextView
android:layout_width="match_parent"

SSGMCE, Shegaon Page | 44


Smart Home Delivery

android:layout_height="wrap_content"
android:id="@+id/txt_non_veg_restaurant_desc"
android:textSize="12dp"
android:textStyle="bold"
android:layout_marginTop="3dp"/>

<RatingBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/rating_non_veg"
android:numStars="5"
android:layout_marginTop="4dp"
android:scaleX="0.5"
android:scaleY="0.5"
android:isIndicator="true"
/>

</LinearLayout>

</LinearLayout>

</LinearLayout>

</androidx.cardview.widget.CardView>

<!-- Second cardview veg end-->

<!-- Third cardview veg start-->


<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="10dp"
app:cardElevation="10dp"
app:cardBackgroundColor="@color/white"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>

<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/txt_category_type_south_indian"
android:textSize="16dp"

SSGMCE, Shegaon Page | 45


Smart Home Delivery

android:textStyle="bold"
android:textColor="@color/black"
android:layout_margin="16dp"
android:layout_alignParentLeft="true"/>

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btn_view_all3"
android:text="View All"
android:textColor="@color/white"
android:textSize="14dp"
android:textStyle="bold"
android:textAlignment="center"
android:layout_marginTop="4dp"
android:layout_marginRight="16dp"
android:layout_alignParentRight="true"
android:background="@drawable/bg_ui"
/>

</RelativeLayout>
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<ImageView
android:layout_width="120dp"
android:layout_height="120dp"
android:id="@+id/img_south_indian_restaurant_image"
android:src="@drawable/profileimage"/>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/txt_south_indian_restaurant_name"
android:textColor="@color/black"
android:textSize="14dp"
android:textStyle="bold"/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/txt_south_indian_restaurant_desc"
android:textSize="12dp"
android:textStyle="bold"
android:layout_marginTop="3dp"/>

<RatingBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/rating_south_indian"
android:numStars="5"

SSGMCE, Shegaon Page | 46


Smart Home Delivery

android:layout_marginTop="4dp"
android:scaleX="0.5"
android:scaleY="0.5"
android:isIndicator="true"
/>

</LinearLayout>

</LinearLayout>

</LinearLayout>

</androidx.cardview.widget.CardView>

<!-- Third cardview veg end-->

<!-- Fourth cardview veg start-->


<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="10dp"
app:cardElevation="10dp"
app:cardBackgroundColor="@color/white"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>

<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/txt_category_type_fast_food"
android:textSize="16dp"
android:textStyle="bold"
android:textColor="@color/black"
android:layout_margin="16dp"
android:layout_alignParentLeft="true"/>

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btn_view_all4"
android:text="View All"

SSGMCE, Shegaon Page | 47


Smart Home Delivery

android:textColor="@color/white"
android:textSize="14dp"
android:textStyle="bold"
android:textAlignment="center"
android:layout_marginTop="4dp"
android:layout_marginRight="16dp"
android:layout_alignParentRight="true"
android:background="@drawable/bg_ui"
/>

</RelativeLayout>

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<ImageView
android:layout_width="120dp"
android:layout_height="120dp"
android:id="@+id/img_fast_food_restaurant_image"
android:src="@drawable/profileimage"/>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/txt_fast_food_restaurant_name"
android:textColor="@color/black"
android:textSize="14dp"
android:textStyle="bold"/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/txt_fast_food_restaurant_desc"
android:textSize="12dp"
android:textStyle="bold"
android:layout_marginTop="3dp"/>

<RatingBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/rating_fast_food"
android:numStars="5"
android:layout_marginTop="4dp"
android:scaleX="0.5"
android:scaleY="0.5"
android:isIndicator="true"
/>

</LinearLayout>

</LinearLayout>

SSGMCE, Shegaon Page | 48


Smart Home Delivery

</LinearLayout>

</androidx.cardview.widget.CardView>

<!-- Fourth cardview veg end-->


</LinearLayout>

<!-- </RelativeLayout>-->

</ScrollView>

Java Code
SplashActivity.Java
package com.niksample.smarthomedelivery;

import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;

import android.Manifest;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.provider.Settings;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.karumi.dexter.Dexter;
import com.karumi.dexter.PermissionToken;
import com.karumi.dexter.listener.PermissionDeniedResponse;
import com.karumi.dexter.listener.PermissionGrantedResponse;
import com.karumi.dexter.listener.PermissionRequest;
import com.karumi.dexter.listener.single.PermissionListener;

public class SplashScreen extends AppCompatActivity {

ImageView img_logo;
TextView txt_title;

Animation lefttoright;

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

img_logo = findViewById(R.id.img_logo);
txt_title = findViewById(R.id.txt_title);

lefttoright = AnimationUtils.loadAnimation(this,R.anim.lefttoright);

SSGMCE, Shegaon Page | 49


Smart Home Delivery

img_logo.setAnimation(lefttoright);

new Thread()
{
public void run()
{
try {
sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}

finally {
startActivity(new Intent(SplashScreen.this,LoginScreen.class));
finish();
}
}
}.start();
}
}

LoginActivity.java

package com.niksample.smarthomedelivery;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.material.textfield.TextInputEditText;
import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.JsonHttpResponseHandler;
import com.loopj.android.http.RequestParams;
import com.niksample.smarthomedelivery.Activity.HomePage;
import com.niksample.smarthomedelivery.Comman.Config;

import org.json.JSONException;
import org.json.JSONObject;

import cz.msebera.android.httpclient.Header;

public class LoginScreen extends AppCompatActivity {

EditText edt_username;
TextInputEditText edt_password;

SSGMCE, Shegaon Page | 50


Smart Home Delivery

Button btn_login;
ImageButton img_btn_register;
TextView txt_forgot_password;

ProgressBar progress;
SharedPreferences preferences;
SharedPreferences.Editor editor;

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

preferences = PreferenceManager.getDefaultSharedPreferences(this);
editor = preferences.edit();

edt_username = findViewById(R.id.edt_username);
edt_password = findViewById(R.id.edt_password);
btn_login = findViewById(R.id.btn_login);
img_btn_register = findViewById(R.id.img_btn_register);
txt_forgot_password = findViewById(R.id.txt_forgot_password);
progress = findViewById(R.id.progress);

edt_password.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1,
int i2) {

@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int
i2) {

if (edt_password.getText().toString().length() > 4)
{
Drawable imageView= getDrawable(R.drawable.visibility_on);
imageView.setVisible(true,true);
}
}

@Override
public void afterTextChanged(Editable editable) {

}
});

img_btn_register.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(LoginScreen.this,RegistrationScreen.class));
finish();
}
});

btn_login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {

SSGMCE, Shegaon Page | 51


Smart Home Delivery

if (edt_username.getText().toString().isEmpty())
{
edt_username.setError("Please Enter Valid Username");
}
else if (edt_password.getText().toString().isEmpty())
{
edt_password.setError("Please Enter Valid Password");
}
else
{
login();
}

}
});
}

private void login()


{
AsyncHttpClient client = new AsyncHttpClient();
RequestParams params = new RequestParams();

params.put("username",edt_username.getText().toString());
params.put("password",edt_password.getText().toString());

client.post(Config.url_login,params,new JsonHttpResponseHandler() {

@Override
public void onStart() {
progress.setVisibility(View.VISIBLE);
super.onStart();
}

@Override
public void onSuccess(int statusCode, Header[] headers, JSONObject
response) {
progress.setVisibility(View.GONE);

try {

editor.putString("username",edt_username.getText().toString()).commit();
String aa = response.getString("success");
if (aa.equals("1"))
{
Toast.makeText(LoginScreen.this, "Login Successfully Done",
Toast.LENGTH_SHORT).show();
startActivity(new Intent(LoginScreen.this,HomePage.class));
finish();
}
else
{
Toast.makeText(LoginScreen.this, "Incorrect Username or
Password", Toast.LENGTH_SHORT).show();
}
} catch (JSONException e) {
e.printStackTrace();
}
}

@Override

SSGMCE, Shegaon Page | 52


Smart Home Delivery

public void onFailure(int statusCode, Header[] headers, Throwable


throwable, JSONObject errorResponse) {
Toast.makeText(LoginScreen.this, "Colud Not Connect",
Toast.LENGTH_SHORT).show();
}
});

RegistrationActivity.java
package com.niksample.smarthomedelivery;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.Toast;

import com.google.android.material.textfield.TextInputEditText;
import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.JsonHttpResponseHandler;
import com.loopj.android.http.RequestParams;
import com.niksample.smarthomedelivery.Comman.Config;

import org.json.JSONException;
import org.json.JSONObject;

import cz.msebera.android.httpclient.Header;

public class RegistrationScreen extends AppCompatActivity {

EditText edt_name,edt_email,edt_mobile_no,edt_username,edt_retype_password;
TextInputEditText edt_password;
Button btn_sign_up;

ProgressBar progress;
SharedPreferences preferences;
SharedPreferences.Editor editor;

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

preferences = PreferenceManager.getDefaultSharedPreferences(this);
editor = preferences.edit();

progress = findViewById(R.id.progress);

SSGMCE, Shegaon Page | 53


Smart Home Delivery

edt_name = findViewById(R.id.edt_name);
edt_email = findViewById(R.id.edt_email);
edt_mobile_no = findViewById(R.id.edt_mobile_no);
edt_username = findViewById(R.id.edt_username);
edt_retype_password = findViewById(R.id.edt_retype_password);

edt_password = findViewById(R.id.edt_password);
btn_sign_up = findViewById(R.id.btn_sign_up);

btn_sign_up.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(edt_name.getText().toString().isEmpty())
{
edt_name.setError("Please Enter Your Name");
}
else if(edt_mobile_no.getText().toString().isEmpty())
{
edt_mobile_no.setError("Please Enter Your Mobile Number");
}
else if (edt_email.getText().toString().isEmpty())
{
edt_email.setError("Please Enter Your Mail Id");
}
else if (edt_username.getText().toString().isEmpty())
{
edt_username.setError("Enter Username");
}
else if (edt_password.getText().toString().isEmpty())
{
edt_password.setError("Enter Strong Password");
}
else
{
addUsers();
}
}
});
}

public void addUsers()


{
AsyncHttpClient client = new AsyncHttpClient();
RequestParams params = new RequestParams();

params.put("name",edt_name.getText().toString());
params.put("mobile_no",edt_mobile_no.getText().toString());
params.put("email",edt_email.getText().toString());
params.put("username",edt_username.getText().toString());
params.put("password",edt_password.getText().toString());

client.post(Config.url_addusers,params,new JsonHttpResponseHandler() {
@Override
public void onStart() {
progress.setVisibility(View.VISIBLE);
super.onStart();
}

SSGMCE, Shegaon Page | 54


Smart Home Delivery

@Override
public void onSuccess(int statusCode, Header[] headers,
JSONObject response) {
progress.setVisibility(View.GONE);
try {
String aa = response.getString("success");

if (aa.equals("1"))
{
Toast.makeText(RegistrationScreen.this, "Registration
Succesfully Done", Toast.LENGTH_SHORT).show();
startActivity(new
Intent(RegistrationScreen.this,LoginScreen.class));
finish();
}
else
{
Toast.makeText(RegistrationScreen.this, "Already
Register", Toast.LENGTH_SHORT).show();
}
} catch (JSONException e) {
e.printStackTrace();
}
}

@Override
public void onFailure(int statusCode, Header[] headers, Throwable
throwable, JSONObject errorResponse) {
Toast.makeText(RegistrationScreen.this, "Could not Connect",
Toast.LENGTH_SHORT).show();
}
});
}

@Override
public void onBackPressed() {
startActivity(new Intent(RegistrationScreen.this,LoginScreen.class));
finish();
}
}

HomeActivity.java

package com.niksample.smarthomedelivery.Activity;

import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;

import android.os.Handler;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;

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

SSGMCE, Shegaon Page | 55


Smart Home Delivery

import androidx.appcompat.widget.SearchView;
import androidx.cardview.widget.CardView;
import androidx.navigation.ui.AppBarConfiguration;

import com.google.android.material.navigation.NavigationView;
import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.JsonHttpResponseHandler;
import com.loopj.android.http.RequestParams;
import com.niksample.smarthomedelivery.Comman.Config;
import com.niksample.smarthomedelivery.LoginScreen;
import com.niksample.smarthomedelivery.R;
import com.squareup.picasso.Picasso;

import androidx.drawerlayout.widget.DrawerLayout;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;

import android.view.Menu;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.RatingBar;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.ViewFlipper;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import cz.msebera.android.httpclient.Header;

public class HomePage extends AppCompatActivity {

private AppBarConfiguration mAppBarConfiguration;


boolean doubletap = false;

ViewFlipper flipper;
private static Handler handler = new Handler();

CardView hori_cardview1,hori_cardview2,hori_cardview3,hori_cardview4;

TextView tv_no_record;
ProgressBar progress;

SharedPreferences preferences;
SharedPreferences.Editor editor;

ImageView
img_veg_restaurant_image,img_non_veg_restaurant_image,img_south_indian_restaurant_ima
ge,img_fast_food_restaurant_image;
TextView
txt_category_type_pure_veg,txt_category_type_non_veg,txt_category_type_south_indian,t
xt_category_type_fast_food;
TextView
txt_veg_restaurant_name,txt_non_veg_restaurant_name,txt_south_indian_restaurant_name,
txt_fast_food_restaurant_name;

SSGMCE, Shegaon Page | 56


Smart Home Delivery

TextView
txt_veg_restaurant_desc,txt_non_veg_restaurant_desc,txt_south_indian_restaurant_desc,
txt_fast_food_restaurant_desc;
RatingBar
rating_veg_restaurant,rating_non_veg_restaurant,rating_south_indian_restaurant,rating
_fast_food_restaurant;

Button
btn_view_veg_restaurant,btn_view_non_veg_restaurant,btn_view_south_indian_restaurant,
btn_view_fast_food_restaurant;

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

setTitle("Smart Home Delivery");

SharedPreferences sharedPreferences =
getSharedPreferences("prefs",MODE_PRIVATE);
boolean firsttime = sharedPreferences.getBoolean("firsttime",true);

if (firsttime)
{
welcome();
}

Toolbar toolbar = findViewById(R.id.toolbar);


setSupportActionBar(toolbar);

// searchView = findViewById(R.id.home_searchview);
hori_cardview1 = findViewById(R.id.hori_cardview1);
hori_cardview2 = findViewById(R.id.hori_cardview2);
hori_cardview3 = findViewById(R.id.hori_cardview3);
hori_cardview4 = findViewById(R.id.hori_cardview4);

hori_cardview1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(HomePage.this,
Pure_Veg_Restaurant_Screen.class));
finish();
}
});

hori_cardview2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(HomePage.this,
Non_Veg_Restaurant_Screen.class));
finish();
}
});

hori_cardview3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(HomePage.this,
South_indian_Restaurant_Screen.class));

SSGMCE, Shegaon Page | 57


Smart Home Delivery

finish();
}
});

hori_cardview4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(HomePage.this,
Fast_Food_Restaurant_Screen.class));
finish();
}
});

DrawerLayout drawer = findViewById(R.id.drawer_layout);


NavigationView navigationView = findViewById(R.id.nav_view);
// Passing each menu ID as a set of Ids because each
// menu should be considered as top level destinations.
mAppBarConfiguration = new AppBarConfiguration.Builder(
R.id.nav_home, R.id.nav_gallery, R.id.nav_slideshow,
R.id.nav_tools, R.id.nav_share, R.id.nav_send)
.setDrawerLayout(drawer)
.build();

//slideshow start
flipper = (ViewFlipper) findViewById(R.id.viewFlipper1);

flipper.setOnTouchListener(new View.OnTouchListener() {
float x1 = 0, x2, y1 = 0, y2, dx, dy;
@Override
public boolean onTouch(View v, MotionEvent event) {
String direction;
switch(event.getAction()) {
case(MotionEvent.ACTION_DOWN):
x1 = event.getX();
y1 = event.getY();
break;
case(MotionEvent.ACTION_UP): {
x2 = event.getX();
y2 = event.getY();
dx = x2-x1;
dy = y2-y1;
// Use dx and dy to determine the direction
if(Math.abs(dx) > Math.abs(dy)) {
if(dx>0) {
direction = "right";
} else {
direction = "left";
}
slideFipper(direction);
} else {
if(dy>0) direction = "down";
else direction = "up";
}
}
}
v.performClick();
return true;
}
});

SSGMCE, Shegaon Page | 58


Smart Home Delivery

img_veg_restaurant_image = findViewById(R.id.img_veg_restaurant_image);
img_non_veg_restaurant_image =
findViewById(R.id.img_non_veg_restaurant_image);
img_south_indian_restaurant_image =
findViewById(R.id.img_south_indian_restaurant_image);
img_fast_food_restaurant_image =
findViewById(R.id.img_fast_food_restaurant_image);

txt_category_type_pure_veg = findViewById(R.id.txt_category_type_pure_veg);
txt_veg_restaurant_name = findViewById(R.id.txt_veg_restaurant_name);
txt_veg_restaurant_desc = findViewById(R.id.txt_veg_restaurant_desc);
rating_veg_restaurant = findViewById(R.id.rating_veg_restaurant);
btn_view_veg_restaurant = findViewById(R.id.btn_view_all1);
getpurevegrestaurant();

txt_category_type_non_veg = findViewById(R.id.txt_category_type_non_veg);
txt_non_veg_restaurant_name = findViewById(R.id.txt_non_veg_restaurant_name);
txt_non_veg_restaurant_desc = findViewById(R.id.txt_non_veg_restaurant_desc);
rating_non_veg_restaurant = findViewById(R.id.rating_non_veg);
btn_view_non_veg_restaurant = findViewById(R.id.btn_view_all2);
getnonvegrestaurant();

txt_category_type_south_indian =
findViewById(R.id.txt_category_type_south_indian);
txt_south_indian_restaurant_name =
findViewById(R.id.txt_south_indian_restaurant_name);
txt_south_indian_restaurant_desc =
findViewById(R.id.txt_south_indian_restaurant_desc);
rating_south_indian_restaurant = findViewById(R.id.rating_south_indian);
btn_view_south_indian_restaurant = findViewById(R.id.btn_view_all3);
getsouthindianrestaurant();

txt_category_type_fast_food = findViewById(R.id.txt_category_type_fast_food);
txt_fast_food_restaurant_name =
findViewById(R.id.txt_fast_food_restaurant_name);
txt_fast_food_restaurant_desc =
findViewById(R.id.txt_fast_food_restaurant_desc);
rating_fast_food_restaurant = findViewById(R.id.rating_fast_food);
btn_view_fast_food_restaurant = findViewById(R.id.btn_view_all4);
getfastfoodrestaurant();

tv_no_record = findViewById(R.id.tv_no_record);
progress = findViewById(R.id.progress);

btn_view_veg_restaurant.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

startActivity(new
Intent(HomePage.this,Pure_Veg_Restaurant_Screen.class));
finish();
}
});

btn_view_non_veg_restaurant.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

SSGMCE, Shegaon Page | 59


Smart Home Delivery

startActivity(new
Intent(HomePage.this,Non_Veg_Restaurant_Screen.class));
finish();
}
});

btn_view_south_indian_restaurant.setOnClickListener(new
View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new
Intent(HomePage.this,South_indian_Restaurant_Screen.class));
finish();
}
});

btn_view_fast_food_restaurant.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new
Intent(HomePage.this,Fast_Food_Restaurant_Screen.class));
finish();
}
});

private void getpurevegrestaurant() {

AsyncHttpClient client = new AsyncHttpClient();


RequestParams params = new RequestParams();

client.post(Config.url_pure_veg_restaurant, params,new
JsonHttpResponseHandler() {

@Override
public void onStart() {
progress.setVisibility(View.VISIBLE);
super.onStart();
}

@Override
public void onSuccess(int statusCode, Header[] headers, JSONObject
response) {

progress.setVisibility(View.GONE);
try {
JSONArray jsonArray =
response.getJSONArray("getPureVegRestaurant");
for (int i= 0 ; i<jsonArray.length(); i++)
{
JSONObject jsonObject = jsonArray.getJSONObject(i);
String category_type_veg =
jsonObject.getString("category_type_veg");
String pure_veg_restaurant_image =
jsonObject.getString("pure_veg_restaurant_image");
String pure_veg_restaurant_name =
jsonObject.getString("pure_veg_restaurant_name");

SSGMCE, Shegaon Page | 60


Smart Home Delivery

String pure_veg_restaurant_desc =
jsonObject.getString("pure_veg_restaurant_desc");
String pure_veg_restaurant_rating =
jsonObject.getString("pure_veg_restaurant_rating");

txt_category_type_pure_veg.setText(category_type_veg);

Picasso.with(HomePage.this).load(Config.OnlineImageAddress+""+pure_veg_restaurant_ima
ge).placeholder(R.drawable.profileimage)

.error(R.drawable.image_not_load).into(img_veg_restaurant_image);
txt_veg_restaurant_name.setText(pure_veg_restaurant_name);
txt_veg_restaurant_desc.setText(pure_veg_restaurant_desc);

rating_veg_restaurant.setRating(Float.parseFloat(pure_veg_restaurant_rating));

} catch (JSONException e) {
e.printStackTrace();
}
}

@Override
public void onFailure(int statusCode, Header[] headers, Throwable
throwable, JSONObject errorResponse) {
Toast.makeText(HomePage.this, "Could Not Connect",
Toast.LENGTH_SHORT).show();
}
});

private void getnonvegrestaurant() {

AsyncHttpClient client = new AsyncHttpClient();


RequestParams params = new RequestParams();

// params.put("election_state",preferences.getString("election_state",""));
client.post(Config.url_non_veg_restaurant, params,new
JsonHttpResponseHandler() {

@Override
public void onStart() {
progress.setVisibility(View.VISIBLE);
super.onStart();
}

@Override
public void onSuccess(int statusCode, Header[] headers, JSONObject
response) {

progress.setVisibility(View.GONE);
try {
JSONArray jsonArray =
response.getJSONArray("getNonVegRestaurant");
for (int i= 0 ; i<jsonArray.length(); i++)
{
JSONObject jsonObject = jsonArray.getJSONObject(i);
String category_type_non_veg =
jsonObject.getString("category_type_non_veg");

SSGMCE, Shegaon Page | 61


Smart Home Delivery

String non_veg_restaurant_image =
jsonObject.getString("non_veg_restaurant_image");
String non_veg_restaurant_name =
jsonObject.getString("non_veg_restaurant_name");
String non_veg_restaurant_desc =
jsonObject.getString("non_veg_restaurant_desc");
String non_veg_restaurant_rating =
jsonObject.getString("non_veg_restaurant_rating");

txt_category_type_non_veg.setText(category_type_non_veg);

Picasso.with(HomePage.this).load(Config.OnlineImageAddress+""+non_veg_restaurant_imag
e).placeholder(R.drawable.profileimage)

.error(R.drawable.image_not_load).into(img_non_veg_restaurant_image);
txt_non_veg_restaurant_name.setText(non_veg_restaurant_name);
txt_non_veg_restaurant_desc.setText(non_veg_restaurant_desc);

rating_non_veg_restaurant.setRating(Float.parseFloat(non_veg_restaurant_rating));
} catch (JSONException e) {
e.printStackTrace();
}
}

@Override
public void onFailure(int statusCode, Header[] headers, Throwable
throwable, JSONObject errorResponse) {
Toast.makeText(HomePage.this, "Could Not Connect",
Toast.LENGTH_SHORT).show();
}
});

private void getsouthindianrestaurant() {

AsyncHttpClient client = new AsyncHttpClient();


RequestParams params = new RequestParams();

// params.put("election_state",preferences.getString("election_state",""));
client.post(Config.url_south_indian_restaurant, params,new
JsonHttpResponseHandler() {

@Override
public void onStart() {
progress.setVisibility(View.VISIBLE);
super.onStart();
}

@Override
public void onSuccess(int statusCode, Header[] headers, JSONObject
response) {

progress.setVisibility(View.GONE);
try {
JSONArray jsonArray =
response.getJSONArray("getSouthIndianRestaurant");
for (int i= 0 ; i<jsonArray.length(); i++)
{
JSONObject jsonObject = jsonArray.getJSONObject(i);

SSGMCE, Shegaon Page | 62


Smart Home Delivery

String category_type_south_indian =
jsonObject.getString("category_type_south_indian");
String south_indian_restaurant_image =
jsonObject.getString("south_indian_restaurant_image");
String south_indian_restaurant_name =
jsonObject.getString("south_indian_restaurant_name");
String south_indian_restaurant_desc =
jsonObject.getString("south_indian_restaurant_desc");
String south_indian_restaurant_rating =
jsonObject.getString("south_indian_restaurant_rating");

txt_category_type_south_indian.setText(category_type_south_indian);

Picasso.with(HomePage.this).load(Config.OnlineImageAddress+""+south_indian_restaurant
_image).placeholder(R.drawable.profileimage)

.error(R.drawable.image_not_load).into(img_south_indian_restaurant_image);

txt_south_indian_restaurant_name.setText(south_indian_restaurant_name);

txt_south_indian_restaurant_desc.setText(south_indian_restaurant_desc);

rating_south_indian_restaurant.setRating(Float.parseFloat(south_indian_restaurant_rat
ing));

} catch (JSONException e) {
e.printStackTrace();
}
}

@Override
public void onFailure(int statusCode, Header[] headers, Throwable
throwable, JSONObject errorResponse) {
Toast.makeText(HomePage.this, "Could Not Connect",
Toast.LENGTH_SHORT).show();
}
});

private void getfastfoodrestaurant() {

AsyncHttpClient client = new AsyncHttpClient();


RequestParams params = new RequestParams();

// params.put("election_state",preferences.getString("election_state",""));
client.post(Config.url_fast_food_restaurant, params,new
JsonHttpResponseHandler() {

@Override
public void onStart() {
progress.setVisibility(View.VISIBLE);
super.onStart();
}

@Override
public void onSuccess(int statusCode, Header[] headers, JSONObject
response) {

SSGMCE, Shegaon Page | 63


Smart Home Delivery

progress.setVisibility(View.GONE);
try {
JSONArray jsonArray =
response.getJSONArray("getFastFoodRestaurant");
for (int i= 0 ; i<jsonArray.length(); i++)
{
JSONObject jsonObject = jsonArray.getJSONObject(i);
String category_type_fast_food =
jsonObject.getString("category_type_fast_food");
String fast_food_restaurant_image =
jsonObject.getString("fast_food_restaurant_image");
String fast_food_restaurant_name =
jsonObject.getString("fast_food_restaurant_name");
String fast_food_restaurant_desc =
jsonObject.getString("fast_food_restaurant_desc");
String fast_food_restaurant_rating =
jsonObject.getString("fast_food_restaurant_rating");

txt_category_type_fast_food.setText(category_type_fast_food);

Picasso.with(HomePage.this).load(Config.OnlineImageAddress+""+fast_food_restaurant_im
age).placeholder(R.drawable.profileimage)

.error(R.drawable.image_not_load).into(img_fast_food_restaurant_image);

txt_fast_food_restaurant_name.setText(fast_food_restaurant_name);

txt_fast_food_restaurant_desc.setText(fast_food_restaurant_desc);

rating_fast_food_restaurant.setRating(Float.parseFloat(fast_food_restaurant_rating));

} catch (JSONException e) {
e.printStackTrace();
}
}

@Override
public void onFailure(int statusCode, Header[] headers, Throwable
throwable, JSONObject errorResponse) {
Toast.makeText(HomePage.this, "Could Not Connect",
Toast.LENGTH_SHORT).show();
}
});

public void slideFipper(final String direction){


final Animation no_next =
AnimationUtils.loadAnimation(getApplicationContext(), R.anim.no_next);
final Animation no_previuos =
AnimationUtils.loadAnimation(getApplicationContext(), R.anim.no_previous);
handler.post(new Runnable(){
public void run(){
int currentView = flipper.getDisplayedChild();
if (direction.equalsIgnoreCase("left")) {
//left
if (currentView < 2) {
flipper.setInAnimation(getApplicationContext(),
R.anim.enter);

SSGMCE, Shegaon Page | 64


Smart Home Delivery

flipper.setOutAnimation(getApplicationContext(),
R.anim.exit);
flipper.showNext();
} else {
flipper.startAnimation(no_next);
}
} else {
//right
if (currentView > 0) {

flipper.setInAnimation(getApplicationContext(),R.anim.pop_enter);
flipper.setOutAnimation(getApplicationContext(),
R.anim.pop_exit);
flipper.showPrevious();
} else {
flipper.startAnimation(no_previuos);
}
}
}
});
}

//slideshow end

private void welcome() {


AlertDialog.Builder ad = new AlertDialog.Builder(this);
ad.setTitle("Smart Home Delivery");
ad.setMessage("Welcome to Smart Home Delivery");
ad.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.cancel();
}
}).create().show();

SharedPreferences sharedPreferences =
getSharedPreferences("prefs",MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putBoolean("firsttime",false);
editor.apply();
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.home_page, menu);
return true;
}

@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
switch (item.getItemId())
{
case R.id.menu_action_my_profile:
startActivity(new Intent(HomePage.this,MyProfileScreen.class));
finish();
return true;

case R.id.menu_action_my_order:
startActivity(new Intent(HomePage.this,MyOrderActivity.class));

SSGMCE, Shegaon Page | 65


Smart Home Delivery

finish();
return true;

case R.id.menu_action_my_address:
startActivity(new Intent(HomePage.this,ShowMyAddressActivity.class));
finish();
return true;

case R.id.menu_action_logout:
logout();
return true;

default:
return super.onOptionsItemSelected(item);
}
}

public void logout()


{
AlertDialog.Builder ad = new AlertDialog.Builder(this);
ad.setTitle("Logout");
ad.setMessage("Are you sure for logout");
ad.setPositiveButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
ad.setNegativeButton("Logout", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
startActivity(new Intent(HomePage.this, LoginScreen.class));
finish();
}
}).create().show();
}

@Override
public void onBackPressed() {
if (doubletap)
{
super.onBackPressed();
}
else
{
Toast.makeText(this, "Please Press again to exit the app",
Toast.LENGTH_SHORT).show();
doubletap = true;
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
doubletap = false;
}
},2000);
}

}
}

SSGMCE, Shegaon Page | 66


Smart Home Delivery

Chapter 6

6.1 RESULT AND APPLICATION


In this Given Project, we have made an android application for ordering food online
from nearby restaurants. Delivery of that product is done by using drone. This will help
us to reduce human workload, pricing of high service charge, we just need topay for the
electricity used for the charging of drone. Android is open Source platformin which we
can create our own application by the help of suitable programming. API are added for
more features like location tracking, payment method, OTP verification in the android
application.[5][6]

There are 2 Android application in which first is for the restaurant/Admin and second is
for Smart Food Shopping App or common people. Smart Food Shopping App
application includes registration, login, selection of dishes, payment, etc. After all
this method Smart Food Shopping App can track drone location from that app.
Restaurant/Admin app can see the Smart Food Shopping App details and the order
details.[6]

This project can extend by doing some work on drone design which can deliver parcel
at door step in multistoried buildings also. This work is quite difficult todo but can be
done by using Image Processing and Artificial Intelligence. Stability of the drone can be
managed by using Artificial intelligence, it will help to manage parcel to keep it
balanced at the center of the mass of drone.[7]

SSGMCE, Shegaon Page | 67


Smart Home Delivery

Chapter 7

7.1 FUTURE SCOPE

 This order food online system project aimed at developing an online food
ordering system that can be used in small places, and medium cities firstly and then on
a large scale.

 It is developed to help restaurants to simplify their daily operational and


managerial task as well as improve the dining experience of customers.

 Also helps restaurants develop healthy customer relationships by providing good


services.

 The system enables staff to let update and make changes to their food and
beverage list information based on the orders placed and the orders completed.

SSGMCE, Shegaon Page | 68


Smart Home Delivery

Chapter 8

8.1 CONCLUSION AND FUTURE WORK


It is obvious that drone technology is an important part of the future of warfareand is set
to become a big commercial industry. The fact that drones capabilities posea threat to
the liberties of people around the globe is also apparent. Legislating on drones now is of
paramount importance because it sets the necessary limitations to protect rights as drnes
are used in the future. Aim of the project is to deliver the parcel to authenticate Smart
Food Shopping App. Authentication will be done by security parameters. By taking
feedback of authenticate user the drone will return back to its location. We propose an
optimization method for security purpose. Drones can save delivery time and energy
consumption during a delivery operation over manual delivery system. Smart Food
Shopping App’s current location is important for sending the parcel by drone using
navigation System. In this project our main objectives is based on security.

All over the world drones are being used in other ways than by the military, and we
implement the use of drone in Smart Food Shopping App purpose in order to save time.
The proposed System can be helpful in order to deliver the food at the time of disaster
such as flood, earthquake etc. It can also be used in medical emergencies in order to
supply medicines. The service doesn't just ease operational burdens — it brings benefits
to Smart Food Shopping Apps too. Drone-based delivery reduces food degradation and
improves the Smart Food Shopping App experience. Drone can also help to deliver
food packets to the people stuck in the flood. In medical emergencies, if there is urgent
need of blood and its huge traffic in the city it is not possible to deliver that in small
time, so we can use drone to deliver blood to hospital from blood bank.[6][7][8][9]

SSGMCE, Shegaon Page | 69


Smart Home Delivery

Chapter 9
9.1 REFERENCES
[1]. Wireless Communication with Unmanned Aerial Vehicles: Opportunities and
challenges. Yong Zeng, Rui Zhang and Teng Joon Lim (Published on 11 Feb 2016)

[2] LoraWAN as Secondary Telemetry Communication System for Drone


Delivery (IEEE, Published on
2018)

[3] Planning and Evaluation of UAV Mission Planner for Intralogistics Problems,
Thiago R. F. Cavalcante, Iury Bessa, Lucas C. Cordeiro, Federal University of
Amazonas, Manaus, Brazil (University of Oxford, Oxford, United Kingdom, 2017)

[4] Enabling secure location authentication in drone. By-Xiao, F., Zhou, M.,
Liye,Y., Yang, J., and Wang, Q. Poster. Research Gate.

[5] Amazon.com. “Amazon Prime Air”. <


http://www.amazon.com/b?node=8037720011 > https://youtu.be/TedKIlo0c04 Amazon
Deliver Drone Video link.

[6] Radiant Insights. “Commercial Drones Market to Reach $4.8 Billion From
2015 to2012: Radiant Insights”, January 12, 2015.

[7] Drones for Deliveries, Simran Brar, Ralph Rabbat, Vishal Raithatha, George
Runcie, Andrew Yu,Sutardja Center for Entrepreneurship & Technology Technical
Report , Berkeley, University of California. (November 8, 2015)

[8] Anis Koubˆaa, Azza Allouch, Maram Alajlan, Yasir Javed, Abdelfettah
Belghith, and Mohamed Khalgui, "MICRO AIR VEHICLE LINK (MAVLINK) IN A
NUTSHELL: A SURVEY", Journal Of Latex Class Files, Vol. 14, No. 8, August 2015,
The paper is accepted for publication in IEEE Access, June 2019.

[9] robu.in- Hardware Components and details.

SSGMCE, Shegaon Page | 70

You might also like