Design and coding tips

In what follows, we provide some guidance on design and coding for your Android programs. Then, we list a grading rubric for each lab. As the labs progress we become more picky about good design and good code.

Design tips

Remember a program (classes, methods) should do one thing and one thing well. You should start to write good readable code from the start (see coding tips below). Break your programs into meaningful classes/methods. Be defensive when dealing with user input and other interfaces. Always check return values (a reference to an object that might be null) and exit gracefully if an error has been encountered – IO failed – inform the user if needed in a meaningul way.

Keep the MVC (Model, View, Controller) architecture in mind when doing OO design for your Android applications:

Coding tips

Grading Rubric

For most labs we give out the apk solution so you should code to the solution behavior and what is detailed in the design document. However, here we breakdown the grading. Typically, labs are graded on completeness of the required features, the correctness of the functionality, and the robustness:

Please make sure that your submitted code has no warnings in the Android Java code or XML. We will not grade code that has compilation/lint warnings unless you have the OK from the TA in advance for some edge case that can't easily be cleared:

You should download, inspect and run all code examples in the notes (.zip files) to fully understand concepts and patterns taught in class. However, you cannot under any circumstances ``cut and paste'' these examples into your solutions for your submissions. You should use these coding examples as a learning tool; always code your own intrepreation of these coding examples in your solutions if you choose to use the patterns; that is, look at the code and understand how it works but always code your own versions of these patterns if you use them in your solution:

MyRuns 1

Note, MyRuns is a single user app. You do not have to design for multiple user registration in MyRuns1.

We only consider correctness in this lab. Does the app work correctly as specified in the design document and APK. (points out of 100)

MyRuns 2

We consider both correctness and well-written code in this lab. You should consider the design and code tips above as guidelines to designing and writing good code. 85% of the grade will be for correctness and 15% for style/well-written code. In terms of correctness: does the app work correctly as specified in the design document and APK we have handed out. As the term progresses we will increase the point allocation to writing good code so start now (points out of 100)

MyRuns3

We consider both correctness and well-written code in this lab. You should consider the design and code tips above as guidelines to designing and writing good code. 80% of the grade will be for correctness and 20% for style/well-written code. In terms of correctness: does the app work correctly as specified in the design document and APK we have handed out. As the term progresses we will increase the point allocation to writing good code so start now (points out of 100).

This lab is focused on implementation of a database of Exercise Entry objects. The actions are to write, read and delete exercises from the database. The UI work is simple based on prior assignments. As discussed in class you have to off load the read and write database operations to background threads.

MyRuns4

We consider both correctness and well-written code in this lab. You should consider the design and code tips above as guidelines to designing and writing good code. 85% of the grade will be for correctness and 15% for style/well-written code. In terms of correctness: does the app work correctly as specified in the design document and APK we have handed out. As the term progresses we will increase the point allocation to writing good code so start now (points out of 100).

This lab is focused on implementation of of Google Maps, location manager, tracking service, activity recognition, broadcast receivers, and notification. A number of the key components in many Android apps. You have to integrate this into your existing MyRuns3 design based on the design spec.

MyRuns 5

We consider both correctness and well-written code in this lab. You should consider the design and code tips above as guidelines to designing and writing good code. 85% of the grade will be for correctness and 15% for style/well-written code. In terms of correctness: does the app work correctly as specified in the design document and APK we have handed out. As the term progresses we will increase the point allocation to writing good code so start now (points out of 100).

CodeIts

We will have a number of (probably 3) short coding assignments called CodeIts. Some of these will be started and completed in class or submitted before the end of the day of class. These will not be complex like MyRuns and just reinforce what we discussed in class.

We will grade CodeIts simply. We will only look at functionality -- does the app do what we asked. If it does not work at all you get 0. If it partially completed the CodeIt you get 50%. If you complete it you get 100%.

Don't get stressed about CodeIts. A CodeIt and Quiz will carry approximately the same grade. I would imagine there will be 7 quizzes and 3 CodeIts -- so each carry 2.5% of your overall grade.

Monday Quiz

We will have a weekly quiz (only 10 mins) on any material discussed in class and in the notes for the previous week. Quizes will be for the last 10 mins of class on Monday. That means you have to read the notes, attend class, and run and understand the code snippets. You will be asked to write code but it does not have to compile. I care less about exact syntax and more that you approximately can recall methods or code.