Contributor | Role |
---|---|
Nia Doumbalska | Senior System Analyst |
Tina Hsieh | Business Analyst |
Alvin Li | Software Architect |
Hao Luo | Software Development Lead |
Dorian Maldonado | User Interface Specialist |
Iris Nayki | Project Manager |
Shayan Raisi | Quality Assurance Lead |
Chase Sriprajittichai | Algorithm Specialist |
Ethan Yuan | Database Specialist |
Cassie Yu | Software Development Lead |
UCSD students can forgo the unknowns of randomly assigned roommates and difficult to navigate websites and take matters into their own hands with rüm8: an android app for UCSD students to find the perfect roommate. Users are guided in the profile setup process to make sure vital information is provided, and a series of lifestyle and preference questions are asked in order to only show users compatible potential roommates. When browsing through profiles, users can "link" with a user if they like their profile. If there is a mutual "link," then rüm8 sends a notification to both users (if they are logged in). From there, users can view all their mutual links in their "link list" as well as review their profile again and view previously hidden contact information. Using rüm8, students can find and reach out to their ideal roommate and make their housing experience the best it can be.
Email: [email protected]
Password: cse110isgr8
A Pixel 2 or 3 emulator or hardware Pixel 2 or 3 device running at an API level of 26 or higher.
- Clone this repository.
- Run a Pixel 2 or 3 emulator or connect a hardware Pixel 2 or 3 device.
- Navigate to the top-level directory of the cloned repository.
- Install the app on the emulator or device using ADB:
adb install app-debug.apk
.
Launch the app and log in using a registered UCSD email account and password.
In this poject, we followed the Model View Controller design pattern to enforce modular code that is maintainable and readable. For each activity in our app, the acitivity itself represents the view and we defined a controller for each activity to handle the logic and serves as the communicator between each activity and the database model. By follwing this pattern of putting all the logic of an app page in a controller, we can separate the user interface implementation and the logic. If all the logic code is in the controller, then we can easily test the controller.
This is an example of LoginActivity View, having no logic, that passes informations to the controller so that it can make decisions.
buttonLogin = findViewById(R.id.button_login);
buttonLogin.setOnClickListener(v -> {
final String email = emailField.getText().toString();
final String pw = passwordField.getText().toString();
controller.onSubmit(email, pw);
});
In this code snipet of LoginController, LoginActivity simply passes actions onto the controller so that it can handle them. As you can see, when the login button is pressed, controller will validate user input and make decision of what to do next for a successful login.
public void onSubmit(final String email, final String password) {
if (!isValidEmail(email)) {
final String message = "Please use your UCSD email (i.e. [email protected])";
controllerListener.showToast(message);
} else if (!isValidPassword(password)) {
final String message = "Your password need to be more than 6 characters";
controllerListener.showToast(message);
} else {
auth.signInWithEmailAndPassword(email, password)
.addOnSuccessListener(authResult -> {
if (auth.getCurrentUser().isEmailVerified()) {
Log.d("Success", "signInWithEmail:success");
onLoginSuccessful();
} else {
final String message = "Please verify your email!";
controllerListener.showToast(message);
}
})
.addOnFailureListener(e -> {
final String message;
if (e instanceof FirebaseAuthInvalidUserException) {
message = "Account does not exist";
} else if (e instanceof FirebaseAuthInvalidCredentialsException) {
message = "Incorrect password";
} else {
message = "Network error";
}
Log.d("Error", "signInWithEmail:failure", e);
controllerListener.showToast(message);
});
}
}
- User can only change their picture ("choose image") once per visit to the settings page. Subsequent attempts to change their picture will not update the image displayed.
- Workaround: leave the settings page and reopen it if you want to choose an image more than once.
- Never create a branch off of
dev
!
Never mergedev
into any branch!dev
contains many changes that, in nearly all cases, do not belong on any other branch.
- Create small and specific branches.
- Constantly pull your branch's base branch to stay up to date with other people's changes.
- You can do this by:
- Checking out your branch's base branch:
git checkout [your branch's base branch]
- Pulling any new changes from the remote:
git pull
- Returning to your branch (checkout your branch again):
git checkout [your branch]
- Merging your branch's base branch into your branch:
git merge [your branch's base branch]
- Checking out your branch's base branch:
- You can do this by:
- Test your code on the
dev
branch before creating a pull request to merge your code into your branch's base branch.dev
will constantly be pulling frommaster
, so testing your code ondev
should prevent bugs from getting onmaster
.- Once you have tested your code on the
dev
branch, create a pull request (PR) to merge your branch into its base branch.- Who and how many people you send it to should depend on the significance of your code.
- Write a short (1-4 sentences) description of your PR.
- You can send your PRs to other people through Slack.
- What is a branch in git?
- A branch is like a copy of the repository from a specific moment in time (a specific commit).
- Learn more: https://git-scm.com/book/en/v1/Git-Branching-What-a-Branch-Is
- What is the purpose of a branch?
- Branches make collaboration organized and simple. By using branches, multiple people can work independently on related code.
- Branches allow us to easily keep track of changes that we make.
- When should I create a branch?
- Create a branch for any change that you want to make.
- Create branches that will have a short lifespan that are used for a single particular feature or specific focus.
- Small and specific branches are much easier to maintain, easier to merge, and easier to review.
- Learn more: https://git-scm.com/book/en/v2/Git-Branching-Branching-Workflows
- Read the "Topic Branches" section.
- You want to make a change to the codebase.
- Decide which branch you want to contribute to. This branch is going to be the base branch of the branch that you are about to create.
- The base branch is the branch that you want to create your branch off of.
- The base branch is the branch that you will later merge (or create a PR to merge) your branch into.
- If the code you are writing is only dependent on the code in
master
, thenmaster
is your base branch. Otherwise, if the code you are writing is dependent on code that is not inmaster
, then your branch's base branch is going to be the branch that contains the code that your branch depends on. dev
should never be your base branch.dev
contains many changes that, in nearly all cases, do not belong on any other branch.
- Create a new branch off of the base branch.
- Make changes to your branch.
- Finish making changes to your branch.
- If possible, merge your branch into
dev
and ensure that everything works.- You do not need to create a PR to do this.
- If you run into merge conflicts, carefully resolve them. If you are unsure how to resolve them, ask someone else for help. Do not resolve merge conflicts if you do not understand how to resolve merge conflicts or if you do not understand the code that you are deleting.
- Merge your branch into your branch's base branch.
- Depending on what your branch's base branch is, you may or may not need to create a PR to merge your branch into its base branch.
- If you want to merge your branch into
master
, you must create a PR to do this.
- If you want to merge your branch into
- Make sure that you merge your branch into its base branch:
- Merge <your branch> into <your branch's base branch>
Merge <your branch> → <your branch's base branch>
- Merge <your branch> into <your branch's base branch>
- Depending on what your branch's base branch is, you may or may not need to create a PR to merge your branch into its base branch.
- Your branch has served its purpose and it has been merged into another branch. Your branch should not be used anymore.
- To enforce this, after branches are merged, they are deleted from the remote repository.
- What is a controller?
- A controller controls all the logic of a single page in the app.
- Each
Activity
is controlled by one controller.- I.e.
RegistrationActivity
is controlled byRegistrationController
.
- I.e.
- Each
- A controller has one or multiple listeners (interface) that are listening to the actions of the controller. When the controller does something, it notifies its listeners so that they can respond accordingly.
- I.e.
RegistrationController
has aRegistrationControllerListener
that it notifies when it does something.RegistrationActivity implements RegistrationControllerListener
so that it will be notified when the controller does something.
- I.e.
- A controller controls all the logic of a single page in the app.
- What's the point?
- If we follow this pattern of putting all the logic of a app page in a controller, then we can separate the UI code and the logic (code).
- If all the logic code is in the controller, then we can easily test the controller.
- This will make our code modular, testable, and maintainable.
- Look at
RegistrationActivity
,RegistrationController
, andRegistrationControllerListener
to see an example of this. - Talk to Chase about this if you'd like more explanation or a better understanding.
Command | Description |
---|---|
git status |
Check status |
git add [file-name.txt] |
Add a file to the staging area |
git add -A |
Add all new and changed files to the staging area |
git commit |
Commit changes - must enter message in prompt |
git commit -m "[commit message]" |
Commit changes with inline message |
git rm -r [file-name.txt] |
Remove a file (or folder) |
git branch |
List branches (the asterisk denotes the current branch) |
git branch -a |
List all branches (local and remote) |
git branch [branch name] |
Create a new branch |
git branch -d [branch name] |
Delete a branch |
git checkout -b [branch name] |
Create a new branch and switch to it |
git checkout [branch name] |
Checkout a branch (local or remote branch) |
git checkout -b [branch name] origin/[branch name] |
Clone a remote branch and switch to it |
git checkout [branch name] |
Switch to a branch |
git merge [branch name] |
Merge a branch into the active branch |
git merge [source branch] [target branch] |
Merge a branch into a target branch |
git stash |
Stash changes in a dirty working directory |
git push |
Push changes to remote repository |
git pull |
Update local repository to the newest commit |
git log |
View commit history |
git log --summary |
View detailed commit history |
git diff [source branch] [target branch] |
Show diff of two branches |