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.

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 Create apps ON your phone! Peli de Halleux (Senior Software Developer) Microsoft Research.
Mobile Handset Sensors. Outline Overview GPS Other Sensors 2.
Creating Mobile Apps with App Inventor! Day 4 Google search Kris Gordon Ludlow for links.
Sensors.  Hardware devices that take measurements of the physical environment  Some examples  3-axis Accelerometer  3-axis Magnetic field sensor 
Real-Time Sensing on Android Reliable Mobile Systems Group Fiji Systems Inc. Yin Yan, Shaun Cosgrove, Ethan Blanton, Steven Y. Ko, Lukasz Ziarek
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.
Phone guide. Sensor Thermometer thermometer for measuring ambient temperature. However, there's a thermometer in pretty much any smartphone, and some.
Phone guide for people over 65. Not Smart Phones.
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.
Android Sensors & Async Callbacks Jules White Bradley Dept. of Electrical and Computer Engineering Virginia Tech
Win8 on Intel Programming Course Modern UI : Sensors Cédric Andreolli Intel Software.
July 25, 2010 SensorKDD Activity Recognition Using Cell Phone Accelerometers Jennifer Kwapisz, Gary Weiss, Samuel Moore Department of Computer &
Lecture # 9 Hardware Sensor. Topics 2  SensorManger & Sensor  SensorEvent & SensorEventListener  Example Application.
EMS Survey instruments The How, What and When Presented by James Tweedie, GeoMEM Ltd.
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.
A sensor for measuring the acceleration of a moving or vibrating body.
1 CMSC 628: Introduction to Mobile Computing Nilanjan Banerjee Introduction to Mobile Computing University of Maryland Baltimore County
Sensors – Part I SE 395/595.
CS378 - Mobile Computing Sensing and Sensors Part 2.
Final Year Projects Prof. Joseph Ng. Mobile Application Development Sensor Programming Android Platform Preferred Applications on the following domains:
Ambient Light Sensor The ambient light sensor is something that can detect the brightness of the phone screen. This is helpful for if your eyes are hurting.
A CCELEROMETER. Accelerometers are devices that can measure acceleration, but in smartphones, they're able to detect changes in orientation and tell the.
The ambient light sensor in a smart phone is what measures how bright the light is. It’s the phones software that adjusts the brightness in the display.
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.
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.
1.Accelerometer:Accelerometer in an iPhone. Definition: An accelerometer is a sensor which measures the tilting motion and orientation of a mobile phone.
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.
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.
Make an information leaflet about what the sensors do in a Smart Phone for people over 65 years of age. You can use PowerPoint, Word or Publisher.
The sensors guide fingerprint sensors rate monitor gyroscope camera
Accelerometer based motion gestures for mobile devices Presented by – Neel Parikh Advisor Committee members Dr. Chris Pollett Dr. Robert Chun Dr. Mark.
CPE 490/590 – Smartphone Development
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.
CHAPTER 8 Sensors and Camera. Chapter objectives: Understand Motion Sensors, Environmental Sensors and Positional Sensors Learn how to acquire measurement.
Chapter 8 Sensors and Camera. Figure 08.01: The Accelerometer can gauge the orientation of a stationary device.
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.
Smartphone sensors Gyroscope: The gyroscope is a sensor that can provide orientation information with great precision. Magnetometer: It is able to detect.
Mobile phone sensors. Sensors Sensors gyroscope The gyroscope is a sensor that can provide orientation information as well. This sensor can tell how.
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.
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors.
Sensors, maps and fragments:
Goal : Develop a software that converts arm movements into messages
Vijay Kumar Kolagani Dr. Yingcai Xiao
CS499 – Mobile Application Development
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.
Dead Reckoning, a location tracking app for Android™ smartphones Nisarg Patel Mentored by Adam Schofield and Michael Caporellie Introduction Results (cont.)
Vijay Kumar Kolagani Dr. Yingcai Xiao
Android Topics Sensors Accelerometer and the Coordinate System
Android Programming Tutorial
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors.
Android Intents & Sensors
Mobile Programming Sensors in Android.
Device,Network, Vibration, Console, Accelerometer
CIS 694/EEC 693 Android Sensor Programming
Presentation transcript:

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 the name of the constellation in focus. Tilting the device to control the car wheel in a racing game. Checking the current altitude while hiking. sensors All these suggest that most likely the mobile app here are using sensors to provide you with a seventh sense.

What are sensors? Sensors are not just one that make a device smarter Sensors are components of a device that are capable of detecting and measuring changes in & around the device. Various smartphone sensors Global Positioning System(GPS) gyroscope proximity sensors Near Field Communication(NFC) gravity sensors electronic compass

Look through Various sensors supported by the Android platform Explore the android sensor framework that let us access these sensors.

Android platform classifies sensors into motion, position & environment sensors Accelerometer Gyroscope Rotation Vector sensor Gravity sensor Proximity sensor Orientation sensor Magnetometer Light sensors Ambient temperature sensor Pressure sensor Humidity sensor Motion sensors Position sensors Environment sensors

Motion sensors Motion sensors-detect device movement by measuring acceleration & rotational forces along the three dimensions. Position sensors Position sensors-measure the physical position of the device. Environment sensors Environment sensors-detect changes in the environmental parameters such as temperature, humidity & pressure.

hardware sensors. Sensors such as gyroscope & temperature have a physical component plugged in the device circuitry.so called hardware sensors. software sensors. Gravity & orientation rely on hardware sensors for raw data & process this data to provide some unique sensory information. They are known as software sensors.

Let us briefly discuss common device sensors Accelerometer: Accelerometer: motion sensor;measure acceleration in any of the 3 dimensions.used to detect events such as shake & move. Gyroscope: Gyroscope: motion sensor; angular acceleration.used to detect event such as tilt & rotate. so more useful for gaming app where there is a need for high-precision tracking of rotation,roll. Proximity sensors: Proximity sensors: position sensor ;use to determine how close the device is to users face.commonly used to turn off the screen when user answers a call.thus ensures longer battery life & prevent any accidental inputs.

Magnetometer: Magnetometer: position sensor; detect device orientation with respect to the earth magnetic field. Light sensors: Light sensors: environment sensor used to provide appropriate screen brightness by optimizing it to the external environment. Saves power & a soothing experience to the user’s eyes.

Sensor Framework You can access these sensors and acquire raw sensor data by using the Android sensor framework. The sensor framework is part of the android.hardware package and includes the following classes and interfaces:

SensorManager You can use this class to create an instance of the sensor service. This class provides various methods for accessing and listing sensors, registering and unregistering sensor event listeners, and acquiring orientation information. This class also provides several sensor constants that are used to report sensor accuracy, set data acquisition rates, and calibrate sensors.

Sensor You can use this class to create an instance of a specific sensor. This class provides various methods that let you determine a sensor's capabilities.

SensorEvent The system uses this class to create a sensor event object, which provides information about a sensor event. A sensor event object includes the following information: the raw sensor data, the type of sensor that generated the event, the accuracy of the data, and the timestamp for the event.

SensorEventListener You can use this interface to create two callback methods that receive notifications (sensor events) when sensor values change or when sensor accuracy changes.

In a typical application you use these sensor-related APIs to perform two basic tasks: Identifying sensors and sensor capabilities. Monitor sensor events

Identifying Sensors and Sensor Capabilities The Android sensor framework provides several methods that make it easy for you to determine at runtime which sensors are on a device. To identify the sensors that are on a device you first need to get a reference to the sensor service. To do this, you create an instance of the SensorManager class by calling the getSystemService() method and passing in the SENSOR_SERVICE argument.

Next, you can get a listing of every sensor on a device by calling the getSensorList() method and using the TYPE_ALL constant. If you want to list all of the sensors of a given type, you could use another constant instead of TYPE_ALL such as TYPE_GYROSCOPE, TYPE_LINEAR_ACCELERATION, or TYPE_GRAVITY.

You can also determine whether a specific type of sensor exists on a device by using the getDefaultSensor() method and passing in the type constant for a specific sensor. If a device has more than one sensor of a given type, one of the sensors must be designated as the default sensor. If a default sensor does not exist for a given type of sensor, the method call returns null, which means the device does not have that type of sensor.

The following code checks whether there's a magnetometer on a device:

Monitoring Sensor Events To monitor raw sensor data you need to implement two callback methods that are exposed through the SensorEventListener interface: onAccuracyChanged() and onSensorChanged(). The Android system calls these methods whenever the following occurs:  A sensor's accuracy changes.  A sensor reports a new value.

A sensor's accuracy changes. In this case the system invokes the onAccuracyChanged() method, providing you with a reference to the Sensor object that changed and the new accuracy of the sensor. Accuracy is represented by one of four status constants: SENSOR_STATUS_ACCURACY_LOW, SENSOR_STATUS_ACCURACY_MEDIUM, SENSOR_STATUS_ACCURACY_HIGH, or SENSOR_STATUS_UNRELIABLE.

A sensor reports a new value. In this case the system invokes the onSensorChanged() method, providing you with a SensorEvent object. A SensorEvent object contains information about the new sensor data, including: the accuracy of the data, the sensor that generated the data, the timestamp at which the data was generated, and the new data that the sensor recorded.

Accelerometer An acceleration sensor measures the acceleration applied to the device, including the force of gravity. to get an instance of the default acceleration sensor:

An acceleration sensor determines the acceleration that is applied to a device (Ad) by measuring the forces that are applied to the sensor itself (Fs) using the following relationship: Ad = - ∑Fs / mass The force of gravity is always influencing the measured acceleration according to the following relationship: Ad = -g - ∑F / mass

when the device is sitting on a table (and not accelerating), the accelerometer reads a magnitude of g = 9.81 m/s2. when the device is in free fall and therefore rapidly accelerating toward the ground at 9.81 m/s2, its accelerometer reads a magnitude of g = 0 m/s2. To measure the real acceleration of the device, the contribution of the force of gravity must be removed from the accelerometer data. This can be achieved by applying a high-pass filter. Conversely, a low-pass filter can be used to isolate the force of gravity.