Mini Project 4 - MDB Inventory (Due 3/7 Thursday)
*Project created by Paul Shao
Introduction & Project Overview
Data storage forms one of the central blocks for the backend of a mobile application. In Mini Project 3, we’ve learned how to work with online data storage using Firebase realtime database and storage. However, there are times where we can just as conveniently store everything locally (for this app, we will be using sqlite
). This project is designed to give you the foundation of working with everything "off the cloud"
.
The goal of this application is to design and create an Inventory App for MDB that allows its members to keep track of its spending on food, socials, and retreats. The app will need to store information about the cost for each spending, a brief description of what was purchased, the name of the supplying merchant(s), and the date of the purchase. It will also have functionalities that allow MDB members to track and monitor the spending progress so they can make better planning in the future.
Project Structure
In order to guide you through this project, I’ve divided it into multiple parts. At the end of each part, you are supposed to have completed a functionality of the application. I will also provide recommended deadline for each part, although the amount of time allocated for each part is completely up to you.
To build this inventory app, let’s try to have a basic understanding of how data storage works locally:
The way local data storage works is quite similar to that with Firebase, you send out a request in the native application language (Java) in this case, the language gets interpreted by the helper library and transformed into the semantically equivalent SQL commands to query the local database. For some of the query you send out such as SELECT
in sqlite, your command will also trigger the database return a response, which gets translated back by the library to something that you can work with in the Android environment.
Here are the parts that guide you through the process of building this app:
Part A. Setting up
When the user first opens the application, they should be able to see a list of the most current purchases MDB has made. To accomplish this, think about the following questions:
- Should I create a custom class to handle each purchase?
- What library helps display a scrollable list of purchases?
- Using the Android SQLite library, how can I sort everything by the time of the purchase to ensure they are in order?
Part B. Data Handling
Now that I’m finished mostly with the frontend work of this application, time to tackle the backend part where I store, retrieve, and process all the purchase data! This part requires you to rely on the Android SQLite library documentation, so don’t hesitate to consult that as much as you can. Here are a few questions to get you started:
- What should the schema (the columns and types of values allowed in each for the table) of the database look like?
- How do I connect the scrollable list to the database that stores all my actual data?
- How do I implement the equivalent action of inserting a new record of purchase into the database?
- How do I implement the equivalent action of deleting a record of purchase within the database?
Part C. Search and User Preferences
Now that you’ve finished with the core functionalities, let’s add in a few more features that helps polish up the app even more. Here are the 2 features to add on top of the app:
- Add in a search bar in the main activity that allows users to search through the purchases by the short descriptions of the purhcase (It might be a good idea to refer to how you add the search functionality back in MP2)
- Every time after the user quits the app, we don’t really want them to remember what they last typed in to search for the purchase. Apply what you’ve learned about user shared preferences from the link below to add this functionality to the app so that when the user restarts the app, the search bar comes pre-filled with the last description they previously used to search.
Data Persistence Locally on the Phone Using SharedPreferences
Congratulations! You’ve finished Mini Project 4!
Project CheckList and Recommended Deadlines
This project, though similar to Mini Project 3 and 2 in many different ways, still involves some amount of work and understanding of how data storage works locally. You will spend a fair amount of time referencing the Android documentation and debugging your application.
It is important to note that error handling is also crucial in this application. Make sure to spend some time thinking about the following scenarios:
- What kind of invalid input could user possibly enter? How do we handle it?
- Instead of an empty screen, what is better to show the user if nothing is currently in the database?
Here’s the link to the official Android guide on how to save data using sqlite locally: How to Save Data Locally Using SQLite3 in Android
Here’s the checklist with the recommended deadlines:
- Part A - (3/3) Sunday
- Part B - (3/5) Tuesday
- Part C - (3/7) Thursday
Project Scoring Breakdown
Here is the basic scoring breakdown of the mini-project by parts:
Parts | Percentages |
---|---|
A | ~35% |
B | ~50% |
C | ~15% |
Final Thoughts
I know this might seem like a lot, but by this point, you should already have all the fundamental knowledge of app development to dive right into this. Remember, documentation is your best friend, and there is always help on Slack and OH! Best of luck 🐻
Submission:
Please use the following link (Google Form) to submit your project: MP4 Submission Form