Part 4: CRC Cards - CMPUT301W23T21/QR-Project GitHub Wiki

A high-level overview of the main classes and their responsibilities in the QR code hunting app using CRC cards.

LandingPageActivity

Responsibilities Collaborators
Allows user/player to sign up to create a new account LeaderboardActivity
Connects with the FireBase FireStore to store the data QRCodeActivity
Views the first page of the app to the user SignUpActivity
Hash
FireStore

LeaderboardActivity

Responsibilities Collaborators
Displays the leaderboard with scores UserProfileActivity
Connects with the FireBase FireStore to store the data QRCodeActivity
Displays the user's friends' scores SignUpActivity
Hash
FireStore
Player

QRCodeActivity

Responsibilities Collaborators
Scans and recognises QR codes and barcodes LandingPageActivity
Hashes the scanned code and score it based on a scoring system LeaderboardActivity
Takes a photo of the scanned object Map
Records geolocation of the scanned code UserHomeActivity
Adds the score and the hash of the scanned code to the player's account UserProfileActivity
ScanActivity
Player
QR_Code

PictureActivity

Responsibilities Collaborators
Contains a Hash object, photo with geolocation, and name of the QRCode Hash
Takes photo FireStore
Asks for permission before taking photo QRCodeActivity
UserHomeActivity
LeaderboardAcitvity
UserManager
UtilityFunctions

ScanActivity

Responsibilities Collaborators
Scans and recognises QR codes and barcodes LandingPageActivity
Hashes the scanned code and score it based on a scoring system LeaderboardActivity
Takes a photo of the scanned object Map
Records geolocation of the scanned code UserHomeActivity
Adds the score and the hash of the scanned code to the player's account UserProfileActivity
Add the data and details to the firebasefirestore collection ScanActivity
Player
QR_Code
FirebaseFireStore

SignUpActivity

Responsibilities Collaborators
Allows user to sign up LandingPageActivity
Getting the information of the user LeaderboardActivity
Storing the user's information to FirestoreFirebase Map
Remember the user, so that the user does not have to log in again UserHomeActivity
Getting the information such as username, userPhoneNumber, userEmail UserProfileActivity
Add the data and details to the firebasefirestore collection ScanActivity
Player
QR_Code
FirebaseFireStore

MapActivity

Responsibilities Collaborators
Show the location of the scanned QR codes on a map Player
Show other players' activity, including their scanned QR codes and photos QR_Code
Allow players to search for QR codes in a certain region Hash
Ask for permission before accessing the exact location FirestoreDBHelper
Getting the address through the longitude and latitude

UserHomeActivity

Responsibilities Collaborators
Show the location of the scanned QR codes on a map Player
Show other players' activity, including their scanned QR codes and photos QR_Code
Allow players to search for QR codes in a certain region Hash
Ask for permission before accessing the exact location FirebaseFirestore
Getting the address through the longitude and latitude MapActivity
Set the preference for the permission about the geolocation, take photo LeaderboardActivity
Perform command FaceActivity
UserManager

UserProfileActivity

Responsibilities Collaborators
Show user's profile Player
Show user's total score QR_Code
Show user's ranking and the leaderboard Hash
Search query FirebaseFirestore
See scanned QRCodes LeaderboardActivity
UserSearchActivity
FaceActivity

UserSearchActivity

Responsibilities Collaborators
Search for friends Player
Search for QRCodes QR_Code
Query Hash
Search query FirestoreDBHelper
LeaderboardActivity
UserSearchActivity
FaceActivity
Friend
Player
LeaderboardManager

QRCodeManger

Responsibilities Collaborators
Scans and recognises QR codes and barcodes LandingPageActivity
Hashes the scanned code and score it based on a scoring system LeaderboardActivity
Takes a photo of the scanned object Map
Records geolocation of the scanned code UserHomeActivity
Adds the score and the hash of the scanned code to the player's account UserProfileActivity
ScanActivity
Player
QR_Code
QR_Adapter

QR_Code

Responsibilities Collaborators
Contains a Hash object, photo with geolocation, and name of the QRCode Hash
Creates a map of key values of attributes to be used by DB FireStore
Gets photo of the QR_Code and geolocation QRCodeActivity
UserHomeActivity
LeaderboardAcitvity

Hash

Responsibilities Collaborators
Contains hashed string QRCode
Calculates score from hashed string
Generates names from hashed string

Photo

Responsibilities Collaborators
Stores geolocation of the QR Code internally QRCode
Shows the whereabouts of the QR Code Scanner

Comment

Responsibilities Collaborators
Comment on the scanned qrcodes QRCode
The ability to comment CommentAdapter

CommentAdapter

Responsibilities Collaborators
Give the ability and function to comment QRCode
Comment

LeaderboardManager

Responsibilities Collaborators
Show the ranking of top 3 FirestoreDBHelper
LeaderboardAcitivity

UserManager

|Control and perform the whole task on the user's end| UtilityFunctions| |Sign up on the app| UserHomeActivity| |Add friends|UserProfileActivity| |Take photo|Comment| |Scan QRCodes|Comment_Adapter| |Add comment|| |Remove QRCodes||

Player

PlayerAccount

Responsibilities Collaborators
Store player's information, including the total score, scanned QR codes, and photos locally QRCodeScanner
Adds new QRCodes to its collection Map
Deletes QRCodes from its collection FireStore
Provide a summary of the player's activity, including the highest-scoring QR codes, the number of QR codes, and the total score

FirestoreDBHelper

Responsibilities Collaborators
Store player's information, including the total score, scanned QR codes, and photos QRCodeActivity
Adds the new personal file(s) and QR codes to the database when being added Map
Removes the QR codes from the database when being removed by the user Player
Store the hash of the scanned QR codes to avoid duplicates LandingPageActivity
Provide a summary of the player's activity, including the highest-scoring QR codes, the number of QR codes, and the total score LeaderboardActivity
UserHomeActivity
UserProfileActivity
DatabaseHelper
DatabaseResultCallback