WPI Computer Science Department

Computer Science Department

Project 3: Recognizing Activities with Android Sensors, (8/100 of course grade)
CS 528 Fall 2020 Semester
Due date: Wednesday, October 21, by class time


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

NOTE: You can do this project on your own Computer!! Just download and use the most recent version of Android Studio!

Project Preparation

Step 1: Review Slides for Lectures 4 - 6

The grader has tested some of the Android code samples you will use for this project. She has provided notes on any changes you need to make to make them work [ Here ]

Step 2: Review the following information on Activity Recognition

Some notes on the Google Activity recognition APIs can be found [ HERE]

Step 3: Get Activity Recognition Working

A student of mine to create a code example using the new Android Activity Recognition Client API and put it up on gitHub. If it's useful to you, feel free to use his code for your work.


Step 4: Get GeoFencing Working

Review the following notes on Android location and GeoFencing. Then follow the official Google GeoFencing tutorial to get Geofencing working. Get it to work!! The following tutorials on geoFencing might be useful.

Step 5: Implement step counting

Implement the simple step counting algorithm we covered in lecture 6 of the class. Don't use the Android step counter. Write your own!

Project Requirements

You are to develop an app that continously recognizes 4 of the user's activities (walking, running, in vehicle and still). Whenever an activity is recognized, an appropriate picture is displayed and text describing the activity is displayed as well. Additionally, whever the user is walking or running music from an MP3 is played. Display the following images and play music from the following mp3 file for the corresponding activities:

[ In Vehicle ]
[ Running ]
[ Still ]
[ Walking ]
[ beat_02.mp3 ]

NOTE: It's understandable if you cannot test the "In vehicle" activity. Just test the rest. Create a local SQLite database to continuously store the start time of each activity along with the activity type. E.g. (12:24, 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 be inside the geofence for at least 15 seconds (dwell time) before the count of number of times entered the geofence is incremented. If the user enters the geofence but leaves before 15 seconds have elapsed, the counter is not incremented. Once the user has been in the geofence for 15 seconds, a toast pops up announcing "You have been inside the Gordon Library Geofence for 15 seconds, incrementing counter". Display a similar message for the Fuller labs geoFence. Keep track of the number of steps taken by the user since the app started and display it.

Display a map of your current location at the top of the screen and the address. 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:


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]