CS378 - Mobile Computing Sensing and Sensors Part 2.

Slides:



Advertisements
Similar presentations
Android Application Development Tutorial. Topics Lecture 4 Overview Overview of Sensors Programming Tutorial 1: Tracking location with GPS and Google.
Advertisements

Android architecture overview 1 CS 150. Android  A software stack for mobile devices developed and managed by Open Handset Alliance  Free software under.
WiFile Team DroidDev Krushi Desai Poonam Waral Rushabh Pasad.
Implementing Mobile Learning – Technical process Pete Stockley, 2012.
Android sensors.
CS371m - Mobile Computing Audio.
Starting AppInventor in the Classroom Dale CAS Conference June 2011.
Introduction to AppInventor Dr. José M. Reyes Álamo.
UFCFX5-15-3Mobile Device Development Android Development Environments and Windows.
SET UP COMPUTER ** PLEASE BE AWARE SCREENSHOTS MAY NOT MATCH **
SCERSIG: Creating Android Apps with App Inventor 26 October 2011 Ric Paul, Health Services Library, Southampton.
CS378 - Mobile Computing Sensing and Sensors. Sensors "I should have paid more attention in Physics 41" Most devices have built in sensors to measure.
CS378 - Mobile Computing Sensing and Sensors. Sensors "I should have paid more attention in Physics 41" Most devices have built in sensors to measure.
CS378 - Mobile Computing Speech to Text, Text to Speech, Telephony.
CS378 - Mobile Computing Connecting Devices. How to pass data between devices? – Chat – Games – Driving Options: – Use the cloud and a service such as.
Android Sensors & Async Callbacks Jules White Bradley Dept. of Electrical and Computer Engineering Virginia Tech
Android 2: Introduction to the Technology Kirk Scott 1.
Android Apps: Look and Feel Module 6, Intro to I.T., Fall 2011 Sam Scott.
Copyright ©: SAMSUNG & Samsung Hope for Youth. All rights reserved Tutorials Software: Building apps Suitable for: Advanced.
© Keren Kalif Intro to Android Development Written by Keren Kalif, Edited by Liron Blecher Contains slides from Google I/O presentation.
Lecture # 9 Hardware Sensor. Topics 2  SensorManger & Sensor  SensorEvent & SensorEventListener  Example Application.
Intro to AppInventor Dr. Dante Ciolfi (chawl fee).
Sensing. Possible sensors on devices – Documented in SensorEvent class Accelerometer (m/s 2 ) – acceleration in x, y, z axes Magnetic Field (micro Tesla)
Intro to Android Development Ben Lafreniere. Getting up and running Don’t use the VM! ials/hello-world.html.
Doodlz App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
DUE Hello World on the Android Platform.
16 Services and Broadcast Receivers CSNB544 Mobile Application Development Thanks to Utexas Austin.
DUE Introduction to the Android Platform Working Connections 2011.
1 CMSC 628: Introduction to Mobile Computing Nilanjan Banerjee Introduction to Mobile Computing University of Maryland Baltimore County
© by Pearson Education, Inc. All Rights Reserved. 1 Introduction to Android From “Android: How to Program” By Paul Deitel and Harvey Deitel.
CS378 - Mobile Computing More UI - Part 2. Special Menus Two special application menus – options menu – context menu Options menu replaced by action bar.
Sensors – Part I SE 395/595.
CS378 - Mobile Computing Sensing and Sensors Part 2.
ANDROID L. Grewe Components  Java Standard Development Kit (JDK) (download) (latest version)  AndroidStudio.
Sensors in android. App being more applicable Keeping track of your heart beat while jogging. Pointing the phone camera towards the night sky to know.
CS378 - Mobile Computing Audio.
CS378 - Mobile Computing More UI - Part 2. Special Menus Two special application menus – options menu – context menu Options menu replaced by action bar.
Installation of Visual Studio Android emulator and Android Studio
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors Date: Feb 11, 2016.
Android CERN App Mentors: Łukasz Wasylkowski Timur Pocheptsov Fons Rademakers.
Accelerometer based motion gestures for mobile devices Presented by – Neel Parikh Advisor Committee members Dr. Chris Pollett Dr. Robert Chun Dr. Mark.
How to Use an Android Tablet Well Come To You few Steps For How to Use an Android Tablet?
CS371m - Mobile Computing Sensing and Sensors.
Visual Programming? (and FRIDAY!)
Sensors in Android.
Vijay Kumar Kolagani Dr. Yingcai Xiao
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors
Mobile Device Development
North Attleboro High School
Android Application Audio 1.
Attestation Checkpoint
Android Boot Camp for Developers Using Java, 3E
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors.
APK Downloader
Emulator.
App Inventor Want to learn how to make mobile apps for your Android phone or tablet?
Sensors, maps and fragments:
Vijay Kumar Kolagani Dr. Yingcai Xiao
CS499 – Mobile Application Development
CS371m - Mobile Computing Sensing and Sensors.
IOS App Development.
Android training in Chandigarh. What is ADB ADB stands for Android Debug Bridge. It is a command line tool that is used to communicate with the emulator.
Vijay Kumar Kolagani Dr. Yingcai Xiao
Android Topics Sensors Accelerometer and the Coordinate System
Android Programming Tutorial
Introduction to AppInventor
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors.
Mobile Programming Sensors in Android.
Mobile Programming Dr. Mohsin Ali Memon.
CIS 694/EEC 693 Android Sensor Programming
Presentation transcript:

CS378 - Mobile Computing Sensing and Sensors Part 2

Using Sensors Recall basics for using a Sensor: – Obtain the SensorManager object – create a SensorEventListener for SensorEvents – logic that responds to sensor event – Register the sensor listener with a Sensor via the SensorManager 2

Sensor Best Practices Unregister sensor listeners – when done with Sensor or activity using sensor paused (onPause method) – sensorManager. unregisterListener(sensorListener) – otherwise data still sent and battery resources continue to be used 3

Sensor Best Practices Testing on the emulator Android SDK doesn't provide any simulated sensors 3 rd party sensor emulator 4

SensorSimulator Download the Sensor Simulator tool Start Sensor Simulator program Install SensorSimulator apk on the emulator Start app, connect simulator to emulator, start app that requires sensor data 5

Sensor Simulator 6

Mouse in Sensor Simulator controls phone, feeds sensor data to emulator Can also record sensor data from device and play back on emulator 7

Sensors Best Practices Don't block the onSensorChanged() method – recall the resolution on sensors – 50 updates a second for onSensorChange method not uncommon – when registering listener update is only a hint and may be ignored – if necessary save event and do work in another thread or asynch task 8

Sensors Best Practices verify sensor available before using it use getSensorList method and type ensure list is not empty before trying to register a listener with a sensor 9

Sensors Best Practices Avoid deprecated sensors and methods TYPE_ORIENTATION and TYPE_TEMPERATURE are deprecated as of Ice Cream Sandwich 10

Sensor Best Practices Testing on the emulator Android SDK doesn't provide any simulated sensors 3 rd party sensor emulator 11

SensorSimulator Download the Sensor Simulator tool Start Sensor Simulator program Install SensorSimulator apk on the emulator Start app, connect simulator to emulator, start app that requires sensor data 12

Sensor Simulator 13

Sensor Simulator Mouse in Sensor Simulator controls phone, feeds sensor data to emulator Can also record sensor data from device and play back on emulator 14

Sensor Sample - Moving Ball Place ball in middle of screen Ball has position, velocity, and acceleration acceleration based on linear acceleration sensor update over time, based on equations of motion, but fudged to suit application 15

Sensor Sample - Moving Ball Gross Simplification velocity set equal to acceleration 16

Sensor Sample - Moving Ball Alternate Implementation position updated in separate thread which redraws the view 17

Sensor Sample Draw lines for x and y velocities 18

Demo Using SensorSimulator 19

Sensor Sample - TBBT Inspired by and 20

TBBT Sound Effect App 21

Responding to Events 22

Changing Images Use of an Image View Initial Image set in onCreate new image set in onSensorChange register listener with MediaPlayer on completion reset image 23