Pedometer Project 1 Mr. Michaud / www.nebomusic.net



Similar documents
By sending messages into a queue, we can time these messages to exit the cue and call specific functions.

Mobile App Tutorial Animation with Custom View Class and Animated Object Bouncing and Frame Based Animation

Creating a 2D Game Engine for Android OS. Introduction

ELET4133: Embedded Systems. Topic 15 Sensors

ECE 455/555 Embedded System Design. Android Programming. Wei Gao. Fall

Using the Android Sensor API

CS 403X Mobile and Ubiquitous Computing Lecture 6: Maps, Sensors, Widget Catalog and Presentations Emmanuel Agu

Google Sites: Creating, editing, and sharing a site

Orders.java. ArrayList of Drinks as they are ordered. Functions to calculate statistics on Drinks

Lab 1 (Reading Sensors & The Android API) Week 3

Module 1: Sensor Data Acquisition and Processing in Android

WEARIT DEVELOPER DOCUMENTATION 0.2 preliminary release July 20 th, 2013

Microsoft Access 2010 handout

Getting Started: Creating a Simple App

Getting Started with Android Programming (5 days) with Android 4.3 Jelly Bean

! Sensors in Android devices. ! Motion sensors. ! Accelerometer. ! Gyroscope. ! Supports various sensor related tasks

Android Basic XML Layouts

How to Login Username Password:

Create a Google Site in DonsApp

APP USER MANUAL. Trackunit Virtual Hardware. Status / Tracking / Map

Create your own teacher or class website using Google Sites

Android Sensors. CPRE 388 Fall 2015 Iowa State University

Printer Driver Manual for Windows 7

TheFinancialEdge. Reports Guide for Accounts Receivable

Android Fundamentals 1

MONITORING PERFORMANCE IN WINDOWS 7

Configuration Guide - OneDesk to SalesForce Connector

MICROSOFT OUTLOOK 2010 WORK WITH CONTACTS

Introduction to Word 2007

Mobile Application Development 2014

Android Programming Lecture 18: Menus Sensors 11/11/2011

Microsoft Excel 2013 Tutorial

Developer's Cookbook. Building Applications with. The Android. the Android SDK. A Addison-Wesley. James Steele Nelson To

How To Change Your Site On Drupal Cloud On A Pcode On A Microsoft Powerstone On A Macbook Or Ipad (For Free) On A Freebie (For A Free Download) On An Ipad Or Ipa (For

Microsoft Migrating to Word 2010 from Word 2003

How to develop your own app

Migrating to Excel 2010 from Excel Excel - Microsoft Office 1 of 1

Sprint WeGo User Guide

Introduction to Microsoft Access 2007

Appendix A How to create a data-sharing lab

Google Sites. How to create a site using Google Sites

Mocean Android SDK Developer Guide

Gear View Basic. User Help. Version Written by: Product Documentation and R&D Date: August 2015 LX-DOC-GVB UH-EN-REVA

Data Tool Platform SQL Development Tools

MicroStrategy Quick Guide: Creating Prompts ITU Data Mart Support Group, Reporting Services

Utilizing Microsoft Access Forms and Reports

Kathy Au Billy Yi Fan Zhou Department of Electrical and Computer Engineering University of Toronto { kathy.au, billy.zhou }@utoronto.

Working with Video in PowerPoint 2010

Create Charts in Excel

SpringCM Integration Guide. for Salesforce

Search help. More on Office.com: images templates

Android Concepts and Programming TUTORIAL 1

Merging Labels, Letters, and Envelopes Word 2013

Word basics. Before you begin. What you'll learn. Requirements. Estimated time to complete:

SAP Business Intelligence (BI) Reporting Training for MM. General Navigation. Rick Heckman PASSHE 1/31/2012

USER GUIDE. Unit 5: Tools & Modules. Chapter 3: Forms & Surveys

Mobile Apps with App Inventor

Petrel TIPS&TRICKS from SCM

Sample Table. Columns. Column 1 Column 2 Column 3 Row 1 Cell 1 Cell 2 Cell 3 Row 2 Cell 4 Cell 5 Cell 6 Row 3 Cell 7 Cell 8 Cell 9.

Creating Interactive PDF Forms

The software shall provide the necessary tools to allow a user to create a Dashboard based on the queries created.

Android Development Tutorial. Nikhil Yadav CSE40816/ Pervasive Health Fall 2011

Web Developer Jr - Newbie Course

Android Sensor Programming. Weihong Yu

Microsoft PowerPoint 2010 Computer Jeopardy Tutorial

Crystal Reports. Overview. Contents. Columnar Drill-Down Report

Sensors & Motion Sensors in Android platform. Minh H Dang CS286 Spring 2013

Objective. Android Sensors. Sensor Manager Sensor Types Examples. Page 2

USER MANUAL Detcon Log File Viewer

Custom Reporting System User Guide

A simple three dimensional Column bar chart can be produced from the following example spreadsheet. Note that cell A1 is left blank.

OUTLOOK WEB APP (OWA): MAIL

Indiana County Assessor Association Excel Excellence

How to Build a SharePoint Website

Homeschool Programming, Inc.

Access Tutorial 3 Maintaining and Querying a Database. Microsoft Office 2013 Enhanced

Reading and Responding to Sensors

Tutorial 3 Maintaining and Querying a Database

Introduction to NaviGenie SDK Client API for Android

Charts for SharePoint

How to create pop-up menus

Introduction to Android SDK Jordi Linares

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL II)

Microsoft Word 2010 Prepared by Computing Services at the Eastman School of Music July 2010

CREATING EXCEL PIVOT TABLES AND PIVOT CHARTS FOR LIBRARY QUESTIONNAIRE RESULTS

Chapter 4: Explore! Decision-Making Controls

A quick guide to. Creating Newsletters

A = 6561 times greater. B. 81 times greater. C. equally strong. D. 1/81 as great. E. (1/81) 2 = 1/6561 as great.

Using Adobe Acrobat X Professional

GRAVITATIONAL FIELDS PHYSICS 20 GRAVITATIONAL FORCES. Gravitational Fields (or Acceleration Due to Gravity) Symbol: Definition: Units:

Transcription:

Mobile App Design Project Pedometer Using Accelerometer Sensor Description: The Android Phone has a three direction accelerometer sensor that reads the change in speed along three axis (x, y, and z). Programs using the accelerometer read this information to give the phones orientation in space or the phones change in speed and direction. In addition, the gravity type for the phone can be changed based on gravitational pull on different heavenly bodies (Earth, moon, Mars, Jupiter...). Satellite companies have experimented with using Android device based CPU s and programming to control Satellite guidance systems. (http://www.tgdaily.com/mobility-brief/69359- android-in-space-satellite-controlled-using-nexus-one) Image of Acceleration Values: This Application will use the Accelerometer to display the X, Y, and Z values and use the Y value to calculate and count the steps a user takes while carrying the phone in their pocket. The App will also have a SeekBar object to set the sensitivity of the change in values on the Y Axis during a step or shake. Pedometer Project 1

Phase 1: Create the App Project Process: 1. Start Eclipse and select New Project -> Android Application Project 2. Fill out the fields with the following: a. Application Name: Pedometer b. Project name: Pedometer c. Package name: com.example.pedometer 3. Click Next 4. Click Next at the Configure Project Screen 5. Click Next at the Configure Launcher Screen 6. Click Next at the Create Activity Screen 7. Fill out the following fields in the New Blank Activity Screen a. Activity Name: Pedometer b. LayoutName: activity_pedometer c. Navigation Type: None 8. Click Finish Pedometer Project 2

Phase 2: Android Manifest XML and the XML user interface design Because we will be shaking and moving the phone we need to freeze the phone s screen orientation in the Portrait mode. This is accomplished by adding a line of code to the Android Manifest. Then we will build the User Interface on the activity_pedometer.xml file. Process: 1. Open the Android Manifest.xml file Pedometer Project 3

2. Modify the existing code and insert the screen orientation setting at Line 19 inside the <activity tag with the code: Pedometer Project 4

3. We will now design the User interface. The objects and locations within the user interface are shown below: Pedometer Project 5

4. Open the activity_pedometer.xml file 5. Start the XML file with a Table Layout Tag: Pedometer Project 6

6. In Table Row 1 we will have three TextView objects to display the X, Y, and Z values from the Accelerometer Sensor. Write the code for TableRow 1 Pedometer Project 7

7. In Table Row 2 we will place the Reset Button that will call the method resetsteps to reset the step counter. 8. In Table Row Three we will have a Large TextView object that will display the Steps Centered horizontally, vertically, and in a large font size. Pedometer Project 8

9. In Table Row Four we will have a SeekBar object that we will use to set the threshold value 10. In Table Row 5 we will have a TextView object to display the threshold. We will also close out the TableLayout object and finish the XML Pedometer Project 9

11. The User Interface should look like this: Pedometer Project 10

Phase 3: Writing the Code for the Pedometer Class The Pedometer Class will create the model to display the accelerometer X, Y, and Z data, have a Sensor Listener to read the Accelerometer, and have the algorithm to detect steps using the threshold value. Process: 1. Write the import statements for the Android Classes used within the Pedometer Class Note! You can skip this step and include the imports as you write the code. When an error occurs, hover over the error and select Import (Usually the first suggestion from Eclipse) Pedometer Project 11

2. Define the Fields for the Pedometer Class Pedometer Project 12

3. Start the oncreate() method by attaching the fields to the XML User Interface objects 4. Finish writing the oncreate() method by initializing the values for the seekbar, threshold, and the values used to calculate the steps Pedometer Project 13

5. The oncreateoptionsmenu is included by default. Leave this method as written by Eclipse. 6. Write the enableaccelerometerlistening() function to enable Accelerometer and register the listener. 7. Begin the Event handler for the Accelerometer. This is an inner class 8. Write the onsensorchanged method. This holds the majority of the logic and flow for the App. The values are gathered from the event object and displayed. A conditional statement compared the previous and current acceleration to the threshold to count the steps. Pedometer Project 14

9. Finish the SensorEventListener with a required method and close with a bracket and semicolon 10. Write the resetsteps() method. The resetbutton calls this method when clicked to reset the step counter and the display. 11. Finish the Pedometer class with a private class OnSeekBarChangeListener. This Listener reacted to changes to the SeekBar, adjusting the threshold value used by the SensorEventListener. The Pedometer class is finished with a bracket at line 163. Pedometer Project 15

12. Save and Test your App! Experiment to see how accurate the App counts steps. Pedometer Project 16

13. Improvements you can make! a. Add sounds to the App to give an aural cue every time a step is recorded. b. Change the User interface to add more colors and interest. c. Create a better algorithm to count steps more accurately. d. Combine with the GPS Sensor to record distance traveled. e. Add a function to Count Calories based on Number of steps and weight of User. Pedometer Project 17