Giter VIP home page Giter VIP logo

cs2340-water-app's Introduction

CS2340-Water-App

This is for CS2340

Crowd-sourced water locator Android app that we developed for our Objects & Design class. Has full functioning profile creation and Google Maps API integration. There is also a website port

cs2340-water-app's People

Contributors

lealex262 avatar sgilson7 avatar kaangoksal avatar johnnyhoboy avatar

Stargazers

John Ho avatar

Watchers

James Cloos avatar  avatar John Ho avatar  avatar  avatar

cs2340-water-app's Issues

MileStone 3 - Android and MVC

Purpose
This exercise will ensure you can build and execute an Android application on your computer. You will also add functionality across the application stack to solidify your understanding of Model-View-Controller.

Recall from class the following guidelines:

Model - the classes that hold data for the application, and the business rules. These are normally POJO (plain old java objects) and are independent of any development frameworks you are using.

View - the screens that display and get information from the user. (in android, these are the .xml layout files)

Controller - a class associated with the view that has all the event handling code and code that interacts with the model to update information obtained from the model. In Android, these are called Activities.

Running the App
You should go to Assignment 3, and download the M3.zip file. Extract the file into your IDE project directory. If using Intelli-J, I have included my idea files so you can import the project. If using a different IDE, or coding from the command line, simply import the code files.

If you examine the project view, you will see there are packages for model, view, and controller.

If you run the project, it should build and execute normally. You should be able to add a student and see the list update.

New Features
Your customer likes the application so far, but they want one minor change. They want to include the student's class standing (freshman, sophomore, etc.) This will require a change in each component (Model, View and Controller).

Normally when maintaining code and making feature enhancements and bug fixes, you can start wherever you like in the stack. I usually like to start with the Model.

Model changes
Since the customer's request is to add information to the Student, we can focus on the Student class.

To support the class standing, we will first need to create a new class named ClassStanding which is an enum with the values FRESHMAN, SOPHOMORE, JUNIOR, and SENIOR. Give each class a two character representation "FR", "SO", "JR" and "SR".
Now add an attribute to Student which holds the ClassStanding enum.
Add getter and setter for the ClassStanding
Make a new 3 param constructor which includes name, major and class standing. Keep the old two param constructor for backwards compatibility and use constructor chaining to give a default class standing of Freshman.
Change the toString method to contain the class standing also.
At this point the model should be runnable and we should see the changes reflected in the list. Go ahead and run the app at this point. You should see all the students listed as before except with their classes shown. If you don't see the classes, be sure your constructor chaining is passing the freshman value to the 3 param version. Also be sure you added the class standing to the toString method.

View changes
Now you will need to add some widgets to the view so that when adding a new student, you can get the class standing from the user. Open the StudentEditDialog.xml file.

You will see that the dialog is laid out in a grid layout with labels and input fields. You will need to add to the grid some way to input the class standing. I used a combobox, but 4 radio buttons would work. You could use a text field and type in the standing, but that is error prone and you would need to validate that an incorrect entry was not made.

Once you have made the changes to the screen be sure and save the .fxml file.

Now you should be able to run the app again, just to make sure everything is ok. You should be able to hit the add student button and your dialog should pop up with your new UI features showing. It wont actually do anything yet, and if you used a combobox like me, it won't have any values in it. To make the display actually work, we have to edit one more class, the controller.

Controller changes
Now we have to make the view cooperate with the model. To do this, we must add items to the StudentEditController class (since this is the controller for our view).

Add an @FXML reference to the widgets you added for class standing. This is how you will pull data out of the widget to pass to the model. Be sure the spelling for the fxid matches what is in the .fxml file exactly.
Edit the initialize method to handle any start up code you need. If you used a combobox like me, this is where you will populate the box with the different classes (Freshman, etc). Remember that calling values() on an enum will give you an array. You will need to wrap this in an ObservableList. I made a static helper function that did that for me in the model.
Edit the setStudent method to set your widget to a default value
Edit the OK button press to pull the information out of your new widget and put into the student instance.
If you used a free text entry field, you will need to edit the isInputValid method to check that a valid class was entered. If you used a constrained widget like radio buttons or combo box where it is impossible to enter a bad value, then you do not have to do any validation.
Now run the app. You should be able to enter new students and their standing and see it reflected in the UI. if not, then check your code through the complete stack. Are you calling the setters in the model to update the information? Are you pulling the information out of the widget correctly?

ALL DONE!
Congratulations you have edited a full stack MVC app. You also caught a glimpse of the life of a maintenance programmer. Most of you will not work on new applications, you will work on established products to add new features, just like we have done here.

Submission
Zip up your complete project directory and submit to the assignment.

Grading
enum for ClassStanding ....................................10
attribute added in Student ................................05
getter/setter .............................................10
new constructor ...........................................05
toString ..................................................05
widget added to dialog ....................................15
list shows required info...................................05
student added is in list...................................10
dialog displays required default information ..............10
dialog updates model ......................................15
data validation (if required) .............................10 (constrained inputs get points automatically)

Milestone 4 - Login/Logout User Stories

Design:
Create a Context Diagram for the system
Brainstorm and list 10 user stories (title only) You may have fewer than 10 user stories if you can cover the entire system in fewer.
Each person on the team pick 1 user story and fully elaborate it (this is an individual grade, so you do not have to cover for a team mate). This includes the acceptance scenarios.

Implementation:
Create your team's Android Project and Import into Git
Create an opening or welcome screen which has options for Login and Registration. You may have some other method of differentiating login and registration, if you do not want an opening screen.
If someone selects Login, then you should display a way to enter the user name and password.
If someone requests login, you should check for the correct user name and password. For this first milestone, you may have a hard coded user with name "user" and password "pass" to check against.
If the login matches user name / password then go to your application. Otherwise, notify of the bad login attempt.
Canceling the login (press Cancel or going back a screen for example) will close out the login attempt , but no information is recorded and the application does not start up. Note here you are not explicitly required to have a cancel button, just a way to back out of the login.
Once in the application, there should be a way to logout. After logging out, the application should return to the welcome / opening page.

Milestone 2

As a developer, I would like to be able to use Git and Gradle. To do this, we have to learn to add and remove files, and learn how to use branching effectively.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.