Local Shop Ecommerce Application - Technical Report
- April Hussey

- Jun 1, 2023
- 2 min read
Account Usernames and Passwords
Email Address | Password | First Name | Last Name |
admin@email.com | account | Admin | Account |
user@email.com | account | User | Account |
Features Implemented
Feature | Implemented (Partial / Full) | Comments |
Users | ||
Register a new account | Full | |
Login to the application | Full | |
Logout of the application | Full | |
View all categories | Full | |
Add a product to their basket | Full | |
Create an order | Full | |
View all previous orders | Full | |
Admins | ||
Create a new product/category | Partial | New items created by admin will not be added to database because the item id is not unique |
Products | ||
Are assigned to categories | Full | |
Have a name | Full | |
Have an image | Full | |
Have a description | Full | |
Have a price | Full | |
Have multiple versions | Full | |
Can be shown as in stock | Full | |
Can be shown as out of stock | Full | |
Additional Features | ||
Admin can view all orders | Full |
Design Implementation
Creating Login Functionality
Initially, I created a public method inside of the ‘MainActivity’ class that sets the value of the boolean variable ‘loggedIn’. Then I would call that method from the ‘LoginActivity; class to change the value of ‘loggedIn’. However, this did not function as I had expected. The ‘LoginActivity’ would refresh when the ‘login’ button was pressed despite a correct email and password being entered.
MainActivity:
LoginActivity:
Recognising the fundamental flaws of my original plan to track if a user is logged in, I decided to change tactics and use a shared preference instead. I created a new class called ‘LoginUtils’; this class contains the setter and getter for the login status. I added the necessary lines of code in the ‘MainActivity’ class and ‘LoginActivity’ class for this to function correctly.
A benefit of using shared preferences is that even after closing the application the user will still be registered as logged in.
LoginUtils:
MainActivity:
LoginActivity:
Class Diagram
Screenshots of System showing Key Features
Testing
Description | Expected Outcome | Actual Outcome | Result |
Login Activity | |||
User presses ‘login’ button with a correct email and password Note: Empty email address and password is considered a correct email and password for this test | User will be taken to the home page | Login page refreshes | FAIL |
User presses ‘login’ button with a correct email and password Note: Empty email address and password is considered a correct email and password for this test | User will be taken to the home page | User was taken to the home page
| PASS |
User presses ‘login’ button with email and password exists in the database | Database will check if a user with that email exists in the database and return true. Database will check if that email has a password that matches the entered password and return true. User will be taken to the home page | Database checks if a user with that email exists in the database returning true. Database checks if that email has a password that matches the entered password returning true. User is taken to the home page | PASS |
User presses ‘login’ button with email that exists in the database and a password that doesn’t match | Database will check if a user with that email exists in the database and return true. Database will check if that email has a password that matches the entered password and return false. A text view will display ‘incorrect credentials. User will stay on the login page | Database checks if a user with that email exists in the database returning true. Database checks if that email has a password that matches the entered password returning false. A text view displays ‘incorrect credentials. User stays on the login page | PASS |
User presses ‘login’ button with email that doesn’t exist in the database | Database will check if a user with that email exists in the database and return false. A text view will display ‘account doesn’t exist’. User will stay on the login page | Database checks if a user with that email exists in the database returning false. A text view displays ‘account doesn’t exist’. User stays on the login page | PASS |
User presses the ‘click here to register’ button | User will be taken to the register page | Nothing happens. User stays on the login page | FAIL |
User presses the ‘click here to register’ button | User will be taken to the register page | User is taken to the register page | PASS |
Register Activity | |||
User presses the ‘register’ button where none of the data is filled | A text view will display ‘all fields are required’. User will stay on the register page | A text view doesn’t display ‘all fields required’. User stays on the register page | FAIL |
User presses the ‘register’ button where none of the data is filled | A text view will display ‘all fields are required’. User will stay on the register page | A text view displays ‘all fields required’. User stays on the register page | PASS |
User presses the ‘register’ button where the email entered already exists in the database and the other data is filled | A text view will display ‘account already exists’. User will stay on the register page | A text view displays ‘account already exists’. User stays on the register page | PASS |
User presses the ‘register’ button where the email entered is not in the database and the other data is filled | User will successfully register - the user data will be added to the database. User will be taken to the home page | User successfully registered – the data is added to the database. User is taken to the home page | PASS |
Main Activity | |||
User presses ‘shop’ navigation button | User will be taken to the categories page | User is taken to the categories page | PASS |
User presses ‘basket’ navigation button | User will be taken to the basket page | User is taken to the basket page | PASS |
User presses ‘account’ navigation button | User will be taken to the account page | User is taken to the account page | |
User presses ‘home’ navigation button | User will be taken to the home page | User is taken to the home page | PASS |
Categories Fragment | |||
User presses ‘singles’ category button | User will be taken to shop fragment that shows all the items that are in the singles category | User is taken to shop fragment that shows all the items that are in the singles category | PASS |
User presses ‘booster boxes’ category button | User will be taken to shop fragment that shows all the items that are in the booster boxes category | User is taken to shop fragment that shows all the items that are in the booster boxes category | PASS |
User presses the ‘boosters’ category button | User will be taken to shop fragment that shows all the items that are in the boosters category | User is taken to shop fragment that shows all the items that are in the boosters- category | PASS |
Shop Fragement | |||
User presses an item card | User will be taken to the item page fragment displaying the data of the item card the user pressed | User is taken to the item page fragment displaying the data of the item card the user pressed | PASS |
Item Page Fragment | |||
User presses ‘add to basket’ button | The item shown on the item page will be added to the user’s basket | The item shown on the item page is added to the user’s basket | PASS |
Basket Fragment | |||
User presses ‘checkout’ button with an empty/less than 10 characters in the address field | A toast will display ‘address has to be more than 10 characters’ | A toast will display ‘address has to be more than 10 characters’ | PASS |
User presses ‘checkout’ button with the address field filled with 10 or more characters | The item(s) in the basket will be added to the database and the order will be viewable on the account page | The item(s) in the basket are added to the database and the order is viewable on the account page | PASS |
Account Fragment | |||
User presses ‘account’ navigation button | User will be taken to the account page where they can view all their orders | User is taken to the account page and can view all their orders | PASS |
Bug List
I do not consider the following a true error as the code works as expected and does not error when run: cursor.getColumnIndex() has a red line under it:Example: DatabaseConnect in function passwordCheck()
New items created by admin will not be added to database because the item id is not unique
Cannot add new item from the floating button on the categories fragment
Changing the spinner on an item does not update the price or image of the item
Attributions
Cart Remove: https://pictogrammers.com/contributor/Simran-B/
Cart Plus, Cart outline, store outline, plus, and home outline: https://pictogrammers.com/contributor/google/
Account cog outline: https://pictogrammers.com/contributor/mririgoyen/
Magic the Gathering merchandising images: Owned by Wizards of the Coast / Hasbro














Comments