EcoCart
EcoCart
A Project Report
Submitted in partial fulfilment of the
Sabari Sugan
18028
Under the esteemed guidance of
Mrs. Gayatri
S.I.W.S.
(AUTONOMOUS)
(Affiliated to University of Mumbai)
MUMBAI – 400031
MAHARASHTRA
2024-2025
NAAC RE-ACCREDITED A GRADE
S.I.W.S.
(AUTONOMOUS)
CERTIFICATE
This is to certify that the project entitled, "Eco-Cart an Eco-Friendly Shopping App", is bonafied
work of Sabari Sugan bearing Seat. No: 18028 submitted as part of the curriculum for the Second
Year of BACHELOR OF SCIENCE in INFORMATION TECHNOLOGY under the University of Mumbai
I sincerely acknowledge with deep gratitude my Project Guide Mrs. Gayatri Venkatachalam
for her valuable guidance, support, and encouragement throughout the development of the
"EcoCart Shopping Cart Application" project. Her insightful suggestions and consistent
mentorship helped shape the direction and quality of the project significantly.
I extend my heartfelt thanks to all the faculty members of the Information Technology
Department, especially our Head of Department Prof. R. Santha Maria Rani, for their
invaluable support during this journey. Their cooperation and knowledge-sharing made a
meaningful impact on the project’s successful completion. I am immensely grateful to all
who were involved in this project work because, without their cooperation, inspiration and
useful suggestions, it would be impossible to complete this task and synopsis report within
this allotted time. Furthermore, I express my deep gratitude to my project guide for their
dedication and encouragement, which significantly contributed to the project's progress and
success. Her valuable insights and mentorship played a pivotal role in making this project.
DECLARATION
I hereby declare that the project entitled “Eco Cart Shopping Cart Application”, developed
at S.I.W.S. N.R. Swamy College of Commerce and Economics & Smt. Thirumalai
College of Science, Mumbai, is my original work and has not been submitted elsewhere for
any academic degree or diploma.
This project is submitted in partial fulfilment of the requirements for the degree of Bachelor
of Science in Information Technology as part of the fourth semester curriculum.
Sabari Sugan
TABLE OF CONTENTS
Chapter 1: Introduction……………………………………………………… .1
1.1 Background………………………………………………………………… .1
1.2 Purpose, Scope, and Applicability………………………………………… ..1
1. Purpose………………………………………………………………………..2
2. Scope…………………………………………………………………………. 2
3. Applicability………………………………………………………………... ..2
1.3 Organization of Report……………………………………………………... 3
Chapter 2: System Analysis………………………………………………….. .4
2.1 Literature Review………………………………………………………….. .4
1. Rise of Mobile Commerce (m-Commerce)………………………………….. 4
2. Traditional Shopping Cart Systems………………………………………….. 4
3. Android Studio Framework and Its Advantages………………………...…....5
4. Use of Shared Preferences………………………………………………….. ..5
5. Payment Handling without Gateway Integration……………………………..5
6. Cart and Checkout Logic……………………………………………………. .6
2.2 Functional Requirements…………………………………………………... .6
2.3 Non-Functional Requirements……………………………………………... .7
2.4 Maintainability…………………………………………………………….. ..8
2.5 Availability and Disaster Recovery……………………………………….. ..9
2.6 Software Requirements Specification (SRS)……………………………… ..9
1. Product Features……………………………………………………………. 10
2. System Features……………………………………………………………. .11
3. External Interface Requirements…………………………………………. ...11
2.7 Function Point Analysis (FPA)…………………………………………... ..11
1. Objectives of FPA…………………………………………………………... 12
2. Component Identification………………………………………………….. .12
3. Weighting and Calculation…………………………………………………. 13
2.8 COCOMO Model…………………………………………………………. 15
1. Model Selection…………………………………………………………….. 15
2. Effort Estimation………………………………………………………….....15
3. Time and Cost Estimation………………………………………………….. 16
2.9 QR Code Scanning………………………………………………………....17
2.10 Software Requirements…………………………………………………... 17
2.11 Hardware Requirements………………………………………………... ..18
2.12 Planning and Scheduling………………………………………… ……....19
Chapter 3: System Design……………………………………………… …....21
3.1 Flowchart…………………………………………………………… ……..22
3.2 UML Diagrams…………………………………………………… ……….23
1. Entity Relationship Diagram…………………………………… …………..23
2. Data Flow Diagrams (DFD)…………………………………… …………...24
Level 0……………………………………………………… ………………....25
Level 1……………………………………………………… ………………....25
Level 2……………………………………………………… ………………....26
Level 3……………………………………………………… ………………....27
3. Class Diagram………………………………………………… …………….28
4. Use Case Diagram……………………………………………… …………..28
5. Activity Diagram……………………………………………… ……………30
6. Sequence Diagram…………………………………………… ……………..33
7. Statechart Diagram…………………………………………… …………….33
Chapter 4: Implementation & Testing………………………………… ……34
4.1 Code Implementation……………………………………………… ………34
1. Code Modules………………………………………… …………………….34
4.2 Testing Approach…………………………………………………… ……..36
1. Unit Testing…………………………………………………… ……………36
2. Integration Testing…………………………………………… ……………..37
Chapter 5: Results and Discussion…………………………………… ……..42
5.1 Results……………………………………………………………… ……...43
5.2 Discussion………………………………………………………… ……….43
Chapter 6: Conclusion & Future Work………………………………… …..45
6.1 Conclusion………………………………………………………… ………45
6.2 Future Work……………………………………………………… ………..46
Chapter 7: References………………………………………………… ……..44
LIST OF FIGURES
The modern era of shopping has shifted drastically toward digital solutions, driven by the
growing adoption of smartphones and mobile applications. Consumers now seek
convenience, speed, and environmentally conscious alternatives in their purchasing decisions.
With increasing awareness around sustainability, there is a rising need for platforms that
encourage eco-friendly consumption while offering a seamless shopping experience.
EcoCart is an Android-based mobile application developed to fulfill this very goal—offering
users a curated range of sustainable products with an intuitive interface. The app enables
users to browse eco-conscious products, add them to a cart, and complete purchases using
either QR code payments or Cash on Delivery (COD). Unlike conventional shopping apps,
EcoCart emphasizes minimalism, ease of use, and green consumerism. Built using Android
Studio and Kotlin, this application delivers high performance across Android devices. The
core intention is to promote eco-living through technology while simplifying the shopping
experience.
1.1 Background
The demand for green products and sustainable living options has grown alongside the global
movement toward environmental conservation. While many e-commerce apps dominate the
market, very few focus specifically on promoting eco-friendly shopping. Local vendors and
start-ups offering green alternatives often lack digital platforms to reach a wider audience.
EcoCart bridges this gap by providing a clean, fast, and eco-centric shopping platform.
Android Studio with Kotlin was chosen due to its seamless integration with Android
development, performance optimization, and the ability to easily create native Android
applications. The app does not rely on complex databases or authentication systems in its
initial version, making it lightweight and suitable for small-scale deployments or academic
projects.
Users can interact with the application in a straightforward manner viewing products, adding
them to the cart, and completing orders without needing to log in. For local storage,
Android’s SharedPreferences is used to store order details securely, ensuring users can track
their purchases with minimal infrastructure.
Purpose
The aim of this project is to design and develop an easy-to-use mobile shopping application
focused on sustainability. EcoCart is intended to assist users in discovering and purchasing
eco-friendly items, such as reusable bags, bamboo toothbrushes, and recyclable notebooks, in
just a few taps.
1
The app emphasizes:
This project also serves as a demonstration of how Android Studio with Kotlin can be used
effectively to build real-world applications that are scalable and maintainable. The app is
designed to be lightweight, utilizing local storage and keeping infrastructure minimal, which
makes it suitable for small-scale deployments or academic projects.
Scope
The project excludes advanced features like user registration, login, payment gateway APIs,
or delivery tracking, making it lightweight and easy to deploy. Instead of using Firebase, the
app uses SharedPreferences for local data storage, which simplifies the app’s architecture.
Applicability
2
behind the project, including its background, purpose, objectives, scope, and applicability.
The next section, requirement analysis, discusses both functional and non-functional
requirements that define the expected behavior and quality of the application. This is
followed by system design, which features diagrams such as Data Flow Diagrams (DFDs),
Entity Relationship (ER) diagrams, Use Case diagrams, Activity diagrams, and Class
diagrams that illustrate the logical structure and process flow of the application.
The implementation section details the technologies used, particularly Android Studio with
Kotlin for development and SharedPreferences for local data storage, and explains how
various features like the product list, cart, checkout flow, and QR/COD payment options were
developed. The testing section includes the approach for validating input fields such as name
and phone number, and describes how unit testing was carried out using JUnit.
Effort estimation and cost analysis are presented using Function Point Analysis (FPA) and
the COCOMO model to understand the project’s development requirements. The report then
reviews the results and usability of the application, followed by a conclusion summarizing the
achievements and recommending future enhancements such as guest checkout, multi-
language support, and user login. The report closes with references to tools and concepts used
during development.
3
Chapter 2: System Analysis
The growth of mobile technology has revolutionized the way consumers shop, communicate,
and interact with services. With smartphones becoming widely accessible, mobile commerce
has become an essential channel for business. The EcoCart application was conceptualized
and developed to provide a simple, fast, and eco-conscious shopping experience without the
need for login, registration, or cloud database dependencies. This section explores the
research and technological trends that shape such applications.
They also required a consistent internet connection and back-end maintenance, which may
not be suitable for small-scale businesses or student projects. EcoCart moves away from these
legacy systems by leveraging Android Studio with Kotlin and SharedPreferences for local
storage to simulate a complete shopping experience without needing a cloud database.
1. Native development: Kotlin enables seamless Android development with full access
to device capabilities.
2. Rich UI components: Android Studio provides tools for designing beautiful user
interfaces using Material Design components.
4
3. Fast development: Features like Instant Run and efficient debugging tools improve
development speed and productivity.
4. Native performance: Android Studio allows direct access to Android device features,
ensuring high performance for the app.
EcoCart uses Android Studio and Kotlin’s powerful tools to create a smooth and efficient
experience for browsing eco-products and checking out with minimal code and resources.
This offline-first approach is beneficial for basic or educational apps and demonstrates
efficient local data handling in Android Studio using Kotlin.
1. Cash on Delivery (COD): The user confirms the order and pays upon delivery.
2. QR Code Payment: The user is shown a QR code, scans it using any UPI app, and
clicks “Payment Done” after completing it.
5
2.2 Functional Requirements
Functional requirements describe the features and behavior that the EcoCart app must
implement. These define how the system will respond to user interactions and the expected
outcomes.
The system shall present a grid of eco-friendly products including the name, image,
and price.
The user shall be able to scroll through the product catalog.
The product details shall be visible directly on the card without navigating to another
page.
2. Add to Cart
The system shall show the cart page containing all selected products.
Each product shall include its image, name, price, and quantity.
The user shall be able to:
1. Increase or decrease the quantity of an item.
2. Remove an item from the cart.
3. View the dynamically updated total amount.
4. Proceed to Checkout
5. Payment Options
After the form submission, the system shall show two payment options:
1. Cash on Delivery (COD)
2. QR Code
On selecting the QR option, a static QR code shall be displayed, and the user will confirm
when payment is done.
6
6. Order Confirmation
Non-functional requirements focus on how the EcoCart app performs its functions, ensuring
usability, reliability, and efficiency.
1. Performance
App Load Time: The app must load in under 3 seconds on most devices.
Cart Management: Adding/removing cart items should happen instantly without
noticeable delays.
Image Loading: Images should load smoothly using local assets, ensuring that the
user experience is not interrupted by long loading times.
2. Reliability
Data Persistence: Cart data must persist across app restarts using shared preferences
or another form of local storage.
Error Handling: The app must handle invalid inputs gracefully, providing clear
feedback when incorrect data is entered.
Data Recovery: If the user closes the app during checkout, no data should be lost; the
app should recover the cart and user details upon reopening.
3. Usability
Design Aesthetic: The interface shall use a green and white theme to align with the
environmental consciousness of the app.
Accessibility: All text and buttons must be easily readable and accessible for a wide
range of users.
Intuitive Navigation: Navigation must be clear and intuitive, with well-labeled
buttons such as “Add to Cart”, “Checkout”, and “Payment Done” to guide the user
through the app.
4. Compatibility
Device Compatibility: The app must run smoothly on Android smartphones of
various screen sizes, ensuring that it is adaptable to different devices.
Future iOS Compatibility: The codebase should be structured in a way that it can be
easily ported or extended to iOS in the future if necessary.
5. Security
7
No Sensitive Data Handling: The app does not store or process any sensitive data
such as passwords, payment details, or personal identification numbers (PINs).
Input Validation: Input fields must be validated to prevent the entry of incorrect or
malformed data, ensuring that user details are properly captured.
2.4 Maintainability
Maintainability refers to the ease with which the software system can be modified to correct
faults, improve performance, or adapt to a changed environment. In the EcoCart Android
application built using Kotlin in Android Studio, maintainability is a core consideration to
ensure future enhancements, debugging, and updates can be made smoothly without
disrupting existing functionality.
The codebase is organized using modular principles, separating features like cart
management, product listing, and checkout into individual Kotlin files and composable
functions. This modular structure allows developers to work on specific components
independently, improving clarity and reducing the risk of introducing bugs elsewhere in the
app.
SharedPreferences is used to manage cart data locally, eliminating the need for a complex
backend or database. This makes the system simpler and easier to maintain, especially for
lightweight apps where cloud storage is not essential. The use of SharedPreferences also
ensures persistent data across sessions without additional overhead.
The code follows clean development practices such as meaningful naming conventions,
consistent indentation, and minimal redundancy, making it easier for developers to read,
understand, and modify the code.
All crucial data including selected products and cart contents is stored locally using Android's
SharedPreferences, which allows the app to retain data even after being closed or if the
device restarts. This ensures that users do not lose progress and can resume their shopping
session at any time.
From a disaster recovery perspective, while EcoCart does not currently implement cloud-
based backup systems, the use of persistent local storage offers a foundational level of
recovery. In the event of an unexpected crash or closure, the app can retrieve the stored data
and restore the previous state of the cart.
8
For future enhancements, integrating a cloud-based solution such as Firebase would enable
advanced disaster recovery mechanisms. These could include real-time synchronization,
scheduled data backups, and the ability to recover data across different devices. However,
even in its current lightweight setup, EcoCart ensures a dependable and consistent experience
for its users.
1. Introduction
1.1 Purpose
This document provides the Software Requirements Specification (SRS) for the EcoCart
app. The purpose of the app is to allow users to browse eco-friendly products, add them to a
shopping cart, and proceed to checkout. The application supports local storage for cart data
and displays a QR code during the checkout process.
1.2 Scope
EcoCart is a mobile shopping cart application developed using Android Studio. It enables
users to manage their shopping experience by browsing eco-friendly products, adding them to
the cart, editing the cart, and proceeding to checkout—all without requiring an internet
connection or user login.
2. Overall Description
End User: General user who can interact with the app freely, without account
creation.
Admin: Not applicable in the current version.
9
Supports Android and iOS platforms.
Requires a mobile device with basic hardware features and optional internet for
updates.
3. System Features
3.3 Checkout
Description: Finalizes purchase process.
Functional Requirements:
Home Page: Contains navigation tabs (Home, Products, Contact Us, Cart).
Cart Page: Shows cart items with quantity controls.
Checkout Screen: Lets users select payment methods.
Modal Bottom Sheets: Displayed for payment method selection.
Requires a smartphone/tablet.
Optional internet access for app updates and product refresh.
10
4.4 Communication Interfaces
5. Functional Requirements
1. Introduction
Function Point Analysis (FPA) is a standardized method used to measure the functional size
of software. Unlike lines of code or development time, it focuses purely on the functionality
that the software delivers to the user. FPA provides a consistent method to evaluate project
size and effort during early stages of software development, aiding in estimation, scheduling,
and resource planning.
FPA categorizes software features into five functional components and quantifies each based
on its complexity. The final output is expressed in Function Points (FPs).
2. Objectives of FPA
1. Measure the functional size of the Eco-Cart application.
2. Estimate the development effort required.
3. Support accurate planning and resource allocation.
Component Description
External Inputs (EI) Data or control inputs provided by users (e.g., adding to cart).
Outputs generated by the system (e.g., total price, confirmation
External Outputs (EO)
messages).
11
Component Description
Queries that involve both input and output without changing
External Inquiries (EQ)
internal data.
Internal Logical Files Logical groups of internal data maintained by the system (e.g.,
(ILF) product list).
External Interface Files Files used by the application but maintained by external
(EIF) systems.
Total EI = 3
Total EO = 2
Total EQ = 1
Total ILF = 2
12
External Interface Files (EIF):
Total EIF = 0
The Value Adjustment Factor (VAF) is calculated using 14 General System Characteristics
(GSCs), each rated on a scale from 0 (no influence) to 5 (strong influence). These
characteristics include:
1. Data communications
2. Distributed data processing
3. Performance requirements
4. Heavily used configuration
5. Transaction rate
6. On-line data entry
7. End-user efficiency
8. On-line update
9. Complex processing
10. Reusability
11. Installation ease
12. Operational ease
13. Multiple sites
14. Facilitate change
For the Eco Cart app, we assign a moderate influence (3) to each GSC:
13
Total Degree of Influence (DI) = 14 × 3 = 42
VAF = 0.65 + (0.01 × DI) = 0.65 + 0.42 = 1.07
8. Conclusion
Function Point Analysis provides a reliable metric for understanding the functionality
delivered by the Eco-Cart app. Based on the analysis:
1. Introduction
The Constructive Cost Model (COCOMO) is a software cost estimation model that predicts
the effort, time, and cost needed for software development. For the Eco-Cart Application,
which is a relatively simple shopping cart application without a database, the Basic
COCOMO model can be used to estimate development cost and effort.
1. Effort estimation
2. Time estimation
3. Team size calculation
4. Cost estimation
Given that Eco-Cart is a straightforward shopping cart app without a backend database or
complex integrations, Semi-Detached Mode is most appropriate.
3. Effort Estimation
E=a×(KLOC)b
Where:
Since the app doesn't have a database and is simpler, we'll use a conservative estimate of the
total Function Points for this case.
1. Total Function Points (FP) = ~100 (simplified for the Eco-Cart app)
2. 1 FP ≈ 27 LOC (standard for simple apps)
4. Time Estimation
T=c×(E)d
Where:
1. TT = Time in Months
2. c=2.5c = 2.5
3. d=0.35d = 0.35
15
5. Team Size Estimation
Thus, a team of 2 developers would be sufficient to complete the project within the
estimated time.
6. Cost Estimation
Assumptions:
Development Cost:
8. Conclusion
For the Eco-Cart Application, based on the Basic COCOMO model estimation:
This simplified estimation helps with budgeting, scheduling, and team planning. Further
refinements can be done based on evolving requirements, especially if new features (like
payment gateway integration or data persistence) are added to the app later.
16
2.9 QR Code Scanning
QR code scanning plays an important role in modern payment systems by allowing fast,
secure, and contactless transactions. In the EcoCart application, QR code scanning is
implemented as one of the primary payment methods during checkout. Users are presented
with a QR code that can be scanned using any UPI-compatible mobile app such as Google
Pay or PhonePe. After payment confirmation, the user can proceed to finalize the order.
The implementation of this feature improves user convenience by reducing the need for
manual input of payment details, which also minimizes errors. This feature has been simply
by displaying a QR image as an asset. QR payment also adds a layer of security since the user
never has to enter sensitive data into the app.
This method is widely accepted in the Indian market and supports the app’s goal of being
eco-friendly and low-cost by not depending on expensive payment gateway integrations. As
more users adopt digital payments, QR code integration ensures the app remains modern,
accessible, and efficient.
The development of the EcoCart Android application using Kotlin requires a well-defined set
of tools and technologies to ensure smooth development and deployment. The core
development is carried out using Android Studio, the official IDE for Android development,
which provides comprehensive features for designing, coding, testing, and debugging.
The Kotlin programming language is used for building the application, as it is fully supported
by Android Studio and offers modern, concise, and safe syntax for Android app development.
The latest stable version of Kotlin (1.7 or higher) is recommended to ensure compatibility
with Jetpack components and other libraries.
The application is designed specifically for Android, and testing is facilitated using the
Android Emulator or a physical Android device. Since this project does not rely on remote
servers, Firebase integration is excluded, although it remains an option for future expansion.
For local data storage, SharedPreferences is used to store small amounts of persistent user data
efficiently.
Hardware requirements are essential to ensure that the development and usage of the EcoCart
application using Android Studio with Kotlin are smooth, efficient, and accessible.
Development Requirements
To develop EcoCart efficiently in Android Studio using Kotlin, the following system
specifications are recommended:
17
RAM: Minimum 8GB (16GB recommended for handling Android Emulator and
Gradle builds)
Storage: SSD with at least 256GB free space for fast build performance
Graphics: GPU supporting virtualization and hardware acceleration
Operating System: Windows 10/11, macOS (10.15+), or Linux (64-bit)
Tools:
o Android Studio (latest stable version)
o Kotlin Plugin
o Gradle Build System
Gannt Chart
1. Planning (Week 1)
1. Week 2:
1. Home Page UI Design
Create wireframes and UI layouts for the app’s home screen.
2. Cart Page UI Design
Design how the cart page will look and behave visually.
2. Week 3:
18
Checkout UI Design
Layout design for the checkout screen, including address, summary, and payment
options.
1. Week 8 - 9:
1. Manual Testing & Bug Fixes
Run manual test cases, note down issues, and fix bugs iteratively.
2. Week 9 - 10:
1. Unit Testing
Write and execute automated unit tests for critical functionalities (cart,
checkout, payment, etc.).
1. Week 10 - 11:
1. Final UI & Polishing
Fine-tune UI elements, align components, fix minor UI glitches.
2. Week 11 - 12:
1. Improve UX with Toast Messages
Add feedback elements like toast messages for user actions (e.g., "Item added
to cart").
3. Week 12 - 13:
1. Prepare the App for Demo
Final touch-ups, create a build for demonstration purposes.
19
4. Week 14 - 15:
1. APK Build
Build and generate the final APK for release and deployment.
20
Chapter 3: System Design
3.1 Flowchart
The image depicts a flowchart for the Eco-Cart mobile shopping application.
The process begins with the user launching the app, followed by a welcome screen where the
user proceeds to the shopping section. A list of eco-friendly products is displayed, allowing
the user to browse and add desired items to the cart. Upon reviewing the cart, the user
proceeds to checkout where they are prompted to enter delivery details such as name, phone
number, and address.
The user is then offered two payment options—Cash on Delivery (COD) or QR Code
payment. If the details entered are valid, and the payment is either confirmed (in case of QR)
or accepted (in case of COD), the order is recorded and a confirmation is shown. The order
data is also saved locally and optionally uploaded to a cloud database if integrated. If
validation fails, the user is notified with appropriate messages.
21
This flowchart represents a streamlined mobile shopping process, ensuring that users can
browse, order, and pay for eco-friendly products in a structured and user-friendly way. It
helps simplify online shopping, particularly for sustainable goods, and supports users in
making informed, environment-conscious purchases.
The ER diagram for the Eco-Cart application represents a digital eco-friendly shopping
system. Key entities include User, Product, Order, and Order Details. The User entity holds
customer information such as UserID, Name, Phone, and Address, uniquely identifying each
shopper. The Product entity captures details like ProductID, Name, Price, and Image,
representing the eco-friendly items available in the store. The Order entity includes attributes
like OrderID, OrderDate, PaymentMethod, and TotalAmount, linking users to their
purchases. The OrderDetails entity manages the many-to-many relationship between products
and orders by storing OrderID, ProductID, and Quantity. This structured model ensures
efficient management of product purchases and user data within the Eco-Cart system.
22
2. Data Flow Diagram (DFD)
0 level
The Level 0 DFD for Eco-Cart presents a high-level overview of the system as a single
process interacting with external entities: User and Payment Gateway. Users browse
products, add them to the cart, and proceed to checkout. Data flows into the system as user
input and flows out in the form of confirmation and payment processing. The main process,
“Eco-Cart App,” handles all operations including managing the cart, generating order
summaries, and handling payment choices like QR or COD. This diagram outlines the overall
data movement without showing internal processing.
23
1st level
The Level 1 DFD breaks down the main Eco-Cart process into sub-processes: Product
Browsing, Cart Management, Checkout, and Payment Processing. Users send data inputs
such as selected products, which are handled by the system and stored temporarily in cart
storage. During checkout, user details like name, address, and phone number are collected.
The Payment process then branches to either QR Code or Cash on Delivery. Output is sent to
the confirmation process and optionally stored in local storage (like Shared Preferences). This
diagram shows the internal functions in more detail compared to Level 0.
24
2nd level
25
3rd level
26
3. Class Diagram
The class diagram shows the structure of classes in the Eco-Cart app. It includes classes like
Product, CartPage, and CartStorage. Each class has attributes (e.g., name, price, image) and
methods (e.g., calculateTotal(), saveCart()), demonstrating how data and behavior are
encapsulated. It also shows relationships like aggregation between CartPage and Product.
This diagram defines the object-oriented structure of the app.
27
The Use Case diagram of Eco-Cart shows interactions between the User and the system. Key
use cases include Browse Products, Add to Cart, View Cart, Checkout, Choose Payment
Method, and Confirm Order. The user interacts directly with these functionalities, and system
responses include displaying product information, calculating totals, validating user details,
and completing transactions. This diagram helps visualize user interaction points within the
system.
28
5. Activity Diagram
29
The activity diagram illustrates the workflow in the Eco-Cart system starting from app
launch. The user navigates to product listing, adds items to the cart, reviews the cart, enters
checkout details, and selects a payment method (QR or COD). Based on the choice, the
system either shows a QR scanner or confirms a COD order. The flow ends with an order
confirmation message. This diagram is useful to show the step-by-step process of how a user
completes a purchase.
6. Sequence Diagram
The sequence diagram shows the order of interaction between different components: User,
CartPage, PaymentDialog, and CartStorage. When the user clicks checkout, the system
prompts for user details and payment selection. If QR is selected, a QR image is shown; upon
confirmation, the order is saved and the cart is cleared. The timeline captures the exact
sequence of method calls and UI interactions during the checkout process.
30
7. Statechart Diagram
The state chart diagram illustrates how the Eco-Cart app transitions between different states
during the shopping process. The flow starts at App Start, moves to Browsing Products, then
to Cart View, followed by Checkout, and finally to Order Confirmation. Based on user
actions, the system transitions through these states. Optional branches include QR Payment or
31
COD, leading to the final confirmation state. This diagram helps visualize app behaviour
dynamically based on user events
32
Chapter 4: Implementation & Testing
4.1 Code
The Eco-Cart application is a mobile-based shopping platform developed using Android
Studio with Kotlin. The primary goal of this app is to offer users a convenient, eco-friendly
shopping experience. The app allows users to browse a variety of sustainable products, add
items to their shopping cart, and choose between two payment methods: QR code scanning
and Cash on Delivery (COD). The app is designed with a clean and responsive user interface
that provides a seamless shopping journey for users who are passionate about sustainability.
1. HomeActivity
package com.sabari.myapplication
import android.content.Intent
import android.os.Bundle
import android.widget.Button
import androidx.appcompat.app.AppCompatActivity
33
}
}
2. ProductActitvity
package com.sabari.myapplication
import android.content.Intent
import android.os.Bundle
import android.util.Log
import android.view.Menu
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.appbar.MaterialToolbar
34
return when (item.itemId) {
R.id.action_cart -> {
Log.d("ProductActivity", "Cart icon clicked")
startActivity(Intent(this, CartActivity::class.java)) // Navigate to
CartActivity
true
}
else -> super.onOptionsItemSelected(item)
}
}
}
Unit testing was conducted on critical components of the Eco-Cart system to ensure each
module functions as expected in isolation. The primary areas tested include:
1. Cart Management Module: Functions such as adding items to the cart, updating
quantities, removing products, and calculating the total price were tested to validate
accuracy in price computation and item tracking.
2. Input Validation: Tests were written for checking valid and invalid inputs in name
and phone fields during checkout. This ensures that only proper 10-digit phone
numbers are accepted and that the name contains only alphabetic characters.
3. Shared Preferences Logic: Cart data is saved and loaded from local storage using
shared preferences. Unit tests validated that the saveCart(), loadCart(), and clearCart()
functions behave consistently.
4. Product Selection and Display: Unit testing ensured that selecting a product
correctly updates the UI and the corresponding information is reflected in the cart.
Test Case
Test Description Expected Result Status
ID
Open app and view product
TC-01 Product list loads correctly Pass
list
TC-02 Add a product to cart Product appears in cart Pass
TC-03 Remove product from cart Product removed from cart Pass
TC-04 Cart total updates correctly Total price reflects changes Pass
TC-05 Restart app and open cart Cart items are restored (persistent) Pass
35
Test Case
Test Description Expected Result Status
ID
Tap Checkout and view
TC-06 Shows QR and Cash payment options Pass
options
TC-07 Tap QR option QR code image displays in dialog Pass
Shows "Cash Payment Confirmed"
TC-08 Tap Cash option Pass
message
These unit tests ensured that the app’s functionality was accurate, reliable, and predictable
across all user actions.
Integration testing ensured that all modules in the Eco-Cart app work cohesively:
1. Product to Cart Integration: The flow from browsing a product to adding it into the
cart was tested to ensure data persistence and visual confirmation through snack bars.
2. Cart to Checkout Integration: Ensured that items in the cart are passed correctly to
the checkout module, including price, quantity, and item details.
3. Validation to Confirmation: Upon entering user details and selecting a payment
method, the data flow into the confirmation dialog was verified for consistency.
4. QR Code Payment Simulation: The integration of the QR image and user
confirmation ("Payment Done") flow was tested to ensure that order completion is
correctly triggered.
5. COD Confirmation Flow: The COD process was tested to confirm that selecting the
option leads directly to order confirmation without any QR interaction.
These tests confirmed smooth transitions and accurate data passing between the components.
By simulating realistic user behaviour, bugs and errors in workflow logic were identified and
resolved before deployment.
Testing:-
1. Validator.java
package CEP;
public class Validator {
public static boolean isValidName(String name) {
if (name == null || name.isEmpty()) {
36
return false;
}
return name.matches("[a-zA-Z ]{2,50}");
}
public static boolean isValidPhoneNumber(String phone) {
if (phone == null || phone.isEmpty()) {
return false;
}
return phone.matches("[0-9]{10}");
}
}
2. ValidatorTest.java
package CEP;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertFalse;
import org.junit.Test;
public class CheckoutTest {
@Test
public void testValidNameAndPhone() {
Checkout checkout = new Checkout("John Doe", "1234567890", "123 Street");
assertTrue(checkout.isValidDetails());
}
@Test
public void testInvalidName() {
Checkout checkout = new Checkout("John@", "1234567890", "123 Street");
assertFalse(checkout.isValidDetails());
}
@Test
37
public void testInvalidPhoneNumber() {
Checkout checkout = new Checkout("John Doe", "12345678", "123 Street");
assertFalse(checkout.isValidDetails());
}
@Test
public void testEmptyName() {
Checkout checkout = new Checkout("", "1234567890", "123 Street");
assertFalse(checkout.isValidDetails());
}
@Test
public void testEmptyPhone() {
Checkout checkout = new Checkout("John Doe", "", "123 Street");
assertFalse(checkout.isValidDetails());
}
@Test
public void testSpecialCharactersInName() {
Checkout = new Checkout("John @ Doe", "1234567890", "123 Street");
assertFalse(checkout.isValidDetails());
}
@Test
public void testPhoneWithAlphabets() {
Checkout checkout = new Checkout("John Doe", "12345abc90", "123 Street");
assertFalse(checkout.isValidDetails());
}
}
38
Output:
39
Chapter 5: Results and Discussion
5.1 Results
This chapter presents the results achieved through the development and testing of the Eco-
Cart application, an efficient eco-friendly shopping cart app built using Android Studio
with Kotlin. The app was tested extensively to evaluate its usability, functionality, and
overall user experience. The following observations and results summarize the outcomes of
the project.
1. Functional Results
The core features of the Eco-Cart application were designed to provide a smooth and
responsive offline shopping experience. The key results are as follows:
1. Product Catalog:
o The application successfully displays a list of eco-friendly products. Each
product includes a name, image, and price.
2. Cart Management:
o Users were able to add or remove products from the shopping cart. Product
quantities updated dynamically, and the total price was recalculated in real
time.
3. Checkout Functionality:
o Upon proceeding to checkout, the user was prompted to enter their name,
phone number, and address. Input validation ensured that only correct and
complete values were accepted, preventing incomplete or erroneous
submissions.
4. Payment Options:
o The app successfully provided two payment options: QR Code payment and
Cash on Delivery (COD).
The QR code payment option generated a static QR code image, which
could be scanned by UPI-compatible apps (such as Google Pay or
PhonePe) to complete the payment.
The COD option allowed users to choose Cash on Delivery and
proceed to the confirmation screen.
5. Local Data Handling:
o The cart data was handled using the SharedPreferences plugin, ensuring that
the cart items persisted across app restarts. Users were able to restart the app,
and the cart items remained intact without requiring an internet connection or
a database.
1. The app featured a green and white UI theme, reinforcing the brand's eco-conscious
message.
2. All screens (Home, Products, Cart, Checkout) maintained a clean layout with intuitive
navigation.
3. Users found the "Start Shopping", "Add to Cart", and "Checkout" interactions smooth
and clear.
40
4. The QR code simulation and confirmation screens guided the user properly, even in
the absence of real-time payment processing.
1. Responsiveness: Product images and data loaded quickly with minimal delay.
2. Offline Performance: The app worked completely offline once launched, as it does
not rely on external databases or APIs.
3. Storage: Cart data was stored locally and reliably retrieved even after app restarts.
4. Testing Results
1. The Eco-Cart application underwent a comprehensive testing process to ensure its
functionality, integration, and user experience were up to standard.
2. Responsiveness: The app performs well with fast product loading and minimal delays.
3. Offline Performance: The app operates completely offline, ensuring full functionality
without internet connectivity.
4. Storage: Local storage is reliable, allowing cart data to persist even after app restarts.
5. Testing: Comprehensive testing confirmed that core features such as cart
management, checkout, and input validation functioned as expected. Integration and
user testing further validated the app’s smooth operation and user-friendly experience.
Simplicity: The app was intuitive and easy to navigate for users with no technical
background.
Enhancements: Adding a "Save for Later" feature could improve engagement.
Screen Size Scalability: The app worked well on both phones and tablets, but could
benefit from tablet-specific optimizations.
41
3. System Performance and Scalability
1. System Performance
Smooth Operation: The app ran smoothly without delays or crashes due to the
absence of a backend.
Performance Considerations: As the product list grows, performance can be
optimized using pagination or lazy loading to improve loading times.
2. Scalability
Cloud Integration: In the future, integrating cloud services like Firestore would
allow saving orders and tracking users while maintaining offline functionality.
42
Chapter 6: Conclusion and Future Work
6.1 Conclusion
By prioritizing clean UI/UX design, efficient local storage via shared preferences. The
decision to eliminate backend dependencies or complex authentication processes makes the
app ideal for users with limited connectivity or technical experience.
The key success of this project lies in its simplicity, offline-first approach, and ease of use,
demonstrating that an eco-friendly shopping experience can be delivered even without a full
backend system. All core functionalities such as product listing, cart updates, and checkout
were tested and performed as expected, validating the app's effectiveness in providing a
complete and satisfying shopping experience.
3. User Accounts:
o Add an optional login/registration feature to allow users to save favorites,
view past orders, and track deliveries.
4. Multi-language Support:
43
o Implement support for regional languages (e.g., Hindi, Tamil) to increase
accessibility for a broader audience.
5. Order Tracking:
o Provide a visual order tracker (e.g., Order Placed → Processing → Out for
Delivery) to update users about their order status.
8. Admin Panel:
o Develop a separate admin panel (either web or mobile) to manage products,
view orders, and update product availability.
9. Add-to-Favourites or Wishlist:
o Allow users to save products for future purchases or comparisons by adding a
favourites/wishlist feature.
44
Chapter 7: References
1. Android Studio Documentation. (2023). Official Android Studio Documentation.
[Online] Available at: https://developer.android.com/studio
2. Kotlin Programming Language. (2023). Kotlin Documentation. [Online] Available
at: https://kotlinlang.org/docs/home.html
3. SharedPreferences in Android. (2023). Android SharedPreferences Documentation.
[Online] Available at:
https://developer.android.com/reference/android/content/SharedPreferences
4. Android Storage Solutions. (2023). Storing Data with SharedPreferences. [Online]
Available at: https://developer.android.com/training/data-storage/shared-preferences
5. Android Emulator Setup. (2023). Configuring Android Emulator in Android Studio.
[Online] Available at: https://developer.android.com/studio/run/emulator
6. https://developer.android.com/topic/libraries/architecture/viewmodel
7. Android UI Design. (2023). Building UIs with Views and ViewGroups in Android.
[Online] Available at: https://developer.android.com/guide/topics/ui
8. Gradle for Android. (2023). Gradle Build System for Android. [Online] Available at:
https://developer.android.com/studio/build
45