You are on page 1of 49

(Summer Training)

A Summer Training Report Submitted


In Partial Fulfillment of the Requirements
For the degree of Bachelor of Technology

DEPARTMENT OF COMPUTER SCIENCE &


ENGINEERING
SHRI RAMSWAROOP MEMORIAL UNIVERSITY
November, 2022

Submitted to Submitted by
Ms. Prabha Singh Divyanshu Singh Rathour
201910101110123
B.Tech (CSE) Fourth Year

List of Figures
Fig.1.1: Android…………………………………………………………..1
Fig.1.4: Categories of Android…………………………………………....4
Fig.1.9: Android Toolkit…………………………………………………..7
Fig.2.1: Setup the Kotlin Compiler for Command line……………………9-10
Fig.2.2: Kotlin vs. Java…………………………………………………….13
Fig.3.5: Android Activity Life Cycle Method……………………………..18
Fig.4.6 Android Fragment………………………………………………….25
Fig.5.2: Splash screen……………………………………………………....28
Fig.5.3: Log in……………………………………………………………...29
Fig.5.4: Add user…………………………………………………………..30
Fig.5.5: Add food info……………………………………………………..31
Fig.5.6: Modify food info………………………………………………….32
Fig.5.7: User information…………………………………………………..33
Fig.5.8: Navigation Drawer………………………………………………..34
Fig.5.9: User profile………………………………………………………..35
Fig.5.10: User order………………………………………………………..36
Fig.5.11: Contact Us……………………………………………………….37
Fig.5.12: Log out…………………………………………………………..38
Fig.5.13: Order place………………………………………………………40
Fig.5.14: Developer info…………………………………………………...41
Fig.5.15: Order conformation……………………………………………...42
Table of Contents

Chapter 1: INTRODUCTION TO ANDROID

1.1Android……………………………………………………….. 1
1.2 Features of Android…………………………………………...2
1.3Android Application…………………………………………...3
1.4 Categories of Android Application…………………………....3
1.5 History of Android………………………………………….... 4
1.6 Functional Components of the projects……………………......4
1.7Advantages of food ordering system……………………...........5
1.7.1 Easy communicative…………………….....................5
1.7.2 Time saving…………………......................................5
1.7.3 Delivery place…………………...................................5
1.7.4 Always open restaurant…………………....................6
1.7.5 Payment Any…………………....................................6
1.8 Disadvantage of online food ordering system………………....6
1.8.1 Cost of increase…………………................................6
1.8.2 Change of environment…………………....................6
1.9 Android Toolkit..............................................................…........7

Chapter 2: WORLD OF KOTLIN

2.1 Kotlin………….……………………………………………….8
2.2 Kotlin Environment Setup...…………………………………...8
2.2 Useful Kotlin Features…………………………………………11
2.2.1 Kotlin is open source………………………………….11
2.2.2 Kotlin supports full java interoperability……………...11
2.2.3 Kotlin comes with lazy loading features………………11
2.2.4 Data Classes in Kotlin…………………………………12
2.2.5 Collection Filtering……………………………………12

2.3 Kotlin vs. Java Functions and features…………………………12

2.4 Kotlin vs. Java which language is best……………………...….14

Chapter 3: ANDROID KICK-OFF


3.1 Database …………………………………………………….…...15
3.2 Firebase………………..…………………………………………15
3.3 Android Studio…………………………………………………...16
3.4 Android Activity Life Cycle……………………………………...17
3.5 Android Life Cycle Method………………………………………17
3.6 Android Intent…………………………………………………….19
3.7 Types of Android Intent…………………………………………..19
3.8 View………………………………………………………………19
3.9 ViewGroup………………………………………………………..20

Chapter 4: HIGHER ORDER FUNCTIONALITIES

4.1 Types of Android Layout……………………………...………….21


4.2 UI/UX Design…………………………………………………….21
4.3 Key Components of UI/UX design……………………………….22
4.3.1 InformationArchitecture……………………………..…...22
4.3.2 InteractionDesigns………………………………………..22
4.3.3 Usability…………………………………………………..22
4.3.4 Wireframing………………………………………………22
4.3.5 VisualDesign……………………………………………...22

4.4 Importance of UI/UX in Mobile App……………………………...23


4.4.1 Captivates Users…………………………………………..23
4.4.2 enhanced customers complacency & improved ROI……..23
4.4.3 Conserves time and cost…………………………………..23
4.4.4 UI/UX design boost your brand…………………………...23
4.4.5 It enhanced customer satisfaction hence improved ROI…..23
4.4.6 Helps you understand your audience………………………23
4.4.7 Investing in an efficient UI/UX design……………………23
4.4.8 Saves time and money……………………………………..23
4.5 Coordinator Layout…………………………………………………24
4.6 Android Fragment…………………………………………………..24
4.7 Android Fragment Life Cycle Method……………………………...25

Chapter 5: THE FINAL PROJECT


5.1 Background management platform………………………………27
5.1.1 Splash Screen……………………………………………28
5.1.2 Log In……………………………………………………29
5.1.3 Add user…………………………………………………30
5.1.4 Add food info……………………………………………31
5.1.5 Modify food info………………………………………...32
5.1.6 User information…………………………………………33
5.1.7 Navigation drawer……………………………………….34
5.1.8 User profile………………………………………………35
5.1.9 User orders……………………………………………….36
5.1.10 Contact us……………………………………………….37
5.1.11 log out…………………………………………………...38
5.1.12 Order place………………………………………………39
5.1.13 Developer info…………………………………………...41
5.1.14 Order conformation……………………………………...42
5.2 References……………………………………………………43
CHAPTER-1. INTRODUCTION TO ANDROID

1.1 Android
Android is an open-source and Linux-based Operating System for mobile devices such as
smartphones and tablet computers. Android was developed by the Open Handset Alliance, led by
Google, and other companies. Android offers a unified approach to application development for
mobile devices which means developers need only develop for Android, and their applications
should be able to run on different devices powered by Android. The first beta version of the
Android Software Development Kit (SDK) was released by Google in 2007 whereas the first
commercial version, Android 1.0, was released in September 2008. On June 27, 2012, at the
Google I/O conference, Google announced the next Android version, 4.1 Jelly Bean. Jelly Bean
is an incremental update, with the primary aim of improving the user interface, both in terms of
functionality and performance. The source code for Android is available under free and open-
source software licenses. Google publishes most of the code under the Apache License version
2.0 and the rest, Linux kernel changes, under the GNU General Public License version 2.

Figure 1.1

1
1.2 Features of Android

Android is a powerful operating system competing with Apple 4GS and supports great features.
Few of them are listed below −

Sr. No. Feature & Description

1 Beautiful UI
Android OS basic screen provides a beautiful and intuitive user interface.

2 Connectivity
GSM/EDGE, IDEN, CDMA, EV-DO, UMTS, Bluetooth, Wi-Fi, LTE, NFC and
WiMAX.

3 Storage
SQLite, a lightweight relational database, is used for data storage purposes.

4 Media support
H.263, H.264, MPEG-4 SP, AMR, AMR-WB, AAC, HE-AAC, AAC 5.1, MP3,
MIDI, Ogg Vorbis, WAV, JPEG, PNG, GIF, and BMP.

5 Messaging
SMS and MMS

6 Web browser
Based on the open-source WebKit layout engine, coupled with Chrome's V8
JavaScript engine supporting HTML5 and CSS3.

7 Multi-touch
Android has native support for multi-touch which was initially made available in
handsets such as the HTC Hero.

8 Multi-tasking

2
User can jump from one task to another and same time various application can
run simultaneously.

9 Resizable widgets
Widgets are resizable, so users can expand them to show more content or shrink
them to save space.

10 Multi-Language
Supports single direction and bi-directional text.

11
GCM
Google Cloud Messaging (GCM) is a service that lets developers send short
message data to their users on Android devices, without needing a proprietary
sync solution.

12 Wi-Fi Direct
A technology that lets apps discover and pair directly, over a high-bandwidth
peer-to-peer connection.

13 Android Beam
A popular NFC-based technology that lets users instantly share, just by touching
two NFC-enabled phones together.

1.3 Android Applications

Android applications are usually developed in the Java language using the Android Software
Development Kit.
Once developed, Android applications can be packaged easily and sold out either through a store
such as Google Play, SlideME, Opera Mobile Store, Mobango, F-droid and the Amazon
AppStore.
Android powers hundreds of millions of mobile devices in more than 190 countries around the
world. It's the largest installed base of any mobile platform and growing fast. Every day more
than 1 million new Android devices are activated worldwide.

3
This tutorial has been written with an aim to teach you how to develop and package Android
application. We will start from environment setup for Android application programming and
then drill down to look into various aspects of Android applications.

1.4 Categories of Android applications

There are many android applications in the market. The top categories are –

Figure 1.2

1.5 History of Android

The code names of android ranges from A to N currently, such as Aestro, Blender, Cupcake,
Donut, Eclair, Froyo, Gingerbread, Honeycomb, Ice Cream Sandwitch, Jelly Bean, KitKat,
Lollipop and Marshmallow. Let's understand the android history in a sequence.

1.6 Functional components of the project


Following is a list of functionalities of the system. More functionality that you find appropriate
can be added to this list. And, in places where the description of functionality is not adequate,
you can make appropriate assumptions and proceed.
 

4
 It provides the facility to the customers who want to order food online due to lack of
time.
 Provides the searching facilities based on various factors. Such as Food, Shopping Cart,
Customer, Order
 It tracks all the information of Item Category, Delivery Address, Customer etc.
 Manage the information of Item Category
 Shows the information and description of the Food, Shopping Cart
 It’s providing the full details about the product and related information about the product
like cost and delivery time.
 With the help of it we can save the time.
 Manage the information of Food
 

1.7 Advantage of online food ordering system

1.7.1 Easy communicative


The online food ordering service is a local restaurant and food cooperative website or
application for customers. Due to the rapid growth of smart phone or tablet in the use of internet
and the technologies associated with the several opportunities to communicative, consumer. So
many restaurant are now undertaking into their business with communicate because of the
internet and telephone. One of the businesses that the internet introduced is an online food
ordering system. In today life many restaurants have focus on quick preparation and speedy
delivery orders.

1.7.2 Time saving


The online food ordering is now days popular among the young generation comfortable, time
saving and convenient. It is recent survey a consumer makes a mind to purchase online food he
or she is multiple food items or menu card. The main identified factors are time saving, and
convenience. People compare prices in online food delivery website and apps selection of the
dish. The restaurants have to make proper strategies to increase the consumer level of
satisfaction.

1.7.3 Delivery place


In the system design to allow customers to go online and place order for their food single or
multiple food items. Recently, most of this delivery orders were placed over the phone, a major
breakthrough is the wireless 2 telephone system which comes in landline telephone lines or
Mobile communication and internet and have the goods delivered at his/her home. Because main
function his, GPS system should be on the facility to search service by any location and home
location.

5
1.7.4 Always open restaurant

In the restaurant might not be opened 24/7, but your online ordering system surely. And it can
help you make money even while you sleep. By using an online food ordering system, you give
your clients the flexibility to place and convenient time the orders. Even if that happens outside
your business hours. Because they can easily choose to schedule to prefer pickup or delivery
time open up to clients all day, every day within your working time.

1.7.5 Payment Any

Food from anywhere the internet to and have the goods delivered at home. But the transfer
method cash on payment or online payment. In other words possible to online pay digital cash. A
customer will Payment can be amongst others either by credit card, more over the online
payments benefit discount, coupon, gift prize with the restaurant returning to attractive a
customer.

1.8 Disadvantage of online food ordering system


1.8.1 Cost of increase

Online food ordering system service know days increase your budget. Because of need a new
delivery team to provide the services and you need to spend extra charges? In this system all type
expense can be transfer on consumers.

1.8.2 Change of environment

The main different between the online food ordering and dining in a restaurant is the
environment around us. If one person eats within home or he may not feel a change in
environment and refreshment and relax. But comfort is really high level of online food take
away. If he dine-in luxury restaurant with super design and light music that environment gives
better relax compared to the other.

1.9 Android Toolkit


Android SDK stands for Android Software Development Kit which is developed by Google for
Android Platform. With the help of Android SDK, we can create android Apps easily. Android
SDK is a collection of libraries and Software Development tools that are essential for
Developing Android Applications. Whenever Google releases a new version or update of
Android Software, a corresponding SDK also releases with it. In the updated or new version of
SDK, some more features are included which are not present in the previous version. Android

6
SDK consists of some tools which are very essential for the development of Android
Application. These tools provide a smooth flow of the development process from developing and
debugging. Android SDK is compatible with all operating systems such as Windows, Linux,
macOS, etc. Android SDK tool is an important component of Android SDK. It consists of a
complete set of development and debugging tools. Below are the SDK developer tools: Android
SDK Build tool. Android Emulator. Android SDK Platform-tools. Android SDK Tools. These
are shown below:

Figure 1.1

7
Chapter-2. World of Kotlin

2.1 Kotlin

Kotlin is a cross-platform, statically typed programming language initiated and developed by the
company JetBrains. As a language, Kotlin leans heavily on Java and one of Kotlin’s goals was to
achieve the same high compilation speed as Java.
Kotlin is still a relatively new programming language at just six years old. While it was under
beta development for several years before that, the first “stable” release (Kotlin 1.0) was only
released by JetBrains in February 2016.
Since then, Kotlin has quickly gained traction, with its popularity boosted by Google making it
an officially-supported programming language for Android development in 2017. Kotlin
experienced a further surge in adoption when Google officially made the language its
recommended choice for Android app development in 2019 – Android’s Kotlin-first approach.
Despite Kotlin’s short existence, more than 20% of the apps active in the Play Store today have
been coded with it. Among the most popular 500 US apps, an impressive 87% were developed
with Kotlin. Kotlin is today’s #1 choice for Android app development for many developers as
well as Google.
However, Kotlin is not just for Android apps and is also used for other applications. The
language can also be used for front-end as well as back-end web development, data science
and cross-platform mobile development

2.1 Kotlin Environment setup for Command Line

Prerequisite to install Kotlin –


Kotlin runs on Java Virtual Machine, so it is necessary to install JDK and set the path in local
system environment variable. To install the JDK and JRE in your system and set the path in
environment variable

8
Download the Kotlin compiler –
You can download the latest version of standalone compiler of Kotlin form Github Releases.
Now the latest version is 1.3.31.

Setup the Kotlin compiler for command line –

 First of all, extract the downloaded file in any location where you have write access.
 Copy path upto bin directory of kotlinc.

 Now open my computer properties ->Advance System setting and then click


on environment variables.

 Click on the path in system variables then edit button.

9
 Now paste the copied path of bin directory here and click ok -> ok -> ok.

 Verify the installation by typing kotlinc in command prompt.

10
2.2 Useful Kotlin Features

Before we get to those features, remember that these are focuses specifically on using with the
context of Android application development.

Therefore, you should be familiar with using Kotlin with Android studio from Jetbrains. Please
go through these 12 features of Kotlin one-by-one:

2.2.1 Kotlin is Open-Source


The very first thing you should know about Kotlin is that it is an open-source
programming language. But, apart from being open-source, Kotlin also provides a single-
click tool using which, developers can convert existing Java code.
And if you’re an Android app developer who is new to Kotlin and interested in learning it
from scratch, we recommend starting with the beginner course available on Udemy and
Udacity. These courses will help you to sharpen your skills

2.2.2 Kotlin Supports Full Java Interoperability


One of the major as well as the best features of Android Kotlin is its deep interoperability
with Java. This, in fact, has attracted many Java developers as well as Android app
developers to learn Kotlin.
It basically runs on JVM and also supports Java libraries as well as tools, providing full
Java interoperability.
Both the languages co-exist, and this makes it easier for developers to be productive.
Developers can easily compile one Android project in both languages with the help of
this feature – interoperability function.
This will allow the developer to switch the programming language instead of changing
the codes. It will also save time for them to develop more Android apps.
It can show 100% interoperable. So, if you need access to a Kotlin method from a Java
class or vice versa, you can do it without any extra parameters.

2.2.3 Kotlin Comes With Lazy-Loading Feature

The lazy-loading feature basically increases the startup time, which is very useful when
using it for Android development.

In simple words, it’s the best solution for all developers who want to reduce their
Android app startup time so that their apps’ content can be shown faster.
With the lazy-loading feature, Android developers can load the only resources into main
memory which are necessary. If you are looking for this feature, then Kotlin is the best
choice.

For example, if you have a shopping app, the majority of users will only browse your
selection, that means you could have the payment API be lazy loaded.

11
2.2.4 Data Classes in Kotlin
The necessity of a class is always argued by programming language designers/makers.
Typically, a data class in Java contains lots of boilerplate code which developers have to
skip in order to find out the real use of that class.

But now in Kotlin, Android developers can write the equivalent of the same Java code in
a simple manner, and with lesser code. Therefore, the data classes in Kotlin are also
known to be one of the useful features.
2.2.5 Collection Filtering

We all know that when working with an API, we developers need to deal with collections
quite often. But by using Kotlin’s collection filtering feature, it’s easier to tell what your
resulting list should contain.

2.3 Kotlin vs. Java: Functions and Features


Java: One of the features of Java most appreciated by developers is that it is platform-agnostic
and easily portable after compiling Java program bytecodes. Java code can be executed on any
computer that supports the Java Virtual Machine. In addition, the object-oriented programming
language is considered very secure due to public-key, encryption-based authentication and a
virus- and tamper-proof system. Java is a programming language that focuses on error checking
at compile-time, eliminating error-prone states.
In addition, programs developed in Java receive extensive runtime information. Java is therefore
not only robust but also relatively dynamic. In addition, Java is suitable for Multithreading,
which many developers see as an advantage.
Also, the object file format generated by the Java compiler, which has a neutral architecture, can
thereby run on multiple processors. Because of Java’s neutral architecture and its compiler in
ANSI C, it is also considered a very portable programming language. Another feature of Java
worth mentioning is its high performance, made possible due to just-in-time compilers.

Kotlin: With an average code length around 20% shorter than Java, the efficiency of Kotlin is
highlighted as a particularly valuable advantage. Not only can work be done more efficiently but
the quality of the code is also improved as a result of it being more concise.
Kotlin’s versatility is another big plus. Due to its high degree of interoperability with Java, Java
code can also be executed in Kotlin and vice versa. In addition, Kotlin’s many extensibility

12
features mean that developers can add additional functionality to existing components without
changing the main body of the code. This is advantageous because Kotlin’s library is quite small
and does not use up memory as it consists of targeted extensions to the standard library.
Accordingly, there is no runtime overhead with Kotlin.

2.4 Kotlin vs. Java: Which language is better for Android apps?

Java has long been Google’s preferred programming language for Android app development.
Since 2017, however, Kotlin has also been officially supported by Google and, since 2019, its
preferred programming language for Android app development. To what extent do the

13
programming languages differ specifically in terms of Android app development and when might
you still prefer Java over Kotlin?
Syntax is one of Kotlin’s strongest advantages. As described earlier, Kotlin requires significantly
fewer lines of code compared to what would be required in Java. This makes the code more
readable and simpler, which generally also leads to the code being of better quality because bugs
and errors are easier to find.
Less code usually means it will take less time to develop and maintain the same app in Kotlin
compared to Java. That can reduce costs, which is a major plus for Kotlin in the eyes of project
sponsors. Another advantage is the simplicity of using Kotlin. The Java-specific problem of the
NullPointerException, for example, does not occur in Kotlin. In addition, all frameworks and
libraries written in Java can be accessed in Kotlin.
Last but not least is the fact that Kotlin is now the preferred programming language of Android
Studio, the IDE (Integrated Development Environment) developed by Google. Java and C++ are
also still supported by Android Studio but do not have the status as Kotlin. Since 2019, Google
has been driving Android’s Kotlin-first approach and recommends the open-source programming
language for the development of new Android apps. Interestingly, however, extensible support
from Android Studio tools means Java and Kotlin code can be used in the same project.

Chapter-3. Android Kick Off

3.1 Database
14
A database is an organized collection of structured information, or data, typically stored
electronically in a computer system. A database is usually controlled by a database management
system (DBMS). Together, the data and the DBMS, along with the applications that are
associated with them, are referred to as a database system, often shortened to just database. Data
within the most common types of databases in operation today is typically modeled in rows and
columns in a series of tables to make processing and data querying efficient. The data can then
be easily accessed, managed, modified, updated, controlled, and organized. Most databases use
structured query language (SQL) for writing and querying data. Databases have evolved
dramatically since their inception in the early 1960s. Navigational databases such as the
hierarchical database (which relied on a tree-like model and allowed only a one-to-many
relationship), and the network database (a more flexible model that allowed multiple
relationships), were the original systems used to store and manipulate data. Although simple,
these early systems were inflexible. In the 1980s, relational databases became popular, followed
by object-oriented databases in the 1990s. More recently, NoSQL databases came about as a
response to the growth of the internet and the need for faster speed and processing of
unstructured data. Today, cloud databases and self-driving databases are breaking new ground
when it comes to how data is collected, stored, managed, and utilized.

3.2 Firebase
Firebase evolved from Envolve, a prior startup founded by James Templin and Andrew Lee in
2011. Envolve provided developers an API that enables the integration of online chat
functionality into their websites. After releasing the chat service, Tamplin and Lee found that it
was being used to pass application data that were not chat messages. Developers were using
Envolve to sync application data such as game state in real time across their users. Tamplin and
Lee decided to separate the chat system and the real-time architecture that powered it.[2] They
founded Firebase as a separate company in 2011 and it launched to the public in April 2012.[3]
Firebase's first product was the Firebase Real time Database, an API that synchronizes
application data across iOS, Android, and Web devices, and stores it on Firebase's cloud. The
product assists software developers in building real-time, collaborative applications. In May
2012, a month after the beta launch, Firebase raised $1.1 million in seed funding from venture
capitalistsFlybridge Capital Partners, Greylock Partners, Founder Collective, and New Enterprise
Associates. [4] In June 2013, the company further raised $5.6 million in Series A funding from
Union Square Ventures and Flybridge Capital Partners. [5] In 2014, Firebase launched two
products. Firebase Hosting [6] and Firebase Authentication.[7] This positioned the company as a
mobile backend as a service. [Citation needed] In October 2014, Firebase was acquired by
Google. [8] A year later, in October 2015, Google acquired Divshot, an HTML5 web-hosting
platform, to merge it with the Firebase team.[9] In May 2016, at Google I/O, the company's
annual developer conference, Firebase introduced Firebase Analytics and announced that it was
expanding its services to become a unified backend- as-a-service (BaaS) platform for mobile
developers. Firebase now integrates with various other Google services, including Google Cloud
Platform, AdMob, and Google Ads to offer broader products and scale for developers.
[10]Google Cloud Messaging, the Google service to send push notifications to Android devices,
was superseded by a Firebase product, Firebase Cloud Messaging, which added the functionality
to deliver push notifications to both iOS and web devices. In July 2016, Google announced that it

15
was acquiring the mobile developer platform Launch Kit,[11] which specialized in app developer
marketing, and would be folding it into the Firebase Growth Tools team. In January 2017,
Google acquired Fabric and Crashlytics from Twitter to add those services to Firebase.[12] In
October 2017, Firebase launched Cloud Firestore, a real-time document database as the
successor product to the original Firebase Realtime Database.

3.3 Android Studio


Android Studio is the official [8] integrated development environment (IDE) for Google's
Android operating system, built on Jet Brains' IntelliJ IDEA software and designed specifically
for Android development. It is available for download on Windows, macOS and Linux based
operating systems or as a subscription-based service in 2020. It is a replacement for the Eclipse
Android Development Tools (E-ADT) as the primary IDE for native Android application
development. Android Studio was announced on May 16, 2013, at the Google I/O conference. It
was in early access preview stage starting from version 0.1 in May 2013, then entered beta stage
starting from version 0.8 which was released in June 2014.The first stable build was released in
December 2014, starting from version 1.0. On May 7, 2019, Kotlin replaced Java as Google's
preferred language for Android app development. Java is still supported, as is C++. The
following features are provided in the current stable version:

● Gradle-based build support


● Android-specific refactoring and quick fixes
● Lint tools to catch performance, usability, version compatibility and other problems.
● ProGuard integration and app-signing capabilities.
● Template-based wizards to create common Android designs and components.
● A rich layout editor that allows users to drag-and-drop UI components, option to preview 13
layouts on multiple screen configurations
● Support for building Android Wear apps
● Built-in support for Google Cloud Platform, enabling integration with Firebase Cloud
Messaging (Earlier 'Google Cloud Messaging') and Google App Engine
● Android Virtual Device (Emulator) to run and debug apps in the Android studio. Android
Studio supports all the same programming languages of IntelliJ (and CLion) e.g. Java, C++, and
more with extensions, such as Go; and Android Studio 3.0 or later supports Kotlin and "all Java
7 language features and a subset of Java 8 language features that vary by platform version."
External projects backport some Java 9 features. While IntelliJ states that Android Studio
supports all released Java versions, and Java 12, it's not clear to what level Android Studio
supports Java versions up to Java 12 (the documentation mentions partial Java 8 support). At
least some new language features up to Java 12 are usable in Android. Once an app has been
compiled with Android Studio, it can be published on the Google Play Store. The application has
to be in line with the Google Play Store developer content policy.

3.4 Android Activity Lifecycle


Android Activity Lifecycle is controlled by 7 methods of android.app.Activity class. The
android Activity is the subclass of ContextThemeWrapper class.
An activity is the single screen in android. It is like window or frame of Java.

16
By the help of activity, you can place all your UI components or widgets in a single screen.
The 7 lifecycle method of Activity describes how activity will behave at different states.

3.5 Android Activity Lifecycle methods

Method Description

onCreate called when activity is first created.

onStart called when activity is becoming visible to the user.

onResume called when activity will start interacting with the user.

onPause called when activity is not visible to the user.

onStop called when activity is no longer visible to the user.

onRestart called after your activity is stopped, prior to start.

onDestroy called before the activity is destroyed.

17
18
3.6 Android Intent
Android Intent is the message that is passed between components such as activities, content
providers, broadcast receivers, services etc.
It is generally used with startActivity() method to invoke activity, broadcast receivers etc.
The dictionary meaning of intent is intention or purpose. So, it can be described as the intention
to do action.
The LabeledIntent is the subclass of android.content.Intent class.

Android intents are mainly used to:


 Start the service
 Launch an activity
 Display a web page
 Display a list of contacts
 Broadcast a message
 Dial a phone call etc.

3.7 Types of Android Intents


There are two types of intents in android: implicit and explicit.

1) Implicit Intent
Implicit Intent doesn't specifiy the component. In such case, intent provides information of
available components provided by the system that is to be invoked.

2) Explicit Intent
Explicit Intent specifies the component. In such case, intent provides the external class to be
invoked.

3.8 View
The View class is the base class or we can say that it is the superclass for all the GUI
components in android. For example, the EditText class is used to accept the input from users
in android apps, which is a subclass of View, and another example of the TextView  class
which is used to display text labels in Android apps is also a subclass of View.  
Or the other definition,
View refer to the android.view.View class, which is the base class of all UI classes.
android.view.View class is the root of the UI class hierarchy. So from an object point of view,
all UI objects are View objects. Following are some of the common View subclasses that will
be used in android applications.

19
 TextView
 EditText
 ImageView
 RadioButton
 Button
 ImageButton
 CheckBox
 DatePicker
 Spinner
 ProgressBar and etc.

3.9 ViewGroup
The ViewGroup class is a subclass of the View class. And also it will act as a base class for
layouts and layouts parameters.  The ViewGroup will provide an invisible container to hold
other Views or ViewGroups and to define the layout properties. For example, Linear Layout is
the ViewGroup that contains UI controls like Button, TextView, etc., and other layouts
also. ViewGroup Refer to the android.view.ViewGroup class, which is the base class of
some special UI classes that can contain other View objects as children. Since ViewGroup
objects are also View objects, multiple ViewGroup objects and View objects can be organized
into an object tree to build a complex UI structure. Following are the commonly used
ViewGroup subclasses used in android applications.

 FrameLayout
 WebView
 ListView
 GridView
 LinearLayout
 RelativeLayout
 TableLayout and many more.
The ViewGroup subclasses listed above group View instances together and takes care of their
layout. For instance, the LinearLayout will render the components after each other either
horizontally or vertically.

20
Chapter-4 Higher Order Functionalities

4.1 Types of Android Layout

 Android Linear Layout:  LinearLayout is a ViewGroup subclass, used to provide


child View elements one by one either in a particular direction either horizontally or
vertically based on the orientation property.

 Android Relative Layout:  RelativeLayout is a ViewGroup subclass, used to specify


the position of child View elements relative to each other like (A to the right of B) or
relative to the parent (fix to the top of the parent).

 Android Constraint Layout:  ConstraintLayout is a ViewGroup subclass, used to


specify the position of layout constraints for every child View relative to other views
present. A ConstraintLayout is similar to a RelativeLayout, but having more power.

 Android Frame Layout:  FrameLayout is a ViewGroup subclass, used to specify the


position of View elements it contains on the top of each other to display only a single View
inside the FrameLayout.

 Android Table Layout: TableLayout is a ViewGroup subclass, used to display the


child View elements in rows and columns.

 Android Web View: WebView is a browser that is used to display the web pages in
our activity layout.

 Android List View:  ListView is a ViewGroup, used to display scrollable lists of items
in a single column.

 Android Grid View: GridView is a ViewGroup that is used to display a scrollable list


of items in a grid view of rows and columns.

4.2 UI/UX Design


The abbreviation UI stands for the user interface. It is the way through which users interact with
the mobile application. The user interface includes all the controls, buttons, blocks, and elements
of the app. The primary objective of the user interface is to provide easy, enjoyable, and effective
interaction between the user and the app. The process of developing UI includes selecting a
color, corporate identity, and the latest design principles. The abbreviation UX stands for user
experience. The idea of UX is to provide the best experience for the user with ease of usage and

21
the feel on how the user gets an impact on establishing your business value. Creating a UX
includes defining the way a product operates and meets the requirements of the users. UX must
be clear, comfortable, and user-friendly and should work in the direction to turn your users into
loyal customers.

4.3 Key components of UI/UX design


There are core components of UI/UX design, which are as follows:

4.3.1 InformationArchitecture
Information Architecture, also known as the IA, is all about satisfying the business strategies by
designing the application’s or the site’s information structure. The major role of the IA is to
provide its users with easy navigation no matter which browser they are using. It’s about using
the maximum permutations and combinations to provide the best and a top-level navigation
menu.

4.3.2 InteractionDesign
Interaction Design is about creating the conceptual design with which the users interact with the
product and/or application. This interaction includes various elements such as aesthetics, color,
font, icons, images, motion, sound, space, graphics, etc.

4.3.3 Usability
Usability can be referred to as the user-friendliness as well. Along with figuring out if the users
get the information they want by using the application or visiting the site for the first time and if
the application/website is easy to navigate, the usability also comprehends the ways to handle the
errors.

4.3.4 Wireframing
Wireframing is about creating a sample of the application to test the features, look and usability
of the application before it is actually launched. It is a cheap way to test functionality and
evaluate if the application serves the purpose.

4.3.5 VisualDesign
Visual design of the application or the website is like defining the company’s brand. Finalizing
the visual design can affect the users’ behavior and hence it is the most important component of
the UI design. Visual Design is not only about selecting the best images, colors, icons, fonts, but
also identifying the appearance of the application impacts the interaction of its users.

22
4.4 Importance of UI/UX in Mobile App
4.4.1 Captivates Users
4.4.2 enhanced customers complacency & improved ROI
4.4.3 Conserves time and cost
4.4.4 UI/UX design boost your brand
4.4.5 It enhances customer satisfaction hence improved ROI
A great design provides your customers with engaging content and easy navigation. This makes
the customer satisfied with the services of your application. Satisfied clients will always
recommend your app to others. This leads to an increase in customers. Besides, they will also
become loyal to your brand and become returning buyers hence increasing the ROI for your
business.

4.4.6 Helps you understand your audience


Before creating an Ul/UX, you have to understand the needs of your clients. This, therefore,
means your design is created with the focus being on your target audience. Your app will attract
the audience you build it for. Also, Ul/UX allows you to segment your audience which is crucial
in understanding what each audience wants. Understanding your audience makes it easy to
convert the prospective customers into your loyal customers hence increasing actual sales

4.4.7 Investing in an efficient Ul/UX design


Investing in an efficient Ul/UX design helps in increasing customer satisfaction hence ending up
with happy clients. People like working with brands that make them happy. They will be more
willing to point out features that you can upgrade, and as a result, you invest in improving your
application. This increases the credibility of your business as a client creates good relationships
with your company and brand. The result of this is the growth in the value of your business and
your brand name.

4.4.8 Saves time and money


If you invest in a great Ul/UX design, there is a minimal chance that your clients will find any
problem with your application. A perfect product will not need frequent upgrades and therefore
saves you money and time you would have spent on developing an update. Upgrading requires
some investments in terms of money and time this will incur losses for your business.

23
4.5 Coordinator Layout
CoordinatorLayout is a super-powered FrameLayout.

CoordinatorLayout is intended for two primary use cases:

1. As a top-level application decor or chrome layout


2. As a container for a specific interaction with one or more child views

By specifying Behaviors for child views of a CoordinatorLayout you can provide many different


interactions within a single parent and those views can also interact with one another. View
classes can specify a default behavior when used as a child of a CoordinatorLayout by
implementing the AttachedBehavior interface.
Behaviors may be used to implement a variety of interactions and additional layout
modifications ranging from sliding drawers and panels to swipe-dismissable elements and
buttons that stick to other elements as they move and animate.
Children of a CoordinatorLayout may have an anchor. This view id must correspond to an
arbitrary descendant of the CoordinatorLayout, but it may not be the anchored child itself or a
descendant of the anchored child. This can be used to place floating views relative to other
arbitrary content panes.

4.6 Android Fragments

Android Fragment is the part of activity, it is also known as sub-activity. There can be more
than one fragment in an activity. Fragments represent multiple screen inside one activity.

Android fragment lifecycle is affected by activity lifecycle because fragments are included in
activity.

Each fragment has its own life cycle methods that is affected by activity life cycle because
fragments are embedded in activity.

The FragmentManager class is responsible to make interaction between fragment objects.

Android Fragment Lifecycle

The lifecycle of android fragment is like the activity lifecycle. There are 12 lifecycle methods for
fragment.

24
4.7 Android Fragment Lifecycle Methods

No Method Description
.

1) onAttach(Activity) It is called only once when it is attached with


activity.

2) onCreate(Bundle) It is used to initialize the fragment.

3) onCreateView(LayoutInflater, creates and returns view hierarchy.


ViewGroup, Bundle)

4) onActivityCreated(Bundle) It is invoked after the completion of onCreate()

25
method.

5) onViewStateRestored(Bundle) It provides information to the fragment that all the


saved state of fragment view hierarchy has been
restored.

6) onStart() Makes the fragment visible.

7) onResume() Makes the fragment interactive.

8) onPause() Is called when fragment is no longer interactive.

9) onStop() Is called when fragment is no longer visible.

10) onDestroyView() Allows the fragment to clean up resources.

11) onDestroy() allows the fragment to do final clean up of


fragment state.

12) onDetach() It is called immediately prior to the fragment no


longer being associated with its activity.

26
Chapter-5. The Final Project

• Food Management Module: Used for managing the Food details.

• Order Module: Used for managing the details of Order

• Delivery Address Module: Used for managing the details of Delivery Address

• Item Category Management Module: Used for managing the information and details of
the Item Category.

• Shopping Cart Module: Used for managing the Shopping Cart details

• Customer Module: Used for managing the Customer information

• Login Module: Used for managing the login details

• Users Module: Used for managing the users of the system

5.1 Background Management Platform

Figure 4.1 is a use case diagram to illustrate the main functions in the background
for the administrator. The detailed description of functions is as follows:

27
Figure 5.1
5.1.1 Splash Screen

Splash Screen is the first screen that we see when we run our application. It is also known
as Launch Screen. 

28
Figure 5.2

5.1.2 Log In/Out

Properties: “Username” Password When the administrator connects the


background management platform URL, a log in interface will be displayed. The
administrator needs to input correct username and password to log into the main

29
page of the background management page. One admin username and password is
pre-set when the application is initialized.

Figure 5.3
5.1.3 Add User
Info Properties: Login Account
 Login Password
 Repeat Password

30
 User Name
 Id Number
 Address
 Phone
 Email
In the User Management module, the administrator can view the information of existing users in the
company by clicking “User Manage”. The functions of “Add “and Modify “user “are also provided in the
project. The employee accounts added can be used to log in this background management platform. In
addition, according to the real request, when an employee leaves the company, the administrator can
mark leave for this user using “Mark Leave” function, it means that the user account will be invalid to log
in the background management platform.

Figure 5.4

5.1.4 Add Food Info

31
 Properties: Product Name
 Product Category
 Market Price
 Sell Price
 Product Code
 Product Style Image
 Product Description
When the administrator wants to add dishes, “Product Manage” just needs to be clicked; the right
frame page will jump to a list view page of dishes. On the page, the detailed information of
existing dishes will be shown, such as Product Code, Product Name, Category Belong, Sell
Price, the state of sale, etc.

Figure 5.5

5.1.5 Modify Food Info

32
Properties:
 Item Name
 Item Category
 Item Price
 Item Image
 Item Description
 Stars
 Item image URL
The administrator can modify food information by going Google Firebase.

Figure 5.6

5.1.6 User Information

33
Properties:
 Gender
 Registration date
 Mobile number
 Registration Id
 Student Id
 Student Name
The administrator can modify food information by going Google Firebase.

Figure 5.7

5.1.7 Navigation Drawer

34
In the navigation drawer user can navigate to one activity to another activity or one fragment to
another fragment. In this application navigation drawer contain some activity which are listed
below:
 Food menu
 Profile
 My order
 Order history
 Share app
 Contact us
 Log-out

Figure 5.8

5.1.8 User Profile

35
In the user profile activity user can see his/her information like:
 Name
 Gmail
 Registration Id
 User Id
 Mobile Number
 Registration Date

Figure 5.9

5.1.9 User Orders

36
In this activity user can his current and previous order.

Figure 5.10

5.1.10 Contact Us

37
In this activity user can directly communicate with developer through
 Gmail
 Call
 Message
In this section, we have provided the contact number and proper email address, so that the
customers can anytime write to us with any queries or complaints. Also their valuable feedbacks
are always heartily welcome.

Figure 5.11

5.1.11 Log out

In the log out fragment user can log out his/her account from the application. The login

38
information is already store in Real time database. So, when the user want to Login the account
so easily Login his/her account by giving the correct credentials.

Figure 5.12
5.1.12 Order place

39
The customers places order, which is not only till here, there are some work that need to be done
in the database in order to maintain records for keeping track on monthly basis.

Order_id: This is the identity number given to determine and manage the sequence of servicing.
Since multiple customer will place orders, so as to schedule whom to give the delivery first is
determined by the help of this number, so as to maintain consistency in the system working
procedure. It will be unique for each order a day. But the same id can be repeated on a new day,
as it is mainly for the restaurant’s reference and to prevent any type of overlapping of thoughts
between customers and owners. It is mainly for the chef’s reference.

User_id: This is the identity number assigned by the admin to the users so as to identify them
uniquely in future. This identity number is helpful in fetching data of individual user from a big
set. This is mainly to manage the huge database system where the entire data is being stored. It is
a permanent identity number given by the admin to the customer to maintain customer history.

Total price: This attribute manages the total price sum of the orders user has made in one
attempt. It is one of the most important attribute, since most of the times people change their
menu order list contents depending upon their needs, health and economic situation.

Timing: Time is something most important to be valued. And one of the major reason behind the
success of this food ordering system. So managing this cause becomes a goal to be completed. In
order to maintain the business work better, the authority must stick to its commitment.

40
Figure 5.13

41
5.1.13 Developer info
Developer information is provides for the user to contact to the developer. We have provided the
contact number and proper email address, so that the customers can anytime write to us with any
queries or complaints. Also their valuable feedbacks are always heartily welcome.

Figure 5.14

42
5.1.14 Order Conformation

Finally, User is on order confirmation screen here, user can see his/her
payment status, delivery date, order take away time and total amount to
pay. On this screen user can also cancel his/her order also. And also
share his/her order details for his friend or family.

Figure 5.15

43
5.2 REFERENCES

• www.internshala.com
• https://kotlinlang.org/
• https://mui.com/
• https://developer.android.com/guide/index.html
• https://developer.android.com/reference/packages.html

44

You might also like