You are on page 1of 36

VISVESVARAYA TECHNOLOGICALUNIVERSITY

BELAGAVI, KARNATAKA, INDIA

A MINI-PROJECT REPORT
ON

“FOOD RECIPE APP”


Submitted in partial fulfillment of the requirement for the VI semester BE in
Information Science and Engineering
Mobile application development mini-project-18CSM6P68
Submitted by
DARSHINI A [1SG18IS031]
HARSHITHA PV [1SG18IS039]

Under the guidance of


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

DEPARTMENT OF INFORMATION SCIENCE & ENGINEERING


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

Department of Information Science & Engineering

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

Signature of the Guide Signature of the HOD

Prof. Veena Dhavalgi Dr H R Ranganatha


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

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

In today’s hectic world of work loaded life, there is no time for an individual to give a
dedicated schedule for making his daily meals. One just want to relax after returning from
work, either by ordering in a takeaway or heading out to a delicious establishment near
them. At times it becomes a very tedious work for humans to think on, for what to make
at dinner in such limited materials available. The food industry is an underserved market.
The possibilities are wide-open, and the competition is scarce. Entrepreneurs can easily
make a quick turn around by providing a much needed service. We have hence,
developed an Android Application which would make the task of preparing meals a less
tensed for an individual.

The system is an Android Application- FoodRecipe, which provides the users with
simplified recipes which are easy to understand and easier to make and can be accessed
even when the user is offline with the assistance of something which they carry with them
all the time and hence can access it at anyplace and anytime. The system has a structured
User-interface unlike most of the cooking apps that are available. User gets overall
information about the food, the details includes the number of servings, total time to
cook, calories contained in particular food, step by step procedure with the relevant
quantity of ingredients, further helpful tips and also YouTube link will be provided for
further more details. In this app there is no need to register; login or signup; as the user
opens the app, mouth craving list of food items appears on the screen, making it a simple
task. For the user convenience the dishes are arranged in alphabetical order, so that one
can reach easily navigate through the list. The user can scroll down the slide and learn the
proper procedure and other details about the dish. The app can be easily installed in the
users phone and can be used by them at no cost.
ACKNOWLEDGEMENT

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

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


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

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

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

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

DARSHINI A (1SG18IS031)
HARSHITHA PV (1SG18IS039)
TABLE OF CONTENTS

Chapter 1: INTRODUCTION 1
Chapter 2: SYSTEM ANALYSIS 5
2.1 Literature Survey 1
2.2 Proposed System 7
2.2.1 Scope of the Project 7
2.2.2 Aim of the Project 8
Chapter 3: REQUIREMENT SPECIFICATIONS 9

3.1 System Requirements 9

3.1.1 Hardware Configuration 9

3.1.2 Software Configuration 9

3.2 Development Environment 9

Chapter 4: SYSTEM DESIGN 12

4.1 Project Flow 12

4.2 Design using XML 13

Chapter 5: SYSTEM IMPLEMENTION 19

Chapter 6: SNAPSHOTS 24

CONCLUSION AND FUTURE ENHANCEMENT 29


REFERENCES 30
LIST OF FIGURES

Figure No. Figure name Page No.

3.1 STRUCTURE LAYOUT OF ANDROID STUDIO 10

4.1 FLOW CHART OF THE PROJECT 12

4.2.1 SPLASH SCREEN DESIGN 13

4.2.2 GRID VIEW DESIGN 14

4.2.3 SCROLL VIEW DESIGN 16

6.1 OPENING SCREEN 24

6.2 RECIPE MENU 25

6.2 SELECT A FOOD ITEM 26

6.3 RECIPE CONTENT 27

6.4 SAMPLE VIEW 28


Mobile Application Development

CHAPTER 1

INTRODUCTION

1.1 PROJECT OVERVIEW


Food is one of the main human needs. Though food is the source of energy obtained. In
its development, food today is not only used as a filler of energy needs, but more than that
food has become an art and has added value. A wide variety of innovative creations in
food have been developed and spread widely. Many of them use only the minimal amount
of material to create an original recipe. A recipe is a set of instructions telling how to
prepare and cook food in detail. Cooking recipe consists of several aspects including:
name, number of servings, time, calories, steps, amount of Ingredients and few tips. Not
everyone can memorize well the recipes they want. Their material is also an obstacle in
cooking, especially for someone who does not have passion in cooking. To find a proper
Source of learning to cook for a beginner is difficult. That’s why we have come up with
the idea of cooking recipe app.

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

1.2 MOBILE APPLICATION DEVELOPMENT

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

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

Department of ISE 2020-21 Page 1


Mobile Application Development

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

ADVANTAGES:
 Improves Efficiency.
 Offers High Scalability.
 Secures the App Data.
 Integrates With Existing Software.
 Easy to Maintain.
 Improves Customer Relationship.
 Facilitates New Client Data Retrieval.
 Provides Real-time Project Access.
 Ease in Project Management.

1.3 ANDROID STUDIO

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

Department of ISE 2020-21 Page 2


Mobile Application Development

FEATURES:
 A flexible Gradle-based build system.
 A fast and feature-rich emulator.
 A unified environment where one can develop for all Android devices.
 Apply Changes to push code and resource changes to the running app without
restarting the app.
 Code templates and GitHub integration to help build common app features and
import sample code.
 Extensive testing tools and frameworks.
 Lint tools to catch performance, usability, version compatibility, and other
problems C++ and NDK support.
 Built-in support for Google Cloud Platform, making it easy to integrate Google
Cloud Messaging and App Engine.

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

FEATURES OF JAVA:
 Simple: Java is designed to be easy to learn.
 Secure: With Java’s secure feature it enables to develop virus-free, tamper-free
systems. Authentication techniques are based on public-key encryption.
 Architecture-neutral: Java compiler generates an architecture-neutral object file
format, which makes the compiled code executable on many processors, with the
presence of Java runtime system.
 Portable: Being architecture-neutral and having no implementation dependent
aspects of the specification makes Java portable. The compiler in Java is written in
ANSI C with a clean portability boundary, which is a POSIX subset.
 Robust: Java makes an effort to eliminate error-prone situations by emphasizing
mainly on compile time error checking and runtime checking.

Department of ISE 2020-21 Page 3


Mobile Application Development

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


that can perform many tasks simultaneously. This design feature allows the
developers to construct interactive applications that can run smoothly.
 Interpreted: Java byte code is translated on the fly to native machine instructions
and is not stored anywhere. The development process is more rapid and analytical
since the linking is an incremental and light-weight process.
 High Performance: With the use of Just-In-Time compilers, Java enables high
performance.
 Distributed: Java is designed for the distributed environment of the internet.
 Dynamic: Java is considered to be more dynamic than C or C++ since it is
designed to adapt to an evolving environment. Java programs can carry an
extensive amount of run-time information that can be used to verify and resolve
accesses to objects at run-time.

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

FEATURES OF XML:
 XML focuses on data rather than how it looks.
 Easy and efficient data sharing.
 Compatibility with other markup language HTML.
 Supports platform transition.
 Allows XML validation.
 Adapts technology advancements.
 XML supports Unicode.

Department of ISE 2020-21 Page 4


Mobile Application Development

CHAPTER 2

SYSYTEM ANALYSIS

2.1 LITERATURE SURVEY

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

Food is important for physical and mental well-being. It is more than just a primary factor
for survival for some, for others, it is a major factor which can change a grumpy mood
into frivolous one. After a long day of work, or a hectic schedule people want to come
home eat food and relax. Surely takeouts are easy and delicious but home-cooked meal
has its own flavor and satisfaction.

To find a proper source of learning to cook for a beginner is difficult. That’s why we have
come up with the idea of cooking recipe app which provides users with step-by-step
recipes to make the task of preparing a meal less hectic. In today’s world a person can
prepare a dish either by asking another person who has acquired such knowledge of
cooking or by reading certain cooking recipe books, and gaining self-knowledge by
owning such books. Another way of making delicious recipes is by searching for the
recipes over the internet, read the instructions and prepare it.

2.1.1 EXISTING SYSTEM

 In the current system, the recipes are maintained in the book. A person has to
write the entire recipe in the book which is not a convenient way to manage the
methods to cook as at the time of need of a recipe it will take a lot of time as well
as the information is not safe. The data can be lost or it can be changed by any
person. It does not provide the information about the latest method.

Department of ISE 2020-21 Page 5


Mobile Application Development

 If user wants to search for their favorite recipe, user will go to web, say Google,
and search for his recipe in his mind. The search results may redirect user to any
other food blog website or any video casting site. But in that website all the
information required like list of ingredients, cooking instructions may or may not
be available at one place. Moreover one have to go through too many results to
choose which result suits them the best. This system involves more time and
analysis which is a tedious task, thus not ideal for many users.
 There are many food blogs which provide lot of information about recipes but the
disadvantages with this kind of blogs is most of the times they don’t provide with
relevant information regarding ingredients or the method of cooking. So people
have to search on the web and provided with numerous options throwing users
into dilemma which one to rely and if it is video that have to manually point down
the ingredients or remember those list of ingredients which is not at all an ideal
thing to do.
 Today Do It Yourself concept has become very popular in the World. Urban
Indian consumers are wildly drawn to the idea of cooking meals from the comfort
of their homes. Surely there are many good recipe apps which provide thousands
of recipes but a good application lacks a small feature that prevents it from
making it a great application. We noticed a few things which were missing-
offline availability of recipes and other details which builds a relevant idea in user
about the dish.

DISADVANTAGES:
 Unavailable for offline use.
 Not accessible anytime.
 Involves more time and analysis.
 Lose of manual data.
 Confusion to choose one among several options available.
 Lose of data.
 Lack of relevant information.
 Subscription recommended by paying money.

Department of ISE 2020-21 Page 6


Mobile Application Development

2.2 PROPOSED SYSTEM

2.2.1 SCOPE OF PROJECT

The purpose of creating this Application is to outcast the discrepancies in hundreds of


existing systems on different platforms.

The FoodRecipe is an Android Application which provides the user a list of dishes which
can be cooked provided with the information which user wishes to cook. The user is
given step by step guide on how to prepare a dish they wish to cook, chosen from the list
of recipes provided. Our app not only gives the user a clear cut instruction on how to
make that lip smacking dish but also shows the user on how chef’s do it by seeing the
video through links provided along with the step-by-step instructions of the dish. We
boost a list of recipes from which the user can pick any of them and start cooking in no
time. Giving clear cut instructions to the user not only saves time to the user but also
leaves the user with less ambiguity.

Developing this Android-based mobile carve user’s choice. Food App is to provide easy
food application to the users those who want to explore tasty food in their kitchen. This
app can be helpful to the newcomers to prepare delicious food.

Compared to other applications, which only has some food items or general information
about the recipes, our FoodRecipe application by listing all items in menu allows users to
know how much quantity of ingredients they need so that one can decide whether to cook
the recipe or not.

SUPPORTED FEATURES:

 GET RECIPES MENU: All the recipes will be shown in a particular slide in order
for the ease of the customers. Where customers can easily select the particular
recipe for the further instructions.
 INSTRUCTIONS: When customer selects a particular recipe then entire process
of how to cook will be shown in the next slide which includes instructions and
ingredients required for particular recipe followed by other details.

Department of ISE 2020-21 Page 7


Mobile Application Development

 IMAGE OF THE RECIPE: After the instruction phase of how to cook the
particular recipe, an image will be provided for the garnishing and creativity of the
recipe.
 YOUTUBE LINK: A YouTube link will be provided after the instruction phase in
order for the ease of the customer. The links helps the user’s to make sure that
they are following the given instructions correctly, and also see how the chefs do
it and learn a thing or two from them.
 OTHER INFORMATION: Number of servings, total time to cook and calorie
related additional information will be given to each recipe which brings a user an
idealistic view about the food they want to cook.

ADVANTAGES:
 Time-saving, Conduit-free setup, and maintenance.
 Ease of Use and Implementation.
 Structured UI.
 Offline availability of recipes.
 The system has a friendly user interface for quick and easy Navigation.
 The app houses a collection of recipes integrated within the app itself, which the
user can access anytime.
 Provided with relevant information.
 FoodRecipe will appeal to a very wide audience since both job workers, proficient
cooks, and those who only wish to cook more but lack the knowledge of recipes
can benefit from this application.

2.2.2 AIM OF THE PROJECT

Today, users are increasingly drawn towards the idea of cooking meals from the comfort
of their homes. Finding the proper source for recipes to cook for a beginner is difficult,
that’s where our app comes into the picture.
Our aim is to help users cook great food with simplified recipes which are easy to
understand and even easier to make, which can be accessed even when the user is offline
with the assistance of something which they carry with them all the time and hence can
access it at anyplace and anytime, at no cost.

Department of ISE 2020-21 Page 8


Mobile Application Development

CHAPTER 3

REQUIREMENT SPECIFICATION

3.1 SYSTEM REQUIREMENTS

3.1.1 Hardware Configuration


 Processor: Intel(M) Core™ CPU @ 2.30Ghz on Windows® 10 64-Bit
 RAM: 8GB (IDE + Android SDK + Android Emulator)/ 4GB (minimum)
 Memory: 256GB Hard drive
 Keyboard: MS compatible keyboard
 Mouse: MS compatible mouse

3.1.2 Software Configuration


 Operating system: Windows® 10 64-Bit
 Tool kit: Android SDK (Software development kit), Java development kit (JDK)
 IDE: Android Studio

3.2 DEVELOPMENT ENVIRONMENT

ANDROID PROGRAMMING LANGUAGES: In Android, basically, programming is


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

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

Department of ISE 2020-21 Page 9


Mobile Application Development

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


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

STRUCTURAL LAYOUT OF ANDROID STUDIO:

SNAPSHOT 3.1: STRUCTURE LAYOUT OF ANDROID STUDIO

Department of ISE 2020-21 Page 10


Mobile Application Development

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

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

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

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

Department of ISE 2020-21 Page 11


Mobile Application Development

CHAPTER 4

SYSTEM DESIGN

4.1 PROJECT FLOW

START
APP

SPLASH
SCREEN

RECIPE
MENU

CHOOSE
RECIPE

VIEW
RECIPE

FIG 4.1: FLOW CHART OF THE PROJECT

Once the app is installed in the android mobile phone, the user will be able to
open the app and the splash screen appears on the screen as the app starts. Frequently, the
app provides the menu of the food items (image and name of the food) whose recipes are
available on the app. The user can choose any dish of his choice by scrolling down the
menu, for user’s ease the food items are arranged in alphabetical order, so that user can
easily navigate to the dish he desires. Finally, the user can click on any dish to view the
description of its recipe and other details.

Department of ISE 2020-21 Page 12


Mobile Application Development

4.2 DESIGN USING XML

4.2.1 Splash Screen design

Food image
<image view>

Progress
bar

FIG 4.2.1: SPLASH SCREEN

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

Department of ISE 2020-21 Page 13


Mobile Application Development

Splashcreen.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
tools:context=".SplashScreen">
<ImageView
android:layout_width="200dp"
android:layout_height="200dp"
android:src="@drawable/f12"/>
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>

4.2.2 Grid View design

FIG 4.2.2: FOOD ITEMS GRID VIEW

Department of ISE 2020-21 Page 14


Mobile Application Development

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


scrolling grid. Items are inserted into this grid layout from a database or from an
array. The main function of the adapter in GridView is to fetch data from a
database or array and insert each piece of data in an appropriate item that will be
displayed in GridView.
 An adapter acts like a bridge between a data source and the user interface. It
reads data from various data sources, coverts it into View objects and provides it
to the linked Adapter view to create UI components.
 ListSelector: It is a drawable used to indicate the currently selected item in the
list.

Activity_main.xml:
<LinearLayout 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:orientation="vertical"
android:layout_height="match_parent"
tools:context=".MainActivity">
<GridView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/gridViewId"
android:numColumns="2"
android:listSelector="#ff22"
android:horizontalSpacing="10dp"
android:verticalSpacing="10dp"/>
</LinearLayout>

Department of ISE 2020-21 Page 15


Mobile Application Development

4.2.3 Scroll View design

<Scroll view>
FOOD IMAGE
<Image view>

RECIPE
<Text view>

FIG 4.2.3: SCROLL VIEW OF CONTENT

 ScrollView is a view group that is used to make vertically scrollable views. A


scroll view contains a single direct child only. In order to place multiple views in
the scroll view, one needs to make a view group (like LinearLayout) as a direct
child and then we can define many views inside it. A ScrollView supports Vertical
scrolling only.
 A TextView displays text to the user and optionally allows them to edit it.

Activity.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"> /*Activity name*/
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView

Department of ISE 2020-21 Page 16


Mobile Application Development

android:layout_width="match_parent"
android:layout_height="250dp"
android:scaleType="fitXY"
android:src="@drawable/"/> /*image*/
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/" /*content*/
android:textSize="20sp"
android:textStyle="bold"/>
</LinearLayout
</ScrollView>

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

Strings.xml:

<resources>
<string name="app_name">FoodRecipeApp</string>
<string-array name="food">
<item> food item</item> /*food item name*/
</string-array>
<string name="Food item">
/*Content of recipe*/
</string>
</resources>

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

AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.foodrecipeapp">
<application

Department of ISE 2020-21 Page 17


Mobile Application Development

android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.FoodRecipeApp">
<activity android:name=".Activity"></activity> /*All activities*/
<activity android:name=".SplashScreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity" />
</application>
</manifest>

Department of ISE 2020-21 Page 18


Mobile Application Development

CHAPTER 5

SYSTEM IMPLEMENTATION

5.1 MAIN ACTIVITY:


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

MainActivity.java:
package com.example.foodrecipeapp;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;

Department of ISE 2020-21 Page 19


Mobile Application Development

import android.view.View;
import android.widget.AdapterView;
import android.widget.GridView;
public class MainActivity extends AppCompatActivity {
private GridView gridView;
int[] pic={R.drawable.image }; /*images inserted from drawable layout*/
String[] foodNames;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
foodNames=getResources().getStringArray(R.array.food);
gridView=(GridView)findViewById(R.id.gridViewId);
CustomAdapter adapter= new CustomAdapter(this,foodNames,pic);
gridView.setAdapter(adapter);
gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l)
{
if(i==i){ /*all activities (0-19)*/
Intent intent=new Intent(MainActivity.this,Activity.class);
startActivity(intent);
}}});}}

5.2 CUSTOM ADAPTER:


 LayoutInflater is a class used to instantiate layout XML file into its
corresponding view objects which can be used in Java programs. In simple terms,
there are two ways to create UI in android. One is a static way and another is
dynamic or programmatically. In this context, Inflate means reading a layout
XML (often given as parameter) to translate them in Java code.
 BaseAdapter is a common base class of a general implementation of an Adapter
that can be used in ListView, GridView, Spinner etc. Whenever one need a
customized list in a ListView or customized grids in a GridView one create their

Department of ISE 2020-21 Page 20


Mobile Application Development

own adapter and extend base adapter in that. Base Adapter can be extended to create
a custom Adapter for displaying a custom list item.
CustomAdapter.java:
package com.example.foodrecipeapp;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
public class CustomAdapter extends BaseAdapter {
Context context;
int[] pic;
String[] foodNames;
private LayoutInflater inflater;
CustomAdapter(Context context,String[] foodNames,int[]pic){
this.context=context;
this.foodNames=foodNames;
this.pic=pic;
}
@Override
public int getCount() {
return foodNames.length;
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return 0;
}
@Override

Department of ISE 2020-21 Page 21


Mobile Application Development

public View getView(int i, View view, ViewGroup viewGroup) {


if (view==null) {
inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SER
VICE);
view = inflater.inflate(R.layout.sample_view, viewGroup, false);
}
ImageView imageView=(ImageView) view.findViewById(R.id.imageViewId);
TextView textView=(TextView)view.findViewById(R.id.textViewId);
imageView.setImageResource(pic[i]);
textView.setText(foodNames[i]);
return view;
}
}

5.3 SPLASH SCREEN:


A splash screen is mostly the first screen of the app when it is opened. It is a constant
screen which appears for a specific amount of time, generally shows for the first time
when the app is launched. The Splash screen is used to display some basic introductory
information such as the company logo, content, etc just before the app loads completely.

SplashScreen.java:
package com.example.foodrecipeapp;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
public class SplashScreen extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_screen);
Thread thread=new Thread(){
public void run(){
try{
sleep(5000);
Department of ISE 2020-21 Page 22
Mobile Application Development

}
catch(Exception e){
e.printStackTrace();
}finally {
Intent intent= new Intent(SplashScreen.this,MainActivity.class);
startActivity(intent);
}
}
};thread.start();

}
}

5.4 ACTIVITY:
An activity is a single, focused thing that the user can do. Almost all activities interact
with the user, so the activity class takes care of creating a window in which UI can be
placed with the content. onCreate(Bundle) initializes the activity.

Activity.java:
package com.example.foodrecipeapp;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class Activity extends AppCompatActivity { /*All activities*/
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity);
getSupportActionBar().hide();
}}

Department of ISE 2020-21 Page 23


Mobile Application Development

CHAPTER 6

SNAPSHOTS

SNAPSHOT 6.1: OPENING SCREEN


As the user opens the app, Opening screen i.e., SplashScreen appears until the app loads
completely. It displays the image and progress bar.

Department of ISE 2020-21 Page 24


Mobile Application Development

SNAPSHOT 6.3: RECIPE MENU


After the app is loaded, the menu of food items whose recipes are available on the app
appears on the screen. This view contains the images and the respective names of the
dishes which is been arranged in the alphabetical order. The user can scroll down the
menu to view all the food items available.
Department of ISE 2020-21 Page 25
Mobile Application Development

SNAPSHOT 6.4: SELECT A DISH


User can choose a particular dish to view its recipe and other details. The selected dish is
indicated with Red Selector. In this image, item Coffee is been selected.

Department of ISE 2020-21 Page 26


Mobile Application Development

SNAPSHOT 6.5: RECIPE CONTENT


The user can view the recipe of the dish he selected. The recipe contains image, details of
number of servings, total time for preparation, calories the dish contain, method described
in steps, further useful tips and a YouTube link is provided for reference. The user can
scroll down to view all details.

Department of ISE 2020-21 Page 27


Mobile Application Development

SNAPSHOT 6.6: SAMPLE VIEW


This is a sample view of all the recipes and its details available on the app.

Department of ISE 2020-21 Page 28


Mobile Application Development

CONCLUSION AND FUTURE ENHANCEMENT

Our generation relies mostly on phones to get through the day. Due to this, phones have
become more of a personal assistant than a means to just communicate. Keeping this
thing in mind we wanted to use the concept of a phone as a personal assistant for helping
the users to cook like a master even when they don’t know a thing about cooking. The
system is an Android Application- FoodRecipe, which is capable of addressing all the
issues in an efficient way providing an ideal platform to look for a food recipe and get all
the required information at anytime, anywhere and at no cost.

Following are the Enhancements to the application:-


 Features like searching, sharing recipes, categorized view, quick access to
favorites can be implemented.
 Nutritional count and other healthy aspects expected in the future.
 Add more recipes and save options can be provided.

Department of ISE 2020-21 Page 29


Mobile Application Development

REFERENCES

1) www.google.com
2) www.youtube.com
3) www.github.com
4) www.w3schools.com
5) www.tutorialspoint.com
6) https://www.geeksforgeeks.org
7) https://developer.android.com
8) https://recipes.timesofindia.com/recipes

Department of ISE 2020-21 Page 30

You might also like