Vijay Kumar Kolagani Dr. Yingcai Xiao

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

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
Introduction to Smartphone Sensors
Android Programming Beomjoo Seo Sep., 12 CS5248 Fall 2012.
2. Setting Up Your Android Development Environment.
ANDROID PROGRAMMING MODULE 1 – GETTING STARTED
UFCFX5-15-3Mobile Device Development Android Development Environments and Windows.
Setting up the Development Environment Copyright © SUPINFO. All rights reserved Preparation.
App Development on Android. Contents  First Milestone  Second Milestone  Third Milestone  Last Milestone 
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
Programming Mobile Applications with Android September, Albacete, Spain Jesus Martínez-Gómez.
Mobile Application Development Selected Topics – CPIT 490
Android Programming By Mohsen Biglari Android Programming, Part1: Introduction 1 Part1: Introduction By Mohsen Biglari.
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)
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.
Android architecture & setting up. Android operating system comprises of different software components arranges in stack. Different components of android.
CS378 - Mobile Computing Sensing and Sensors Part 2.
Android Development Environment Environment/tools Windows Eclipse IDE for Java Developers (v3.5 Galileo) Java Platform (JDK 6 Update 18) Android.
Mobile Device Development Camera and Sensors Dr.YingLiang Ma.
 Installation of Android Development Environment  Creating the App with OpenGL ES API  Running the App on Emulator Android App Development.
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.
TODAY Android Studio Installation Getting started Creating your 1 st App Beginning to understanding Intents.
Sensors For Mobile Phones  Ambient Light Sensor  Proximity Sensor  GPS Receiver Sensor  Gyroscope Sensor  Barometer Sensor  Accelerometer Sensor.
Installation of Visual Studio Android emulator and Android Studio
CS378 - Mobile Computing Sensing and Sensors Part 2.
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors Date: Feb 11, 2016.
Understanding Mobile Devices, Interactions, and Tools Lesson 1.
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
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.
Introduction to Android Programming
Android Android Sensors Android Sensors: – Accelerometer – Gravity sensor – Linear Acceleration sensor – Magnetic Field sensor – Orientation.
Sensors in Android.
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.
Mobile Device Development
Sai Goud Durgappagari Dr. Yingcai Xiao
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors.
Development-Introduction
Sensors, maps and fragments:
Goal : Develop a software that converts arm movements into messages
Vijay Kumar Kolagani Dr. Yingcai Xiao
CS499 – Mobile Application Development
Mobile Handset Sensors
CS371m - Mobile Computing Sensing and Sensors.
How to Fix Android File Transfer Not Working on Mac?
Sai Goud Durgappagari, VIJAY KOLAGANI, Dr. Yingcai Xiao
Vijay Kumar Kolagani Dr. Yingcai Xiao
CS323 Android Getting Started
More ISP At a Glance.
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.
Android Intents & Sensors
Korea Software HRD Center
Mobile Programming Sensors in Android.
CMPE419 Mobile Application Development
CIS 694/EEC 693 Android Sensor Programming
Presentation transcript:

Vijay Kumar Kolagani Dr. Yingcai Xiao Android Vijay Kumar Kolagani Dr. Yingcai Xiao

Development Tools Android software are developed with IDEs (Integrated Development Environment). Java Development Kit (JDK) http://www.Oracle.Com/technetwork/java/javase/downloads/index-jsp-138363.Html Android Software Development Kit includes the Eclipse Android IDE / Android Studio and the Android Development Toolkit (ADT) Eclipse for Android developers : http://www.Eclipse.Org/downloads/eclipse-packages/ Android Studio : https://developer.Android.Com/studio/index.html

Setup Android Studio Android studio : https://developer.Android.Com/studio/index.html Download the dmg file and open it to install. Select standard installation. Start Android Studio. Select an existing sample (say, Universal Music Player). Update any components when asked to do so. Try other examples in the studio.

Setup Android Studio To interact with your Android phone on a computer, download the Vysor Chrome app. https://chrome.google.com/webstore/detail/vysor/gidgenkbbabolejbgbpnhbimgjbffefm?hl=en-US On your Android phone: Settings Develop options (if your don’t see the options, go to “About Phone”, click “Build number” several times until it says you are now a developer. :-). Turn on USB Debugging Connect you phone to the computer’s USB port. Now go to Chrome (After installing the plugin) chrome://apps/ Select Vysor

Android Interactions Voice Control Touch Screen Sensor Control

Sensors Overview The Android platform supports three broad categories of sensors: Motion sensors: these sensors measure acceleration forces and rotational forces along three axes. This category includes accelerometers, gravity sensors, gyroscopes, and rotational vector sensors. Environmental sensors: these sensors measure various environmental parameters, such as ambient air temperature and pressure, illumination, and humidity. This category includes barometers, photometers, and thermometers. Position sensors: these sensors measure the physical position of a device. This category includes orientation sensors and magnetometers.

Using Android Studio IDE

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.

Identifying sensors and sensor capabilities. To use sensor-related APIs we perform two basic task: Identifying sensors and sensor capabilities. Monitor sensor events and write handlers for them.

Identifying sensors and sensor capabilities Create an instance of the sensormanager class by calling the getsystemservice() method and passing in the sensor_service argument. We can 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 for example: private SensorManager mSensorManager; ... mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE); if (mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER) != null){ // Success! There's a Accelerometer. } else { // Failure! No Accelerometer. }

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() this methods are called whenever the following occurs: 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 It measures the acceleration force in m/s2 that is applied to a device on all three physical axes (x, y, and z), including the force of gravity. Public void onsensorchange(sensorevent sensorevent) {     sensor mysensor = sensorevent.Sensor;       If (mysensor.Gettype() == sensor.Type_accelerometer) {         float x = sensorevent.Values[0];         Float y = sensorevent.Values[1];         Float z = sensorevent.Values[2];     } }

Using Unity

Check if it is android platform or not #if UNITY_ANDROID Currentplatformandroid = true; #Else Currentplatformandroid = false; #Endif Measure linear acceleration of a device in three-dimensional space. Input.Acceleration.X; // X axis Input.Acceleration.Y; // Y axis Input.Acceleration.Z; // Z axis

References https://code.tutsplus.com/tutorials/using-the-accelerometer-on-android-- mobile-22125 https://developer.android.com/about/versions/nougat/index.html https://docs.unity3d.com/ScriptReference/Input-acceleration.html