WPI Computer Science Department

Computer Science Department
------------------------------------------

CS 4518, C Term Project 3: Recognizing Activities with Android Sensors, (12/100 of course grade)
Due date: Friday, February 9, 11.59PM

Overview

The aim of this project is to get you familiar with Android Sensors, specifically the activity recognition API. You will also explore GeoFences and Android Maps. You should do the project in your groups of 5 or 6 students.

NOTE: You can do this project on your own Computer!! Testing in the zoolab is NOT necessary

Project Preparation

Step 1: Review Slides for Lectures 7 - 8

Step 2: Review the following tutorial on Activity Recognition

[ How to recognize user activity with activity recognition API ]

Step 3: Get Activity Recognition Working

Download the code for the activity recognition tutorial above, open it in Android Studio, compile it and get it to run on a real phone. Remember that real phones are required to run sensor code. Study the code. Make sure you update your Android Studio, Gradle and Gradle Plugin to the latest versions. If you get compile errors, try adding the following snippet to your build.gradle file:
buildscript {

    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
    }
}
Also in build.gradle, you can comment out the line "testCompile 'junit:junit:4.12'" if you get errors/warnings. A Step by Step guide with additional notes for compiling the Activity Recognition code can be found [ Here ]

Step 4: Get GeoFencing Working

Review the following tutorials on geoFencing and get them working.

Step 5: Get Android Step Counting to work

Get the Android step counter to work! You can get the code [ Here ] . This step counter uses Google Fit and should work on most phones. Alternatively, if your phone supports step counting, you may write a simple sensor function to detect/count steps. i.e. if your smartphone suports TYPE_STEP_COUNTER or/and TYPE_STEP_DETECTOR. A Step by Step guide with additional notes for compiling the Step Counter code can be found [ Here ]

Project Requirements

You are to develop an app that continously recognizes 3 of the user's activities (walking, running, and still). Whenever an activity is recognized, an appropriate picture is displayed and text describing the activity is displayed as well. Display the following images corresponding to the activities:

[ Running ]
[ Still ]
[ Walking ]

Whenever a user switches to a new activity, a toast pops up displaying how long the last activity lasted. For instance, if the user was walking and became still, a toast may pop up announcing "You have just walked for 1 min, 36 seconds".

Set up 2 GeoFences at the following locations:

Your app keeps a running total of how many times the user entered each of these geofences and displays them. The user must take 6 steps in each geofence before it increments the counter. If the user does not take 6 steps inside the geofence, the counter is not incremented. Once the user has completed 6 steps inside the geoFence, a toast may pops up announcing "You have taken 6 steps inside the Gordon Library Geofence, incrementing counter". Display a similar message for the Fuller labs geoFence.

Display a map of your current location at the top of the screen. The final app screen should look like the screen below.





Submitting Your Work

Capture a video of your running program. Make sure to double-check that everything works before submitting. Create a zip file containing your code, your APK and MP4 Video (Captured session) files. Submit your zip file using [ Instruct Assist ] . Do not email me your program or submit it via dropbox.

Before submitting MAKE SURE YOUR PROJECT'S APK FILE RUNS ON YOUR ANDROID PHONE Name your zip file according to the convention LastName1_LastName2_LastName3_LastName4_LastName5_hw3.zip, listing all team members' last names. Your submitted zip file for submission should contain the following folders/files:

\team.txt
\src\
\demo.mp4
\hw3.apk

The contents of team.txt should list team members as follows:

Username, Last Name, First Name
emmanuel, Agu, Emmanuel
msmith, Smith, Mary

Phone tested on: Google Nexus 5 Smartphone
Computer Tested on: Dell Inspiron, I7 2 GHz CPU, 16GB RAM


[Feedback] [Search Our Web] [Help & Index]

[Return to the WPI Homepage] [Return to CS Homepage]

mailto:emmanuel@cs.wpi.edu