You are on page 1of 47

A Project report on

My Murlipura : E-Commerce Web App


Submitted in partial fulfillment of the requirements for the degree of

Bachelor Of Computer Application


Submitted By
Mohit Mishra
(Roll No. )
(Enrollment No. 18/8063)

Under the supervision of

Ms. Shivani Pareek


(Assistant Professor in BCA Department)

Department of Bachelor Of Computer Application


Sri Balaji P.G Mahavidhyalaya
Jaipur
(2018-2021)
CERTIFICATE

It is certified that this project report titled “My Murlipura : E-Commerce Web
App” by Mohit Mishra in the partial fulfillment of requirement for the award of
Bachelor of Computer Application submitted to University Of Rajasthan, Jaipur is
student’s own work carried out under my supervision and guidance. This project
report has not been submitted to any other University or Institution for award of
degree. The work contained in this project report is as per University standards.

I wish him/her good success in life.

Guide Name : Ms. Shivani Pareek External Examiner:


Signature : Signature :
Designation : Assistant Professor Date:
Department of Bachelor of Computer Application.
Sri Balaji P.G Mahavidyalaya, Jaipur

Mr. Shantanu
Head of Department
Sri Balaji P.G Mahavidyalaya, Jaipur
CANDIDATE’S DECLARATION

I Mohit Mishra, bearing roll number a student of Bachelor of Computer


Application hereby declared that I own the full responsibility for the information,
result etc. provided in this project report titled “My Murlipura : E-Commerce Web
App” submitted to University of Rajasthan, Jaipur for award of Bachelor of
Computer Application degree. I have taken care all respect to honor the
intellectual property right and have acknowledged the contributions of other for using
them in this academic purpose. I further declared that in case of any violation of
intellectual property right or copyright I as the candidate would be fully responsible
for the same. My supervisor and institute should not be held for full or partial
violation of copyright if found at any stage of my degree.

Mohit Mishra
Bachelor of Computer Application
Roll No.
Enrollment No.: 18/8063
ABSTRACT

MY MURLIPURA is a portal which allows merchants in developing counters to


advertise and sell their goods. This would permit rural communities to make their
wares available to the rest of the world.
The objective of this project is to create a portal which would allow product
information to be updated securely using a mobile device and will allow users to buy
goods form the merchant. This application is for certain vendors who wants to get
more customers for their product over the internet
In future the internet become whole and soul to the business fields, each and every
trades are going to be done through it so this portal may helpful to the vendors of
different products to enlarge their scope of product selling.

Submitted By :- Submitted To:-


Mohit Mishra Ms. Shivani Pareek
Bachelor of Computer Application Assistant Professor BCA Dept.
Roll No.
Enrollment No.: 18/8063
ACKNOWLEDGEMENT

I would like to express my devotional thanks to Prof. (Dr.) K.C. Sharma,


Principal Sri Balaji P.G Mahavidyalaya, Jaipur for his valuable guidance and
concern. His guidance contributes greatly to this dissertation. His sharp
insights of subjects, invaluable guidance, help, encouragement and
criticism will be of great benefit to my professional carrier and personnel life. I
have gained valuable knowledge from him, the bright ideas he shared with me will
help me in my whole life. His valuable discussions based on his sharp skills
& experiences are outstanding for me.
A very sincere thanks to Mr. Shantanu, Head of Department, Bachelor of
Computer Application, for his great mentoring and support that helped me to
complete my Project work and studies at the institute. I would also like to
acknowledge the influence and help of the rest of the department for their
discussion, support and help for my studies.
I want to express my deep gratitude to my dear parents, brother and sister and
friends for their unconditional love and unfailing support for the many years.
Without their love and support, I will not be able to get through the difficulties
encountered and finish what I want to do.

Mohit Mishra
Bachelor of Computer Application
Roll No.
Enrollment No.: 18/8063
Sl. No. Table of Contents Pg. No.

Certificate 2
Candidate’s Declaration 3
Abstract 4
Acknowledgement 5

1. Introduction 7
2. System Study 8
3. Software Requirements Specification 10
3.1 Introduction 10
3.1.1 Purpose 10
3.1.2 Document Conventions 10
3.1.2 Reading Suggestions 10
3.1.2 Product Scope 12
3.2 Overall description 13
3.2.1 Product Perspective 13
3.2.2 Product Functions 13
3.2.3 User Classes and Characteristics 13
3.2.4 Operating Environment 13
3.2.5 Design and Implementation Constraints 13
3.2.6 User Documentation 14
3.2.7 Assumptions and Dependencies 14
3.3 External Interface Requirements 14
3.3.1 User Interfaces 14
3.3.2 Hardware Interfaces 14
3.3.3 Software Interfaces 14
3.3.4 Communications Interfaces 15
3.4 System Features 15
3.4.1 Authentication 15
3.4.2 Push Notification 16
3.4.3 Analytics 16
3.5 Other non functional requirements 17
3.5.1 Performance Requirements 17
3.5.2 Safety Requirements 17
3.5.3 Security Requirements 17
3.5.4 Software Quality Attributes 17

4. Software Description 19
5. Project Design 21
6. Source Code 23
7. Screenshots 39
8. References 47
I - INTRODUCTION

The growth of smartphone usage has changed the retail landscape and consumer
behavior drastically. A large share of online purchases are now taking place on
mobile, especially in apps. In 2018, global time spent in app nearly doubled, up 45%
from 2016, including a 70% increase in the US. And this trend is only increasing from
here: By 2021, mobile transactions are projected to double on a worldwide scale,
accounting for 75% of total ecommerce sales.

My Murlipura, is an android web-app with works towards its website to enlarge their
audience to Android devices also.

My Murlipura is dedicated services based vast Internet-based app or website that


offers Dairy, Grocery, Housewares and many other goods, either directly or as the
middleman between other retailers

It ensure all its customers concerns raised are addressed timely. Its dedicated team of
customer care specialists work round the clock to resolve all issues satisfactorily.

As an initiative, Currently its target is only Murlipura’s people, Due to small distance
and same regions. It provides free and fast delivery, withing two hours.

It has an user-friendly interface, which makes it easy-to-use for each and every user.
II - SYSTEM STUDY

My Murlipura contain following features:


1. Authentication
2. Push Notification
3. Analytics

1. Authentication

1.1 Description and Priority


This feature will give the user a secure and simple login screen. The login is enabled
to give all its users their individual spaces on the platform. The main objective of
authentication here, is to manage the details of Email, Permission and Authorization,
Changing Profile Photo, Changing Name, Changing Email & Password etc.

1.2 Stimulus/Response Sequences


It will consist of two basic fields, Email and Password. There is a button Login Now
for submitting the entered email and password. On successful entry the user will be
provided with the home page to continue to their further uses and on unsuccessful
login the user is displayed a toast with error message.

1.3 Functional Requirements


The requirement is only possible for the users who are registered already. If the user is
not already registered in our database, then he first need to register through the sign up
button.
User can also change their Password if forgot, by entering registered email in the
forgot password section.

1.4 Validation
Validating any application is an important criterion before releasing the application to
the users. If there is no validation, the information entered by users may be redundant,
formatted inappropriately and cannot be maintained.
In the Login and Sign Up Page, I have validated all the login information that is
required for the user to sign up for the first time. Fields like name, email, password,
profile photo are validated appropriately by displaying error messages.
2. Push Notification

2.1 Description and Priority


This feature will give the user real time update notification. There is two channel
provided for notifications-
1. Notification
2. Offers
2.1.1 Notification
First Channel Notification Contains those kind of notifications which are sent to every
user, something like Notification regarding application updates etc.

2.1.2 Offers
Offers Contains those kind of notifications which are not sent to every user, It is only
sent to those users who wants to receive updates about offers from My Murlipura.
Offers notifications can be turned on or off through settings page.

3. Analytics

3.1 Description and Priority


Analytics shows Active Users, Daily Users Engagement, how stable the app is and
many more information regarding the application.

3.2 Stimulus/Response Sequences


Application is connected to the Firebase, so the application connect to the Firebase for
Application Analytics service.

3.3 Functional Requirements


This application requires an android smartphone with authenticated User.
III - SOFTWARE REQUIREMENTS SPECIFICATION

1. INTRODUCTION

1.1 Purpose
The purpose of this document is to present a detailed description of the android
application My Murlipura.apk. It will explain the importance and features of the
application, the interfaces of the application, what the application will do, the
constraints under which it must operate.

1.2 Document Conventions


Main Section Titles
 Font: Times New Roman
 Face: Bold
 Size: 14
Sub Section Titles
 Font: Times New Roman
 Face: Bold
 Size: 13
Other Text Explanations
 Font: Times New Roman
 Face: Normal
 Size: 13
Souce Code
 Font: Times New Roman
 Face: Normal
 Size: 12

1.3 Reading Suggestions


This document is intended for students, developers, project manager, users, testers,
documentation writers etc.
This document is organized as follows:

Section 1: Introduction
My Murlipura works to enlarge the audience of certain vendors through E –
Commerce and let the customers get their required product without walking out.
The main idea behind this project is, as per COVID-19 effects, people are not able
to walk out to purchase their required products due to lockdown and also for their
safety purposes, so without letting the customers suffer about this My Murlipura
works to deliver products to the doorsteps of them. The idea also ensures the safety
of the users and provides clean and safe service in the era of this pandemic. The
application provides a very user friendly interface which provides user a very clean
and premium experience. The application is basically for house hold items which
consist of Groceries, Dairy, Housewares and many other goods. The application
targets the audience of Murlipura region and provides fast delivery. Our goal is to
provide good experience and fast services to our users.

Section 2: Overall Description


It is an website based android application.
Primary Features of its Android application is-
 Registration process.
 Support multiple payment options.
 Push notifications.
 Custom branding.
 Great user experience.
 Firebase Analytics.
 Rating and feedback.
Minimum Android version required to run its application is Android 5.0. The
device must have a network connection to let the app connect with databases and
website.

Section 3: User Interface


The application provides a simple user interface which enhances experience of
the user. The UI is designed as that the user will not find any problems in finding
anything. The application can be downloaded easily from Google Play Store. In the
application , user have to sign in before entering the home page and verify their
Email which helps our admin panel to give better experience to the user. After
entering the application, user can do as they please. The first option is a Shop Now
option where user get directly linked to the E-Commerce website through a portal
and can start their purchasing needs.
Section 4: System Features
 Registration process
The registration feature of the application is Very smooth and easy to understand
for every user.
 Support multiple payment options
With collaboration of Razorpay, My Murlipura supports multiple payment
option like Credit Card, Debit Card, Paytm, PhonePe, GPay, Net-Banking and UPI
also.

 Push notifications
This feature will give the user real time update notification. There is two channel
provided for notifications first one is “notification” standing for all general
notifications and the other one is “offers” standing for notifications which comes
under offers category.
 Custom branding
It has its custom branding logo and other specific brand colors(Dark Blue and
Light Pink) that represent its brand itself.
 Great user experience
The application gives a great user experience with its Easy-To-Understand UI
and smooth processing
 Firebase Analytics
With Firebase, We can know how the app is working in the field. “How Stable
the version is?”, “Daily Active Users” etc.
 Rating and feedback
Users can rate the application through Rate Button and also give their feedback,
suggestions and ask their queries withing the app.
 Synchronization
This is an Web-Based Application For My Murlipura. The website and android
application both are completely synchronized with the databases.

Section 5: Functional Requirements


Users need to sign up at the very first time they interact with the application. The
user must be logged in to Shop Products, Registering Sellers.
To Register as seller user email must be verified.
Android 5.0 or newer is required to run the application.

1.4 Product Scope


This android application will be a substitute for the official website of My
Murlipura. This application will be designed to maximize the ease of use of official
website of My murlipura in mobile view.
Specifically, this application is mainly used to online shopping in Murlipura. The
main function of this application is that it delivers the product within 2 hours of
ordering. As we have seen in past that people were stuck in their houses because of
lockdown and not to buy groceries or any goods because of covid risk. By using
this application, they can order any product and we will deliver that within 2 hours.
2. OVERALL DESCRIPTION

1. Product Perspective
The My Murlipura.apk application is a new Android based web-application. It is
implemented with Android Studio. The primary technologies used in development
of this project is Kotlin Language for working, XML for designing and Firebase for
authentication, database and analytics.

2. Product Functions
My Murlipura application is easy to use, user friendly, safe and secure, Android
based mobile application. The main features of this application are that it is a local
area shopping as well as for selling application with free product delivery within
the specified locality. User can register as seller within the app with one click.

3. User Classes and Characteristics


Our application is easy to use even I children can use it. Most of the people in this
time have smart phones. About 72% of those smart phones works with Android
operating system, and more than 94% of those Android phones are fit to run My
Murlipura.
This application will be helpful to people who can’t go outside because of any
reason and want to buy anything they can simply use this application and order
anything from the shops they want to. They can simply purchase any product from
their favorite shop.

4. Operating Environment
The application will only be available for the Android operating systems. The
application shall only be used with compatible android devices The user shall use
this application on Android OS 5.0(API 21) or any later versions of the Android
OS.

5. Design and Implementation Constraints


Implementation language restrictions
The programming language is Kotlin for the main application.
Firebase is used for cloud targets database and User Authentication.
Resource limits
The users‟ device shall have a working data plan or wifi connection.
The users‟ device shall have sufficient memory storage to install the application.
The users‟ device shall have sufficient battery life to run the application.

6. User Documentation
Slider Intro
At the starting of the application, the user will experience a slider intro of the
application which helps user to know about the main features and objectives of the
application. The developer ensures that the slider intro will only start at very first
time when user opens the application. In case of misunderstanding, the user can use
the “App Tours” option in the “Settings” to experience the slide intro again.

Online Help
Theire team provided there contact information in the “About” section of the
application in case of any help needed. The user can easily contact the admin
regarding any issue they encounter.

7. Assumptions and Dependencies


Dependencies
The application shall be used with the assumption that the Android device has
stable network connection.

3. EXTERNAL INTERFACE REQUIREMENTS

3.1 User Interfaces


The interface will meet the following requirements to
confirm to the users‟ needs:
It will be simple and easy to understand. Controls which
allow the user to interact with the application will be
clear and imply their functionality within the
application.
The interface will include seven buttons, Presented in
the screenshot, to perform different functions as they are
labebled.

3.2 Hardware Interfaces


The application is intended to be a stand-alone, single-user system. The
application will run on an Android mobile device or an Android emulator. No
further hardware devices or interfaces will be required.
3.3 Software Interfaces
The software will run on the Android operating system, specifically version 5.0
(Lollipop) and above.

3.4 Communications Interfaces


The application shall communicate with the databases and software services via
API function calls. Because the application is written in Kotlin, Kotlin functions
will make these calls to the APIs.
.

4. SYSTEM FEATURES

My Murlipura contain following features:


4. Authentication
5. Push Notification
6. Analytics

1. Authentication

1.1 Description and Priority


This feature will give the user a secure and simple login screen. The login is
enabled to give all its users their individual spaces on the platform. The main
objective of authentication here, is to manage the details of Email, Permission
and Authorization, Changing Profile Photo, Changing Name, Changing Email
& Password etc.

1.2 Stimulus/Response Sequences


It will consist of two basic fields, Email and Password. There is a button
Login Now for submitting the entered email and password. On successful entry
the user will be provided with the home page to continue to their further uses
and on unsuccessful login the user is displayed a toast with error message.

1.3 Functional Requirements


The requirement is only possible for the users who are registered already. If
the user is not already registered in our database, then he first need to register
through the sign up button.
User can also change their Password if forgot, by entering registered email in the
forgot password section.
1.4 Validation
Validating any application is an important criterion before releasing the
application to the users. If there is no validation, the information entered by users
may be redundant, formatted inappropriately and cannot be maintained.
In the Login and Sign Up Page, I have validated all the login information that
is required for the user to sign up for the first time. Fields like name, email,
password, profile photo are validated appropriately by displaying error messages.

2. Push Notification

2.2 Description and Priority


This feature will give the user real time update notification. There is two channel
provided for notifications-
1. Notification
3. Offers
2.2.1 Notification
First Channel Notification Contains those kind of notifications which are sent to every
user, something like Notification regarding application updates etc.

2.2.2 Offers
Offers Contains those kind of notifications which are not sent to every user, It is only
sent to those users who wants to receive updates about offers from My Murlipura.
Offers notifications can be turned on or off through settings page.

3. Analytics

3.1 Description and Priority


Analytics shows Active Users, Daily Users Engagement, how stable the app is and
many more information regarding the application.

3.2 Stimulus/Response Sequences


Application is connected to the Firebase, so the application connect to the Firebase
for Application Analytics service.

3.3 Functional Requirements


This application requires an android smartphone with authenticated User.
5. OTHER NONFUNCTIONAL REQUIREMENTS

5.1 Performance Requirements


5.1.1 System Resource Consumption
Resource consumption of this application should not reach an amount that renders the
mobile device unusable. The application should be capable of operating in the background
should the user wish to utilize other applications.

5.2 Safety Requirements


● User needs to sign in with their account before using.

5.3 Security Requirements


The security system features from having a login for all the users to access the
application‟s full features. The login details will be used in the system also. So the chances
of the application getting intruded are very less.
1. Login Requirements
2. Password requirements.
5.4 Software Quality Attributes
5.4.1 Reliability
The application will meet all of the functional requirements without any unexpected
behavior.

5.4.2 Availability

The application will be available at all times on the user‟s Android device, as long as the
device is in proper working order. The functionality of the application will depend on any
external services such as internet access that are required. If those services are unavailable,
the user should be alerted.

5.4.3 Security

The software never disclose any personal information of any users, and should
collect no personal information from its own users.

5.4.4 Maintainability

The application can be maintained easily .


5.4.5 Portability

This software will be designed to run on any Android operating system version 5.0 or
higher. The software will be forward compatible for all currently released Android
operating system versions (up to 12).
IV - SOFTWARE DESCRIPTION

4.1 PACKAGE – ANDROID STUDIO ARCTIC FOX


Android Studio is the official integrated development environment (IDE)
for Google's Android operating system, built on JetBrains' 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.Visual
Studio supports different programming languages by means of language services,
which allow the code editor and debugger to support (to varying degrees) nearly
any programming language, provided a language-specific service exists.

4.2 DEVELOPMENT TOOLS AND TECHNOLOGIES


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.

Firebase:
Firebase is a platform developed by Google for creating mobile and web
applications. It was originally an independent company founded in 2011. In 2014,
Google acquired the platform and it is now their flagship offering for app
development

4.3 PROGRAMMING LANGUAGES AND LIBRARIES


Kotlin:
Kotlin is a cross-platform, statically typed, general-purpose programming
language with type inference. Kotlin is designed to interoperate fully with Java,
and the JVM version of Kotlin's standard library depends on the Java Class
Library, but type inference allows its syntax to be more concise.

XML:
Android provides a straight forward XML vocabulary that corresponds to the
View classes and subclasses, such as those for widgets and layouts. You can also
use Android Studio's Layout Editor to build your XML layout using a drag-and-
drop interface. Instantiate layout elements at runtime.

Jetpack Libraries:
Jetpack is a suite of libraries to help developers follow best practices, reduce
boilerplate code, and write code that works consistently across Android versions
and devices so that developers can focus on the code they care about.
SPLASH SCREEN
SLIDER INTRO
HOME PAGE
LOGIN

SLIDER INTRO LOGIN


next() Username
skip() Password
Login()
gotIt()
Forgot Password()
Sign Up()

Image, Title RESET PASSWORD SIGN UP


and Email Profile Photo
Description Reset Password() First Name
Interchange Last Name
Email
Password
Gender
PASSWORD RESET EMAIL SENT Sign Up()
GMAIL Email Sent Successfully
INTENT Open Gmail()
Login()

EDIT PROFILE
HOME PAGE
Edit Profile()
Shop Now()
Register As Seller()
Settings()
Connect With Us On()
Profile Photo
First Name 2 About()
1 SOCIAL 3 4 5
Last Name SignOut()
Email MEDIA
Exit()
Password HANDLES
Gender
Save Changes() REGISTER AS SELLER REGISTER AS SELLER
Delete Profile() Name OFFLINE or ONLINE
Val
SETTINGS Phone ABOUT US
Number Dairy Products
idat Fruits And Vegetables
Edit Profile() Email
ion Grocery
Address
Enable News() PinCode Electronics
EXIT
App Tour() Step Ahead Medicines
INTENT
Query()
Fresh Start() Others
Register
Hide Register As Seller Btn()
Share App()
Rate Us()

2 1 3 4 5

CLEAR
SUBSCRIBE APPLICATION HIDE SHARE PLAY
TO DATA REGISTER INTENT STORE
OFFERS INTENT AS INTENT
SELLER

WEBSITE
INTENT
VI – SOURCE CODE

1. LoginFragment.kt

package com.mymurlipura

import android.content.Intent
import android.os.Bundle
import android.text.SpannableString
import android.text.Spanned
import android.text.method.LinkMovementMethod
import android.text.style.ClickableSpan
import android.util.Patterns
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.ProgressBar
import android.widget.TextView
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import androidx.navigation.Navigation
import com.google.android.gms.tasks.OnFailureListener
import com.google.android.material.textfield.TextInputEditText
import com.google.firebase.auth.FirebaseAuth

class LoginFragment : Fragment() {


private lateinit var SignUpRef: TextView
private lateinit var loginBtn: Button
private lateinit var etEmail: TextInputEditText
private lateinit var etPassword: TextInputEditText
private lateinit var email: String
private lateinit var password: String
private lateinit var progressbar: ProgressBar
private lateinit var mAuth: FirebaseAuth
private lateinit var forgotPwd: Button

override fun onCreateView(


inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
(requireActivity() as AppCompatActivity).supportActionBar?.hide()
val loginView = inflater.inflate(R.layout.fragment_login, container, false)
SignUpRef = loginView.findViewById(R.id.sign_up_btn)

loginBtn = loginView.findViewById(R.id.loginBtn)
etEmail = loginView.findViewById(R.id.login_email)
etPassword = loginView.findViewById(R.id.login_password)
progressbar = loginView.findViewById(R.id.progressBar)
forgotPwd = loginView.findViewById(R.id.forgot_pwdBtn)
mAuth = FirebaseAuth.getInstance()

loginBtn.setOnClickListener(View.OnClickListener {
email = etEmail.text.toString().trim()
password = etPassword.text.toString().trim()
if (confirmFilled()){
loginUser(email, password)
}
})

forgotPwd.setOnClickListener(View.OnClickListener {
view?.let {
Navigation.findNavController(
it
).navigate(R.id.action_loginFragment_to_forgotPassword)
}
(requireActivity() as
AppCompatActivity).supportActionBar!!.setDisplayHomeAsUpEnabled(
false
)
})

val text = "Not Registered?, Sign Up Now"


val spannableString = SpannableString(text)
val clickableSpan1: ClickableSpan = object : ClickableSpan() {
override fun onClick(widget: View) {
view?.let {
Navigation.findNavController(
it
).navigate(R.id.action_loginFragment_to_signup_Fragment)
}
(requireActivity() as
AppCompatActivity).supportActionBar!!.setDisplayHomeAsUpEnabled(
false
)
}
}
spannableString.setSpan(clickableSpan1, 17, 28,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
SignUpRef.text = spannableString
SignUpRef.movementMethod = LinkMovementMethod.getInstance()

return loginView
}

override fun onStart() {


super.onStart()
mAuth.currentUser?.let {
val intent = Intent(requireActivity(), MainActivity::class.java).apply {
flags = Intent.FLAG_ACTIVITY_NEW_TASK or
Intent.FLAG_ACTIVITY_CLEAR_TASK
}
startActivity(intent)
//login()
}
}

private fun loginUser(email: String, password: String) {


progressbar.visibility = View.VISIBLE
loginBtn.visibility = View.GONE
mAuth.signInWithEmailAndPassword(email, password)
.addOnCompleteListener(requireActivity()) { task ->
if (task.isSuccessful) {
val intent = Intent(requireActivity(), MainActivity::class.java).apply {
flags = Intent.FLAG_ACTIVITY_NEW_TASK or
Intent.FLAG_ACTIVITY_CLEAR_TASK
}
startActivity(intent)
progressbar.visibility = View.GONE
//login()
}
}.addOnFailureListener { err ->
Toast.makeText(requireActivity(), "Error Logging In $err",
Toast.LENGTH_LONG).show()
progressbar.visibility = View.GONE
loginBtn.visibility = View.VISIBLE
}
}

private fun confirmFilled(): Boolean {


if(etEmail.text!!.isEmpty()){
etEmail.error = "Email Required"
etEmail.requestFocus()
return false
}else if(!Patterns.EMAIL_ADDRESS.matcher(email).matches()){
etEmail.error = "Invalid Email"
etEmail.requestFocus()
return false
}else if(etPassword.text!!.isEmpty()){
etPassword.error = "Password Required"
etPassword.requestFocus()
return false
}else if(etPassword.text!!.length < 8){
etPassword.error = "Minimum 8 Characters Required"
etPassword.requestFocus()
return false
}
return true
}
}

2. HomeFragment.kt

package com.mymurlipura

import android.annotation.SuppressLint
import android.app.AlertDialog
import android.content.ActivityNotFoundException
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.graphics.Color
import android.net.Uri
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.*
import androidx.appcompat.app.AppCompatActivity
import androidx.cardview.widget.CardView
import androidx.core.widget.NestedScrollView
import androidx.fragment.app.Fragment
import androidx.navigation.Navigation
import com.google.android.gms.tasks.OnCompleteListener
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.firestore.DocumentReference
import com.google.firebase.firestore.FirebaseFirestore
import com.google.firebase.storage.FirebaseStorage
import com.google.firebase.storage.StorageReference
import com.mikhaellopez.circularimageview.CircularImageView
import com.mymurlipura.mangers.ApplicationPrefs
import com.squareup.picasso.Picasso
import java.text.DateFormat
import java.text.SimpleDateFormat
import java.util.*

@Suppress("NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS",
"DEPRECATION")
class HomeFragment : Fragment() {

private lateinit var userFirstName: TextView


private lateinit var greet: TextView
private lateinit var profileImageShow: CircularImageView
private lateinit var editProfileBtn: ImageButton
private lateinit var profileCardView: CardView
private lateinit var gender: String
private lateinit var mainScroll: NestedScrollView
private lateinit var shopBtn: Button
private lateinit var regAsSellerBtn: Button
private lateinit var settingsBtn: Button
private lateinit var connectBtn: Button
private lateinit var facebook: ImageButton
private lateinit var instagram: ImageButton
private lateinit var whatsapp: ImageButton
private lateinit var aboutUsBtn: Button
private lateinit var signoutBtn: Button
private lateinit var exitBtn: Button
private lateinit var socialLayouts: LinearLayout
private lateinit var prefManager: ApplicationPrefs
private lateinit var storageReference: StorageReference
private lateinit var mAuth: FirebaseAuth
private lateinit var reference: DocumentReference
private lateinit var firstName: String
private lateinit var profileImgLoad: ProgressBar

@SuppressLint("RestrictedApi", "UseCompatLoadingForDrawables")
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
(requireActivity() as AppCompatActivity).supportActionBar?.hide()
val rootView = inflater.inflate(R.layout.fragment_home, container, false)
//Elements Initializing
userFirstName = rootView.findViewById(R.id.use_first_name)
profileImageShow = rootView.findViewById(R.id.img_profile_show)
greet = rootView.findViewById(R.id.greet)
editProfileBtn = rootView.findViewById(R.id.editProfileBtn)
profileCardView = rootView.findViewById(R.id.profileCardView)
mainScroll = rootView.findViewById(R.id.mainScroll)
shopBtn = rootView.findViewById(R.id.shopNowBtn)
regAsSellerBtn = rootView.findViewById(R.id.regAsSellerBtn)
settingsBtn = rootView.findViewById(R.id.settingsBtn)
connectBtn = rootView.findViewById(R.id.connectBtn)
aboutUsBtn = rootView.findViewById(R.id.aboutUsBtn)
signoutBtn = rootView.findViewById(R.id.signOutBtn)
exitBtn = rootView.findViewById(R.id.exitBtn)
socialLayouts = rootView.findViewById(R.id.socialLayout)
facebook = rootView.findViewById(R.id.facebook)
instagram = rootView.findViewById(R.id.instagram)
whatsapp = rootView.findViewById(R.id.whatsapp)
profileImgLoad = rootView.findViewById(R.id.profileImgLoading)

val user = FirebaseAuth.getInstance().currentUser


mAuth = FirebaseAuth.getInstance()
storageReference = FirebaseStorage.getInstance().reference
val userId = user!!.uid
val firestore = FirebaseFirestore.getInstance()
user.reload()
reference = firestore.collection("Users").document(userId)

reference.get().addOnCompleteListener { task ->


firstName = task.result?.getString("First Name")!!
gender = task.result?.getString("Gender")!!
userFirstName.text = firstName
setProfileBG()
}

setProfileImage()

prefManager = ApplicationPrefs()
if (prefManager.isRegisterAsSellerHidden()) {
regAsSellerBtn.visibility = View.GONE
}

setGreetText()

mainScroll.viewTreeObserver.addOnScrollChangedListener {
if (mainScroll.scrollY == 0) {
editProfileBtn.visibility = View.VISIBLE
} else {
editProfileBtn.visibility = View.INVISIBLE
}
}
editProfileBtn.setOnClickListener { view ->
Navigation.findNavController(
view
).navigate(R.id.action_homeFragment_to_editProfileFragment)
}

signoutBtn.setOnClickListener {
mAuth.signOut()
val intent = Intent(requireActivity(), AuthenticationActivity::class.java)
startActivity(intent)
}
shopBtn.setOnClickListener { view ->
Navigation.findNavController(
view
).navigate(R.id.action_homeFragment_to_shopNow)
(requireActivity() as
AppCompatActivity).supportActionBar!!.setDisplayHomeAsUpEnabled(
false
)
}
regAsSellerBtn.setOnClickListener { view ->
user.reload()
if(user.isEmailVerified){
Navigation.findNavController(
view
).navigate(R.id.action_homeFragment_to_sellerRegistration)
}else{
AlertDialog.Builder(this.requireActivity())
.setIcon(R.drawable.ic_baseline_new_releases_24)
.setTitle("Email Not Verified!")
.setMessage("You Must Verify Your Email To Register As Seller.")
.setPositiveButton("Verify Now"
) { _, _ ->
Navigation.findNavController(
view
).navigate(R.id.action_homeFragment_to_editProfileFragment)
}
.setNegativeButton("Cancel", null)
.show()
}
(requireActivity() as
AppCompatActivity).supportActionBar!!.setDisplayHomeAsUpEnabled(
false
)
}
settingsBtn.setOnClickListener { view ->
Navigation.findNavController(
view
).navigate(R.id.action_homeFragment_to_settings)
(requireActivity() as
AppCompatActivity).supportActionBar!!.setDisplayHomeAsUpEnabled(
false
)
}
connectBtn.setOnClickListener {
val less =
requireContext().resources.getDrawable(R.drawable.ic_baseline_expand_less_24)
val more =
requireContext().resources.getDrawable(R.drawable.ic_baseline_expand_more_24)
if (socialLayouts.visibility == View.GONE){
connectBtn.setCompoundDrawablesWithIntrinsicBounds(null, null, less, null)
socialLayouts.visibility = View.VISIBLE
connectBtn.setBackgroundResource(R.drawable.connect_btn_border)
}else if (socialLayouts.visibility == View.VISIBLE){
connectBtn.setCompoundDrawablesWithIntrinsicBounds(null, null, more, null)
socialLayouts.visibility = View.GONE
connectBtn.setBackgroundResource(R.drawable.btn_border)
}
}
facebook.setOnClickListener {

val facebookIntent = Intent(Intent.ACTION_VIEW)


val facebookUrl: String = getFacebookPageURL(this.requireActivity())
facebookIntent.data = Uri.parse(facebookUrl)
startActivity(facebookIntent)
}
instagram.setOnClickListener {
val uri = Uri.parse("https://www.instagram.com/mymurlipura/")
val likeIng = Intent(Intent.ACTION_VIEW, uri)

likeIng.setPackage("com.instagram.android")

try {
startActivity(likeIng)
} catch (e: ActivityNotFoundException) {
startActivity(
Intent(
Intent.ACTION_VIEW,
Uri.parse("https://www.instagram.com/mymurlipura/")
)
)
}
}
whatsapp.setOnClickListener {
val contact = "+91 7611947535"

val url = "https://api.whatsapp.com/send?phone=$contact"


try {
val pm = requireContext().packageManager
pm.getPackageInfo("com.whatsapp", PackageManager.GET_ACTIVITIES)
val i = Intent(Intent.ACTION_VIEW)
i.data = Uri.parse(url)
startActivity(i)
} catch (e: PackageManager.NameNotFoundException) {
Toast.makeText(
requireActivity(),
"Whatsapp Is Not Installed In Your Phone",
Toast.LENGTH_SHORT
).show()
e.printStackTrace()
}
}
aboutUsBtn.setOnClickListener { view ->
Navigation.findNavController(
view
).navigate(R.id.action_homeFragment_to_aboutUs)
(requireActivity() as
AppCompatActivity).supportActionBar!!.setDisplayHomeAsUpEnabled(
false
)
}
exitBtn.setOnClickListener {
AlertDialog.Builder(this.requireActivity())
.setIcon(android.R.drawable.ic_dialog_alert)
.setTitle("Exit App")
.setMessage("Are you sure you want to close this application?")
.setPositiveButton("Yes"
) { _, _ ->
activity?.moveTaskToBack(true)
activity?.finish()
}
.setNegativeButton("No", null)
.show()
}

return rootView
}

private fun setProfileImage() {


val fileReference: StorageReference = storageReference.child("Users/"+
mAuth.currentUser!!.uid+"/Profile Image.jpg")
fileReference.downloadUrl.addOnSuccessListener { uri ->
Picasso.get().load(uri).into(profileImageShow)
}
}

private fun getFacebookPageURL(context: Context): String {


val facebookUrl = "https://www.facebook.com/Mymurlipura"
val facebookPageId = "110232654548293"
val packageManager = context.packageManager
return try {
packageManager.getPackageInfo("com.facebook.katana", 0).versionCode
"fb://page/$facebookPageId"
} catch (e: PackageManager.NameNotFoundException) {
facebookUrl //normal web url
}
}

@SuppressLint("SimpleDateFormat")
private fun setGreetText() {
val cal: Calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT+5:30"))
val currentLocalTime: Date = cal.time
val date: DateFormat = SimpleDateFormat("HH:mm:ss")
date.timeZone = TimeZone.getTimeZone("GMT+5:30")
val localTime: String = date.format(currentLocalTime)

greet.text = localTime
if(localTime > "05:00:00" && localTime <= "12:00:00"){
greet.text = getString(R.string.good_morning_greet)
}else if(localTime > "12:00:00" && localTime <= "17:00:00"){
greet.text = getString(R.string.good_afternoon_greet)
}else if(localTime > "17:00:00" && localTime <= "21:00:00"){
greet.text = getString(R.string.good_evening_greet)
}else if(localTime > "21:00:00" && localTime <= "24:00:00"){
greet.text = getString(R.string.good_night_greet)
}else if(localTime > "00:00:00" && localTime <= "05:00:00"){
greet.text = getString(R.string.good_night_greet)
}
}

private fun setProfileBG() {


if (gender == "Male"){
profileCardView.setCardBackgroundColor(Color.parseColor("#a642b5"))
editProfileBtn.setBackgroundResource(R.drawable.male_edit_bg)
}else if(gender == "Female"){
profileCardView.setCardBackgroundColor(Color.parseColor("#ff48d2"))
editProfileBtn.setBackgroundResource(R.drawable.female_edit_bg)
}
}

3. SellerRegistration.kt
package com.mymurlipura

import android.annotation.SuppressLint
import android.content.Context
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.inputmethod.InputMethodManager
import android.widget.*
import 31ndroid.appcompat.app.AppCompatActivity
import 31ndroid.fragment.app.Fragment
import 31ndroid.navigation.Navigation
import 31ndroid.navigation.fragment.findNavController
import br.com.simplepass.loadingbutton.customViews.CircularProgressButton
import com.google.android.material.snackbar.Snackbar
import com.google.android.material.textfield.TextInputEditText
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.database.DatabaseReference
import com.google.firebase.database.FirebaseDatabase
import com.google.firebase.firestore.DocumentReference
import com.google.firebase.firestore.FirebaseFirestore
import com.mymurlipura.mangers.ApplicationPrefs
import com.mymurlipura.mangers.DetectConnection
import com.mymurlipura.mangers.SellerManager
import java.text.SimpleDateFormat
import java.util.*
import java.util.regex.Matcher
import java.util.regex.Pattern

@Suppress(“NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS”)
class SellerRegistration : Fragment() {

private lateinit var closeSellerRegBtn: ImageButton


private lateinit var sellerRegBackBtn: ImageButton
private lateinit var firstName: String
private lateinit var lastName: String
private lateinit var name: String
private lateinit var etName: TextInputEditText
private lateinit var etEmail: TextInputEditText
private lateinit var etAddress: TextInputEditText
private lateinit var etPhone: TextInputEditText
private lateinit var etPinCode: TextInputEditText
private lateinit var stepAhead: CircularProgressButton
private lateinit var rootNode: FirebaseDatabase
lateinit var reference: DatabaseReference
private lateinit var mReference: DocumentReference
private lateinit var basicInfoLayout: LinearLayout
private lateinit var otherInfoLayout: LinearLayout
private lateinit var email: String
private lateinit var offlineBtn: RadioButton
private lateinit var onlineBtn: RadioButton
private lateinit var mAuth: FirebaseAuth
private lateinit var dairyProducts: CheckBox
private lateinit var fruitsAndVegetable: CheckBox
lateinit var grocery: CheckBox
private lateinit var electronics: CheckBox
private lateinit var medicines: CheckBox
private lateinit var others: CheckBox
private lateinit var etOthers: EditText
private lateinit var registerBtn: CircularProgressButton
private lateinit var registerProgress: ProgressBar
private lateinit var notice: ImageButton

private lateinit var prefManager: ApplicationPrefs

@SuppressLint(“RestrictedApi”, “SetJavaScriptEnabled”)
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
(requireActivity() as
AppCompatActivity).supportActionBar?.setShowHideAnimationEnabled(false)
(requireActivity() as AppCompatActivity).supportActionBar?.hide()
val sellerRegView = inflater.inflate(R.layout.fragment_seller_registration, container,
false)
closeSellerRegBtn = sellerRegView.findViewById(R.id.closeSellerRegBtn)
sellerRegBackBtn = sellerRegView.findViewById(R.id.sellerRegBackBtn)

etName = sellerRegView.findViewById(R.id.name)
etEmail = sellerRegView.findViewById(R.id.email)
etAddress = sellerRegView.findViewById(R.id.address)
etPhone = sellerRegView.findViewById(R.id.phone_no)
etPinCode = sellerRegView.findViewById(R.id.pin_code)
stepAhead = sellerRegView.findViewById(R.id.stepAheadBtn)

basicInfoLayout = sellerRegView.findViewById(R.id.basicInfoLayout)
otherInfoLayout = sellerRegView.findViewById(R.id.otherInfoLayout)
notice = sellerRegView.findViewById(R.id.notice)
offlineBtn = sellerRegView.findViewById(R.id.offlineBtn)
onlineBtn = sellerRegView.findViewById(R.id.onlineBtn)
dairyProducts = sellerRegView.findViewById(R.id.dairyProducts)
fruitsAndVegetable =sellerRegView.findViewById(R.id.fruitsAndVegetables)
grocery = sellerRegView.findViewById(R.id.grocery)
electronics = sellerRegView.findViewById(R.id.electronics)
medicines = sellerRegView.findViewById(R.id.medicines)
others = sellerRegView.findViewById(R.id.others)
etOthers = sellerRegView.findViewById(R.id.othersEt)
registerBtn = sellerRegView.findViewById(R.id.registerBtn)
registerProgress = sellerRegView.findViewById(R.id.registerProgress)

val user = FirebaseAuth.getInstance().currentUser


mAuth = FirebaseAuth.getInstance()
val userId = user!!.uid
val firestore = FirebaseFirestore.getInstance()
mReference = firestore.collection(“Users”).document(userId)

mReference.get().addOnCompleteListener { task ->


firstName = task.result?.getString(“First Name”)!!
lastName = task.result?.getString(“Last Name”)!!
email = task.result?.getString(“Email”)!!
name = “$firstName $lastName”
etEmail.setText(email, TextView.BufferType.EDITABLE)
etName.setText(name, TextView.BufferType.EDITABLE)
etEmail.isEnabled = false
}

stepAhead.setOnClickListener {
if (checkFields()) {
sellerRegBackBtn.isEnabled = true
sellerRegBackBtn.alpha = 1F
basicInfoLayout.visibility = View.INVISIBLE
otherInfoLayout.visibility = View.VISIBLE
hideKeyboard()
}
}

others.setOnCheckedChangeListener { _, _ ->
if (others.isChecked) {
etOthers.visibility = View.VISIBLE
} else if (!others.isChecked) {
etOthers.visibility = View.INVISIBLE
}
}

notice.setOnClickListener {
val snackbar = Snackbar.make(sellerRegView, “Your Default Profile Email Will
Be Used For Your Seller Account Itself”, Snackbar.LENGTH_LONG)
snackbar.show()
}

registerBtn.setOnClickListener {
val name = etName.text.toString().trim()
val email = etEmail.text.toString().trim()
val address = etAddress.text.toString().trim()
val phone = etPhone.text.toString().trim()
val pinCode = etPinCode.text.toString().trim()
val today = Date()
val format = SimpleDateFormat(“dd-MM-yyyy, hh:mm:ss a”)
val dateToStr: String = format.format(today)
val dateAndNumber = “$phone, $dateToStr”
var mode = “”
if (offlineBtn.isChecked) {
mode = “Offline”
} else if (onlineBtn.isChecked) {
mode = “Online”
}
var productsAndServices = “”
var isNotFirst = false
if (dairyProducts.isChecked) {
productsAndServices += “DairyProducts”
isNotFirst = true
}
if (fruitsAndVegetable.isChecked) {
if (isNotFirst)
productsAndServices += “, “
productsAndServices += “Fruits And Vegetables”
isNotFirst = true
}
if (grocery.isChecked) {
if (isNotFirst)
productsAndServices += “, “
productsAndServices += “Grocery”
isNotFirst = true
}
if (electronics.isChecked) {
if (isNotFirst)
productsAndServices += “, “
productsAndServices += “Electronics”
isNotFirst = true
}
if (medicines.isChecked) {
if (isNotFirst)
productsAndServices += “, “
productsAndServices += “Medicines”
isNotFirst = true
}
if (others.isChecked) {
if (isNotFirst)
productsAndServices += “, “
productsAndServices += etOthers.text
}
if
(!DetectConnection.checkInternetConnection((requireActivity().applicationContext))) {
val dialogView: View = inflater.inflate(R.layout.net_error_dialog, null)
val dialogCloseButton =
dialogView.findViewById<Button>(R.id.dialogCloseButton)
val builder: android.app.AlertDialog.Builder =
android.app.AlertDialog.Builder(activity)
builder.setView(dialogView)
builder.setCancelable(false)
val alert: android.app.AlertDialog = builder.create()

alert.window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
alert.show()
dialogCloseButton.setOnClickListener {
alert.cancel()
}
} else {
if (checkOtherFields()) {
registerBtn.visibility = View.GONE
registerProgress.visibility = View.VISIBLE
rootNode = FirebaseDatabase.getInstance()
reference = rootNode.getReference(“Sellers”)
val user = SellerManager(
name,
email,
address,
phone,
pinCode,
mode,
productsAndServices
)

reference.child(dateAndNumber).setValue(user)
.addOnSuccessListener {
prefManager = ApplicationPrefs()
val dialogView: View =
inflater.inflate(R.layout.reg_successful_dialog, null)
val dialogRemoveButton =
dialogView.findViewById<Button>(R.id.removeBtn)
val dialogKeepButton =
dialogView.findViewById<Button>(R.id.keepBtn)
val builder: android.app.AlertDialog.Builder =
android.app.AlertDialog.Builder(activity)
builder.setView(dialogView)
builder.setCancelable(false)
registerProgress.visibility = View.GONE
registerBtn.visibility = View.VISIBLE
val alert: android.app.AlertDialog = builder.create()

alert.window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
alert.show()
dialogRemoveButton.setOnClickListener {
prefManager.hideRegisteredAsSeller(true)
view?.let { it1 ->
Navigation.findNavController(
it1
).navigate(R.id.action_sellerRegistration_to_homeFragment)
alert.cancel()
}
}
dialogKeepButton.setOnClickListener {
prefManager.hideRegisteredAsSeller(false)
view?.let { it1 ->
Navigation.findNavController(
it1
).navigate(R.id.action_sellerRegistration_to_homeFragment)
alert.cancel()
}
}
}.addOnFailureListener {
Toast.makeText(
this.requireActivity(),
“Registration Failed”,
Toast.LENGTH_SHORT
).show()
}
}
}
}

closeSellerRegBtn.setOnClickListener {
findNavController().popBackStack()
}
sellerRegBackBtn.setOnClickListener {
otherInfoLayout.visibility = View.INVISIBLE
basicInfoLayout.visibility = View.VISIBLE
sellerRegBackBtn.isEnabled = false
sellerRegBackBtn.alpha = 0.5F
}

return sellerRegView
}

private fun hideKeyboard() {


(context?.getSystemService(Context.INPUT_METHOD_SERVICE) as
InputMethodManager?)?.hideSoftInputFromWindow(
basicInfoLayout.windowToken,
0
)
}

private fun checkOtherFields(): Boolean {


if(others.isChecked && etOthers.text.isEmpty()){
Toast.makeText(this.requireActivity(), “Please Specify Name Of Other Product
Or Services You Provide”, Toast.LENGTH_SHORT).show()
return false
}
if(!dairyProducts.isChecked &&
!fruitsAndVegetable.isChecked &&
!grocery.isChecked &&
!electronics.isChecked &&
!medicines.isChecked &&
!others.isChecked){
Toast.makeText(this.requireActivity(), “Please Select At Least One Product Or
Services You Provide”, Toast.LENGTH_SHORT).show()
return false
}
return true
}

private fun checkFields(): Boolean {


if (etName.text!!.isEmpty()){
Toast.makeText(this.requireActivity(), “Name Cannot Be Empty”,
Toast.LENGTH_SHORT).show()
return false
}else if(etPhone.text!!.isEmpty()){
Toast.makeText(this.requireActivity(), “Phone Number Cannot Be Empty”,
Toast.LENGTH_SHORT).show()
return false
}else if(etEmail.text!!.isEmpty()){
Toast.makeText(this.requireActivity(), “Email Cannot Be Empty”,
Toast.LENGTH_SHORT).show()
return false
}else if(etAddress.text!!.isEmpty()){
Toast.makeText(this.requireActivity(), “Address Cannot Be Empty”,
Toast.LENGTH_SHORT).show()
return false
}else if(etPinCode.text!!.isEmpty()){
Toast.makeText(this.requireActivity(), “Pin Code Cannot Be Empty”,
Toast.LENGTH_SHORT).show()
return false
}else if(etName.text!!.length < 4){
Toast.makeText(this.requireActivity(), “Please Enter A Valid Name”,
Toast.LENGTH_SHORT).show()
return false
}else if(etPhone.text!!.length < 10){
Toast.makeText(this.requireActivity(), “Please Enter A Valid Phone Number”,
Toast.LENGTH_SHORT).show()
return false
}else if(!isEmailValid(etEmail.text.toString())){
Toast.makeText(this.requireActivity(), “Please Enter A Valid Email Address”,
Toast.LENGTH_SHORT).show()
return false
}else if(etAddress.text!!.length < 5){
Toast.makeText(this.requireActivity(), “Please Enter A Valid Address”,
Toast.LENGTH_SHORT).show()
return false
}else if(etPinCode.text!!.length < 6){
Toast.makeText(this.requireActivity(), “Please Enter A Valid Pin Code”,
Toast.LENGTH_SHORT).show()
return false
}
return true
}

private fun isEmailValid(email: String?): Boolean {


val expression = “^[\\w.-]+@([\\w\\-]+\\.)+[A-Z]{2,4}$”
val pattern: Pattern = Pattern.compile(expression, Pattern.CASE_INSENSITIVE)
val matcher: Matcher = pattern.matcher(email)
return matcher.matches()
}
}
VII - SCREENSHOTS
7.1 USER INTERFACE SCREENSHOTS

7.1.1 SPLASH SCREEN

7.1.2 SLIDER INTRO


7.1.3 AUTHENTICATION

LOGIN PAGE

SIGN UP PAGE

RESET PASSWORD PAGE


7.1.4 HOME PAGE

7.1.5 EDIT PROFILE


7.1.6 SHOP NOW

7.1.7 REGISTER AS SELLER

Step I Step II
7.1.8 SETTINGS

7.1.9 SOCIAL HANDLES CONNECTIVITY


7.1.10 ABOUT

7.1.11 QUERY
7.2 FIREBASE DATABASE SCREENSHOTS

7.2.1 AUTHENTICATION

7.2.2 SELLER REALTIME DATABASE


VIII - REFERENCES

Appendix – A List of Useful Websites

 https://www.youtube.com/channel/UCB2B0AuQgk6eOMbWR7qiqew
 https://www.youtube.com/watch?v=tbh9YaWPKKs
 https://developer.android.com/kotlin/kotlin-java-resources
 https://github.com/arsltech/Github-WebView-Android-App
 https://www.javatpoint.com/android-hide-title-bar-example

Appendix – A List of Useful Books

 Android Programming: The Big Nerd Ranch Guide


by Phillips, Bill, Stewart, Chris, Marsicano, Kristin, Gardner, Brian
edition 4th Edition
ISBN No. 9780134706061
 Learn Kotlin Programming
by Stefan Bocutiu and Stephen Samuel
edition 2nd Edition
ISBN No. 9781787126367

You might also like