CSCI 448 - Mobile Application Development (Android)Spring 2020 - Assignment 3 - WeathrTrackrQuick Links: Canvas | CS @ Mines | Mines | Piazza |
|||||||||||||||||||||||||||||||||||||||||||||||
| Home | Syllabus | Assignments | Schedule | Resources | | |||||||||||||||||||||||||||||||||||||||||||||||
This assignment is due
by April 30, 2020 by 11:59pm.
For this assignment, you will use all the pieces and labs you
have learned this far. You should be able to reuse much of your code
from previous labs and with slight modifications, be up and running in
not much time.
You will want to use the completed Lab09 as the starting point for this assignment since you'll be working with a map. (Note: Since this is a new app using the Map API, you'll need to generate a new API key for this package - or you can reuse your existing Lab09 package to keep the same API Key). For this app, you will allow the user to check in at their current location. Their location will be displayed on the map, along with all of their previous checked points. The history of checkpoints will be stored in either a local SQLite database or a Cloud database. Each checkpoint will show as a marker on the map. Selecting a marker will display the time the user checked in, the address of the location, and what the weather was at that time. When you create this project, set the name of the app to be <userName>_A3 where userName is your name.
An example of the completed app is shown below:
Part I - Check In
The first UI component a user sees should be a Google MapView. Add a
Floating Action Button to the UI as well. When the user presses the
Floating Action Button (FAB), the app should query their current location. The returned location will
then be displayed by a marker on the map. The title for the marker
should be the lat/long of the location (or street address). Selecting the marker should
have a Snackbar appear that displays the time that the user checked in
at that location.
In addition, the location is used to query the current weather at that location. Getting the weather is actually very easy! We will use OpenWeatherMap to query the weather based on location. OpenWeatherMap has a useful REST API available that can be used to query based on geolocation. The API will send a JSON response that you will need to parse. For help parsing the JSON response, take a look at Retrofit library as discussed in BNR Chapter 24. You will need to use Retrofit and the GSON converter to retrieve the response from the API. Once we have the weather information, we are only interested in the temperature and description of the weather. These two pieces of information should be displayed in the Snackbar as well. (Feel free to use other weather info. There are other API calls to get the future forecast as well). Display this information initially in a Toast, but then have it also displayed in the Snackbar when the user reclicks on a marker. Every time the user checks in, the information for the checkpoint should be saved to the database (lat, long, address, datetime, temp, weatherDescription). This way the map can show all checkpoints. Further, when the user restarts the app at a future time all previous checkpoints will be displayed. In the event that the user checks in to a place that they would rather forget, add an action to the snackbar that allows the user to delete that record. Pressing delete will remove the marker from the map and remove the record from the database. While you have seen all of the necessary pieces, you may still encounter some problems you have not run into before (error: populating the map with markers when first loading the app, frustration: positioning the FAB programmatically). Put on your Googling hats and all your answers will be revealed. Part II - Navigation
In this assignment, we will present the user with a Drawer Layout to navigate between fragments in the app.
Pressing the hamburger menu in the top left, or swiping in from the left side of the screen, will open the
navigation drawer.
You will need to use the Jetpack Navigation to facilitate the DrawerLayout. (Note: the Jetpack Navigation AC makes this process rather easy to do.) Part III - Fragments
There are four required fragments you need to allow the user to navigate between:
Map Fragment
This is the fragment that was described in Part I regarding the map interaction.
History Fragment
This fragment displays all of the records that have been saved to the database. The user needs to be able to
scroll through all records in the database. Swiping to the right on any
item allows that record to be deleted. When a record is deleted, it needs to be cleanly removed from the list
and if the user returns to the map, the marker is no longer displayed since the record has been deleted from the database.
Settings Fragment
This fragment will display options for the app. At a minimum, you need to have the following two options:
About Fragment
This fragment gives information about the app developer and how to use the app.
Part XC - Extra Credit
There are two possible extensions for extra credit with this app.
Part IV- Exit Interview
Be sure to include a
README.txt
file containing any comments, notes to run, etc. In addition, answer
the following questions in yourREADME.txt :
Documentation
With this and all future assignments, you are expected to appropriately
document your code. This includes writing comments in your source code
- remember that your comments should explain what a piece of code is
supposed to do and why; don't just re-write what the code says in
plain English. Comments serve the dual purpose of explaining your code
to someone unfamiliar with it and assisting in debugging. If you know
what a piece of code is supposed to be doing, you can figure out where
it's going awry more easily.
Proper documentation also means including a README.txt
file with your submission. In your submission folder, always include a
file called
README.txt
that lists:
Grading Rubric
Your submission will be graded according to the following rubric.
SubmissionPlease make sure your project
produces an executable with the name userName_A3. When you are
completed with the assignment, zip together your Android Studio
project (which includes the Kotlin and XML source code) and README.txt. Name the zip file, userName_A3.zip. Upload this file to
Canvas under A3.
This assignment is due
by April 30, 2020 by 11:59pm.
| |||||||||||||||||||||||||||||||||||||||||||||||
Last Updated: 12/31/69 17:00
|