A grocery shopping Android app with budget tracking, a side menu, an admin panel, barcode scanning, voice add, and a "pantry" feature that stops you re-buying what you already have. Built in Android Studio with Java and Material 3.
Author: Gaurav Singh Thakur Course: CPS 592 — Creative Mobile Apps, University of Dayton Instructor: Dr. Norman Bashias
Package: com.gauravsingh.smartcart · Min SDK 26 · Target SDK 34 · Java 17
Two to three-minute walkthrough of the app in action:
(If the file isn't there yet, see demo/README.md for
how to record it in Android Studio.)
Drop your captures into the screenshots/ folder — they'll
render here when you add them.
- Open Android Studio (Hedgehog 2023.1.1 or newer).
File → Open…→ pick thisSmartCart_Finalfolder.- Let Gradle sync on first open. If it asks to download the Gradle wrapper, let it.
- Start an emulator (Pixel 6 with API 34 works) or plug in an Android phone with USB debugging on.
- Hit Run ▶.
If you see "No target device found", the emulator hasn't started — open Tools → Device Manager, play the device, wait for boot, Run again.
- Sign in / Sign up / Continue as guest, with persistent login and a dark navy-to-teal hero gradient on the auth screens.
- Home dashboard with a side menu (swipe from left or tap the hamburger): profile, addresses, payment cards, my lists, pantry, orders, theme toggle, scan, logout.
- Search that live-filters as you type across all ~210 products.
- Category grid — two-column cards with image on top, name + price below, and a quick Add button (Zepto / Blinkit style).
- Cart with +/- quantity, running total and a budget progress bar that flips red when you overshoot.
- Checkout form with guest-signin fallback.
- Order history saved locally.
- My Lists — create custom grocery lists with per-list budgets, check items off, share the list, push all items into the cart.
- Profile — edit name, email, phone, and your monthly budget.
- Addresses — multiple saved addresses with a default flag.
- Payment cards — saved cards render as a 3D gradient card with a light orb and masked number.
- My Pantry — mark things you already have at home. When you try to add them to cart, SmartCart warns you so you don't double-buy.
- Barcode scanner using Google ML Kit on-device. Two demo barcodes
are pre-wired:
0123456789012(Rice) and0987654321098(Milk). Admins can attach barcodes to their custom products too. - Voice add — tap the mic FAB, or simply shake the phone on the home / category / search screens — SmartCart opens speech recognition and matches what you say to a product.
- Dark mode toggle, saved across launches.
- Share list / share cart via system share sheet.
- Admin mode — the username
adminunlocks Add / Delete buttons for categories and products. Built-in seed products and categories are read-only; only items you created can be deleted.
There is no default admin account. On first run:
- Sign up with username
adminand any password you want. - Log in with that account.
- An orange "Admin mode" chip appears on the dashboard and drawer header.
- A
+FAB appears on the Categories screen and inside each category.
- Layered gradient backgrounds (no plain green / white).
- Drawer header uses the same hero gradient as the welcome screen for continuity.
- Every category has its own gradient colour which is used on the chip, the category tile and the product thumbnail.
- Cards are 20 dp rounded with a soft elevation shadow and a sheen overlay on the product hero for a glass / 3D feel.
- Payment cards have their own 3D-style gradient (navy → purple → pink) with a light orb in the corner.
SmartCart_Final/
├── LICENSE
├── README.md
├── demo/ video goes here
├── screenshots/ PNG captures go here
├── build.gradle, settings.gradle, gradle.properties, .gitignore
├── gradle/wrapper/gradle-wrapper.properties
└── app/
├── build.gradle, proguard-rules.pro
└── src/main/
├── AndroidManifest.xml
├── java/com/gauravsingh/smartcart/
│ ├── SmartCartApp.java Application, applies night mode
│ ├── MainActivity.java Welcome
│ ├── LoginActivity.java / SignupActivity.java
│ ├── DashboardActivity.java Home + drawer
│ ├── SearchActivity.java
│ ├── CategoriesActivity.java
│ ├── CategoryItemsActivity.java 2-col product grid
│ ├── MyListsActivity.java / ListDetailActivity.java
│ ├── CartActivity.java / CheckoutActivity.java
│ ├── OrderHistoryActivity.java
│ ├── BarcodeScannerActivity.java
│ ├── ProfileActivity.java
│ ├── AddressesActivity.java
│ ├── PaymentCardsActivity.java
│ ├── PantryActivity.java
│ ├── adapter/ RecyclerView adapters
│ ├── data/ Room entities + DAOs
│ ├── model/ Product POJO
│ └── util/ SessionManager, ThemeManager, PriceUtil,
│ PasswordUtil, ProductCatalog, CatalogRepo,
│ CategoryVisuals, CartFabBinder,
│ ShakeDetector, VoiceAddHelper
└── res/
├── layout/ all activity / item / dialog layouts
├── menu/ toolbar + drawer menus
├── drawable/ vector icons, gradient backgrounds,
│ category thumb tiles, payment card
├── drawable-night/ dark-mode gradient backgrounds
├── values/ colors, strings, themes, dimens
├── values-night/ dark theme override
└── mipmap-anydpi-v26/ launcher icons
| You want to change… | Open… |
|---|---|
| A product or category | util/ProductCatalog.java |
| A category colour / icon | util/CategoryVisuals.java, drawable/bg_thumb_*.xml, drawable/ic_cat_*.xml |
| A screen's background | drawable/bg_*.xml and drawable-night/bg_*.xml |
| Any user-facing text | res/values/strings.xml |
| Side menu entries | res/menu/drawer_menu.xml |
| The home screen layout | res/layout/activity_dashboard.xml + DashboardActivity.java |
| The product card | res/layout/item_product_grid.xml |
| The database schema | data/*.java + bump @Database(version=…) in AppDatabase.java |
- Java 17, Android Gradle Plugin 8.2.2, Gradle 8.4.
- Material 3 with
DayNighttheme,values-night/for dark, custom gradient drawables for depth. - Room 2.6.1 with 10 entities (User, GroceryList, ListItem, CartItem, Order, CustomCategory, CustomProduct, Address, PaymentCard, PantryItem).
- CameraX 1.3.1 + ML Kit Barcode Scanning 17.2.0 for on-device scanning.
- Android SpeechRecognizer via
RecognizerIntentfor voice add. - SensorManager accelerometer for shake-to-voice.
- Passwords are stored hashed (SHA-256) via
util/PasswordUtil.java. - Room runs on the main thread via
allowMainThreadQueries()— fine for a student project; move to background threads for production. - The barcode scanner needs a camera. On an emulator, use Extended controls → Camera → Virtual scene and point it at a printed code.
- Shake detection uses the accelerometer — works on real phones, less reliable on emulators (use Extended controls → Virtual sensors to simulate if needed).
MIT © 2025 Gaurav Singh Thakur.
Written by Gaurav Singh Thakur for CPS 592 at the University of Dayton. Dedicated to everyone who keeps forgetting milk at the store.