Completed

Android app which recognizes "shake" in three directions/planes (with JUnit tests)

This project was successfully completed by thewebpixel for $10 USD / hour in 35 days.

Get free quotes for a project like this
Employer working
Completed by:
Skills Required
Project Budget
$8 - $15 USD / hour
Completed In
35 days
Total Bids
14
Project Description

I need an Android application which recognizes a "shake" in three directions/planes. And, I want Android JUnit tests which verify the application works correctly.

A "shake" is defined as someone moving the phone back and forth three times in the vertical, horizontal or side-to-side plane.

The speed of the shake should be variable, so someone could shake very quickly, or very slowly, and it would still recognize (within a tolerance) that this was a "shake."

For example, if I shake the phone up, down, up, down, up, down, then I want the application to provide a "toast" which says "vertical shake!"

If I move the phone left, right, left, right, left, right, then I want the application to provide a toast which says "side shake!"

If I move the phone forward, back, forward, back, forward, back, then I want the application to provide a toast which says "horizontal shake"

The Android accelerometer provides recognition of X, Y, and Z acceleration. So, basically, this application would be checking for changes to the accelerometer.

One required deliverable: I want TEST cases. So, I would like to have the application print out the accelerometer into the adb logcat console, like this:

1359111821594, [url removed, login to view], [url removed, login to view], [url removed, login to view]
1359111821660, [url removed, login to view], [url removed, login to view], [url removed, login to view]
1359111821727, [url removed, login to view], [url removed, login to view], [url removed, login to view]
1359111821794, [url removed, login to view], [url removed, login to view], [url removed, login to view]
1359111821861, [url removed, login to view], [url removed, login to view], [url removed, login to view]
1359111821927, [url removed, login to view], [url removed, login to view], [url removed, login to view]

This is timestamp, X, Y, Z.

I want JUnit tests which verify the Android application is recognizes the "shake" in each of the three directions.

The best way to do this would be to have the application print out the timestamp, X, Y, Z , and then use adb logcat and capture this to a file. Then, read in the file and use them inside the tests. So, you probably would have three sets of files: an [url removed, login to view] file for successful "shake" in the X direction, a [url removed, login to view] file for successful shake in the Y direction, etc. AND, you would have three sets of files for failures, where the person shakes left, right, then up, down, and the tests cases indicate this is not a "shake" (and clears the state of the application).

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online