DPSD HW7 - Android 1 Activity Aware

This will be your first small Android Application (hw7) and consists of 2 parts - a short written part and a coded app.

Part 1: Written Part

Due Week 9

In no more than a few paragraphs each, answer the following questions:

  1. Describe the execution lifecycle for an Android App when running on a physical Android Device. Include a list of the methods involved in the Activity lifecycle and what each one should do (in a general sense).
  2. Describe the execution lifecycle for a Fragment when running on a physical Android Device. Include a list of the methods involved in the Fragment lifecycle and what each should do (in a general sense).
  3. Read the Wiki page on event-driven architecture http://en.wikipedia.org/wiki/Event-driven_architecture.
    1. Describe how the Android Activity Lifecylce Management fits into the described architecture.
    2. At the bottom it has a description of Java Swing/AWT event handling and an example. Write something similar (description and example code) but for an Android Activity (and turn it in for this assignement, please don't edit the Wiki page)
  4. Read and describe how the AsyncTask is used in Android programming.

Part 2: Code Your First App

Due Week 10

You will write an app that will figure out what a person is doing (called activity recognition) and based on if they have been sitting for "too long", generate a notification.

Note: this is a team project. You must work in teams of 2 (or 1 group of 3 if there is an odd number of students) to design and code your solution.

Your app should note what the user is doing now (perhaps sitting, walking, running, driving, ... check on what is supported) and accumulate how long they have been sitting. If they have not been sitting (defined as doing the same alternative activity for some specific time), reset the accumulated time. If they have been sitting for "too long", the send them a notification of some sort.

  1. Call your app Sit2Long.
  2. Be sure to code your app using good design principles from Project 1.
  3. Use at least one pattern.
  4. Describe your design and your pattern(s) in comments in your code.

Week 9 In-class Activities: