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.

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

Programming with Android: System Services Luca Bedogni Marco Di Felice Dipartimento di Scienze dell’Informazione Università di Bologna.
Mobile Handset Sensors. Outline Overview GPS Other Sensors 2.
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.
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.
Programming Mobile Applications with Android September, Albacete, Spain Jesus Martínez-Gómez.
Mobile Application Development Selected Topics – CPIT 490
Lecture # 9 Hardware Sensor. Topics 2  SensorManger & Sensor  SensorEvent & SensorEventListener  Example Application.
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.
Sensors – Part I SE 395/595.
CS378 - Mobile Computing Sensing and Sensors Part 2.
INEMO™ Demonstration Kit DOF (Degrees of Freedom) platform  The STEVAL-MKI062V2 combines accelerometers, gyroscopes and magnetometers with pressure.
Location. GPS Global Positioning System – At least 4 satellites typically used 3 required extra for error detection and altitude typically accurate within.
Mobile Device Development Camera and Sensors Dr.YingLiang Ma.
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.
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.
Current Works Corrected unit conversions in code Found an error in calculating offset (to zero sensors) – Fixed error, but still not accurately integrating.
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.
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors Date: Feb 11, 2016.
MOBILE SENSORS BY OLIVIA TUFFS-MOULDS. ACCELEROMETER An accelerometer is a device, hidden in the motherboard of a smartphone, is a sensor which detects.
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.
C ONTEXT AWARE SMART PHONE YOGITHA N. & PREETHI G.D. 6 th SEM, B.E.(C.S.E) SIDDAGANGA INSTITUTE OF TECHNOLOGY TUMKUR
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.
Understanding Mobile Devices, Interactions, and Tools Lesson 1.
CPE 490/590 – Smartphone Development
Environment Care System -- Home Automation. Environment Care System Features Air quality data live indicate on the control terminal Detect available with.
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.
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.
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.
Building IoT apps with Microsoft Band and Xamarin
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors.
Walk n’ Play Group #8 - Team Murali Krishna Goli Viswanath Patimalla
Sensors, maps and fragments:
Goal : Develop a software that converts arm movements into messages
Vijay Kumar Kolagani Dr. Yingcai Xiao
Finch Robot Class L4 How do I… ? LED color (Range 0 to 100)
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.
Vijay Kumar Kolagani Dr. Yingcai Xiao
MEMs Sensors Max Tesch.
MEMs Sensors Max Tesch.
Android Topics Sensors Accelerometer and the Coordinate System
Android Programming Tutorial
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors.
Mobile Programming Sensors in Android.
Preference Activity class
Presentation transcript:

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 and features, vary from device to device. Some of the sensors that applications can interact with include the magnetic sensor, which can be used as a compass, and the accelerometer sensor that can detect motion. You can access the device sensors through the SensorManager object (android.hardware.SensorManager).The SensorManager object listens for data from the sensors. It is a system service, and you can retrieve an instance retrieved with the getSystemService() method, as shown here: SensorManager sensors =(SensorManager) getSystemService(Context.SENSOR_SERVICE);

Working with different Snsors The Sensor class (android.hardware.Sensor) defines a number of identifiers for the various sensors that you might find on a device. Not all sensors are available on each device. Some interesting sensors are listed on next slide

TYPE_ACCELEROMETER: Measures acceleration in three directions; values are in SI units (m/s2). TYPE_GYROSCOPE: Measures angular orientation in three directions; values are angles in degrees. TYPE_LIGHT: Measures ambient light; values are in SI lux units. TYPE_MAGNETIC_FIELD: Measures magnetism in three directions; the compass values are in micro-Tesla (uT). TYPE_PRESSURE: Measures barometric pressure. TYPE_PROXIMITY: Measures the distance to an object; values are in centimeters, or “near” versus “far.” TYPE_RELATIVE_HUMIDITY: Measures the relative humidity. TYPE_AMBIENT_TEMPERATURE: Measures temperature

Configuring Androidmainfest.xml for sensors The tag in the Android manifest file is used to indicate which sensors are required by your application. For example, to declare that your application requires the barometer, but can optionally use the gyroscope, you add the following to your application’s manifest file: <uses-feature android:name="android.hardware.sensor.gyroscope" android:required="false" />

Acquiring a reference to a sensor You can acquire a reference to a specific sensor using the SensorManager class method called getDefaultSensor().This method takes a sensor type parameter. For example,you can acquire the default accelerometer sensor as follows Sensor accelSensor= sensors.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);

Reading Sensors Data After you have a valid Sensor object, you can read the sensor data periodically. Sensor values are sent back to an application using a SensorEventListener object that the application must implement and register using the registerListener() method. boolean isAvailable = sensors.registerListener(SensorsActivity.this, accelSensor, SensorManager.SENSOR_DELAY_NORMAL);