https://github.com/zurichblade/groceryapp
GroceryApp: Efficiently managed with SQLiteDatabase, featuring a structured codebase and extensive module and table integration
https://github.com/zurichblade/groceryapp
best-practices grocery-store material-design sqllite-database
Last synced: over 1 year ago
JSON representation
GroceryApp: Efficiently managed with SQLiteDatabase, featuring a structured codebase and extensive module and table integration
- Host: GitHub
- URL: https://github.com/zurichblade/groceryapp
- Owner: ZurichBlade
- Created: 2023-08-04T18:17:20.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-06-15T09:27:56.000Z (almost 2 years ago)
- Last Synced: 2025-01-05T15:48:59.017Z (over 1 year ago)
- Topics: best-practices, grocery-store, material-design, sqllite-database
- Language: Java
- Homepage:
- Size: 325 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Grocery App
The Grocery app is a user-friendly solution showcasing seamless integration of SQLite database management, RecyclerView implementation, Material Design principles, and query functionalities.
## Screenshots

## Features
- SQLite Database Integration: Utilizes SQLite with tables for User, Stock, Sales, and Purchase, demonstrating efficient data management and integrity.
- Material Design Principles: Follows Material Design guidelines for a visually appealing and intuitive user experience.
- Home Page: Displays user info and provides a navigation drawer for Add Stock, Sales, Purchase, Search Stock, and List Stock.
- Add Stock: Enables quick addition of items with validation for Name, Quantity, Price, and Returnable status.
- Sales: Facilitates transactions with real-time inventory updates.
- Purchase: Supports restocking with automatic stock level adjustments.
- Search Stock: Allows quick lookup of items by Item Code with detailed item views.
## Query Usage/Examples
Method to create a table
```bash
String CREATE_TABLE_QUERY = "CREATE TABLE " + TABLE_USER + " (" +
COL_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
COL_USERNAME + " TEXT, " +
COL_EMAIL + " TEXT, " +
COL_PASSWORD + " TEXT);";
sqLiteDatabase.execSQL(CREATE_TABLE_QUERY);
```
Method to insert data into the table
```bash
public long insertStockItem(String itemName, int qtyStock, int price, boolean returnable) {
this.sqLiteDatabase = getWritableDatabase();
ContentValues values = new ContentValues();
values.put(COLUMN_ITEM_NAME, itemName);
values.put(COLUMN_QTY_STOCK, qtyStock);
values.put(COLUMN_PRICE, price);
values.put(COLUMN_RETURNABLE, returnable ? 1 : 0); // Convert boolean to integer (1 for true, 0 for false)
long newRowId = sqLiteDatabase.insert(TABLE_STOCK, null, values);
sqLiteDatabase.close();
return newRowId;
}
```
## Note
This project is developed specifically for practicing SQLite database management, offering a hands-on approach to learning and implementing database workflows in Android applications.