CS499 – Mobile Application Development

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

Touchdevelop api api acceleromete r measure acceleration Disclaimer: This document is provided as-is. Information and views expressed in this document,
Slide Ruler. ? X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.
Sensors.  Hardware devices that take measurements of the physical environment  Some examples  3-axis Accelerometer  3-axis Magnetic field sensor 
Cosc 5/4730 Input Keyboard, touch, and Accelerometer.
Real-Time Sensing on Android Reliable Mobile Systems Group Fiji Systems Inc. Yin Yan, Shaun Cosgrove, Ethan Blanton, Steven Y. Ko, Lukasz Ziarek
Introduction to Smartphone Sensors
Android sensors.
The Accelerometer and Gyroscope
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.
Android Sensors & Async Callbacks Jules White Bradley Dept. of Electrical and Computer Engineering Virginia Tech
Introduction to Mobile Sensing with Smartphones Uichin Lee April 22, 2013.
Programming Mobile Applications with Android September, Albacete, Spain Jesus Martínez-Gómez.
Getting Started with Android APIs Ivan Wong. Motivation - “Datasheet” - Recently exposed to what’s available in Android - So let’s see what API’s are.
Cosc 5/4730 Input Keyboard, touch, and Accelerometer.
Mobile Application Development Selected Topics – CPIT 490
Lecture # 9 Hardware Sensor. Topics 2  SensorManger & Sensor  SensorEvent & SensorEventListener  Example Application.
Mobile Programming Lecture 9 Bound Service, Location, Sensors, IntentFilter.
1 Localization and Sensing Nilanjan Banerjee Mobile Systems Programming (Acknowledgement: Jules White) University of Arkansas Fayetteville, AR
Sensing. Possible sensors on devices – Documented in SensorEvent class Accelerometer (m/s 2 ) – acceleration in x, y, z axes Magnetic Field (micro Tesla)
App Inventor You are going to use App Inventor to make an application for your phone Smart Phone ‘s can hold many entertaining apps due to the amount of.
Doodlz App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
1 CMSC 628: Introduction to Mobile Computing Nilanjan Banerjee Introduction to Mobile Computing University of Maryland Baltimore County
Sensors – Part I SE 395/595.
로봇을 조종하자 3/4 UNIT 17 로봇 SW 콘텐츠 교육원 조용수. 학습 목표 스마트 폰의 센서를 사용할 수 있다. 2.
CS378 - Mobile Computing Sensing and Sensors Part 2.
Mobile Device Development Camera and Sensors Dr.YingLiang Ma.
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.
Sensors Nasrullah Khan Niazi. Using Device Sensors The Android SDK provides access to raw data from sensors on the device.The sensors,and their precision.
Sensors For Mobile Phones  Ambient Light Sensor  Proximity Sensor  GPS Receiver Sensor  Gyroscope Sensor  Barometer Sensor  Accelerometer Sensor.
App Inventor You are going to use App Inventor to make an application for your phone Smart Phone ‘s can hold many entertaining apps due to the amount of.
CS378 - Mobile Computing Sensing and Sensors Part 2.
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors Date: Feb 11, 2016.
App Inventor You are going to use App Inventor to make an application for your phone Smart Phone ‘s can hold many entertaining apps due to the amount of.
CPE 490/590 – Smartphone Development
Android Fundamentals. What is Android Software stack for mobile devices Software stack for mobile devices SDK provides tools and APIs to develop apps.
CHAPTER 8 Sensors and Camera. Chapter objectives: Understand Motion Sensors, Environmental Sensors and Positional Sensors Learn how to acquire measurement.
Mobile Software Development for Android - I397 IT COLLEGE, ANDRES KÄVER, WEB:
CS371m - Mobile Computing Sensing and Sensors.
The Doodlz app enables you to paint by dragging one or more fingers across the screen. The app provides options for setting the drawing color.
Android Android Sensors Android Sensors: – Accelerometer – Gravity sensor – Linear Acceleration sensor – Magnetic Field sensor – Orientation.
Sensors in Android.
Vijay Kumar Kolagani Dr. Yingcai Xiao
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors
App Inventor You are going to use App Inventor to make an application for your phone Smart Phone ‘s can hold many entertaining apps due to the amount of.
App Inventor You are going to use App Inventor to make an application for your phone Smart Phone ‘s can hold many entertaining apps due to the amount of.
App Inventor You are going to use App Inventor to make an application for your phone Smart Phone ‘s can hold many entertaining apps due to the amount of.
Mobile Software Development for Android - I397
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors.
Walk n’ Play Group #8 - Team Murali Krishna Goli Viswanath Patimalla
What's Happening Today Working with Images
Goal : Develop a software that converts arm movements into messages
Vijay Kumar Kolagani Dr. Yingcai Xiao
Location Service and Sensors
App Inventor You are going to use App Inventor to make an application for your phone Smart Phone ‘s can hold many entertaining apps due to the amount of.
Mobile Handset Sensors
CS371m - Mobile Computing Sensing and Sensors.
CIS 470 Mobile App Development
Vijay Kumar Kolagani Dr. Yingcai Xiao
CIS 470 Mobile App Development
CIS 470 Mobile App Development
Android Topics Sensors Accelerometer and the Coordinate System
Android Programming Tutorial
CIS 493/EEC 492 Android Sensor Programming
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors.
CIS 493/EEC 492 Android Sensor Programming
CIS 493/EEC 492 Android Sensor Programming
Mobile Programming Sensors in Android.
CIS 694/EEC 693 Android Sensor Programming
Presentation transcript:

CS499 – Mobile Application Development Fall 2013 Sensors

Sensors Hardware devices that take measurements of the physical environment For example: 3-axis Accelerometer 3-axis Magnetic field sensor Temperature sensor Proximity sensor Orientation sensor Light sensor

SensorManager System service that manages device’s sensors Determine which sensors are available on a device. Determine an individual sensor's capabilities, such as its maximum range, manufacturer, power requirements, and resolution. Acquire raw sensor data and define the minimum rate at which you acquire sensor data. Register and unregister sensor event listeners that monitor sensor changes. Get instance with getSystemService(Context.SENSOR_SERVICE) Access specific sensor with SensorManager.getDefaultSensor(int type);

Some Sensor Type Constants TYPE_ACCELEROMETER TYPE_GRAVITY TYPE_GYROSCOPE TYPE_LIGHT TYPE_MAGNETIC_FIELD TYPE_PRESSURE TYPE_PROXIMITY TYPE_TEMPERATURE

Registering for SensorEvents Use SensorManager to register/unregister for SensorEvents public boolean registerListener( SensorEventListener listener, Sensor sensor, int rate) Registers a SensorEventListener for given sensor public void unregisterListener(SensorEventListener listener, Sensor sensor) Unregisters listener for Sensor

SensorEvent Represents a Sensor event Hold Sensor-specific data e.g. sensor’s type, timestamp, accuracy, measurement data,…

SensorEventListener Interface for SensorEvent callbacks void onAccuracyChanged(Sensor sensor, int accuracy) Called when the accuracy of a sensor has changed void onSensorChanged(SensorEvent event) Called when sensor values have changed

Sensing Motion The Android platform provides several sensors that let you monitor the motion of a device. Two of these sensors are always hardware-based (the accelerometer and gyroscope), Three of these sensors can be either hardware-based or software-based (the gravity, linear acceleration, and rotation vector sensors).  Useful for monitoring device movement, such as tilt, shake, rotation, or swing http://developer.android.com/guide/topics/sensors/sensors_motion.html

Sensor Coordinate System When device is flat, faceup on a table, axes run X – right to left Y – top to bottom Z – up to down Coordinate system does not depend on device orientation (portrait vs landscape)

Accelerometer Example public class SensorShowValuesActivity extends Activity implements SensorEventListener { … public void onCreate(Bundle savedInstanceState) { mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE); mAccelerometer = mSensorManager.getDefaultSensor( Sensor.TYPE_ACCELEROMETER); }

Accelerometer Example … protected void onResume() { super.onResume(); mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_NORMAL); } protected void onPause() { mSensorManager.unregisterListener(this); super.onPause();

Accelerometer Example public void onSensorChanged(SensorEvent event) { if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) { long actualTime = System.currentTimeMillis(); if (actualTime - mLastUpdate > 500) { mLastUpdate = actualTime; float x = event.values[0], y = event.values[1], z = event.values[2]; xView.setText(String.valueOf(x)); yView.setText(String.valueOf(y)); zView.setText(String.valueOf(z)); … }

Accelerometer When device is lying flat, face-up on a table, accelerometer ideally reports the following forces: x approx 0 m/s2 y approx 0 m/s2 z approx 9.81 m/s2 But these values will vary from natural movements, non-flat surfaces, noise, …

Filtering Accelerometers Two common data filters: Low-pass filters Deemphasize transient forces changes, emphasize constant forces components High-pass filters Emphasize transient forces changes, Deemphasize constant forces components - remove the effect of gravity e.g. game controllers