23/10/2015 e.r.edwards 23/10/2015 staffordshire university school of computing introduction to...

4
28/08/22 E.R.Edwards 28/08/22 Staffordshire University School of Computing Introduction to Android Sensors

Upload: morgan-peters

Post on 02-Jan-2016

221 views

Category:

Documents


7 download

TRANSCRIPT

Page 1: 23/10/2015 E.R.Edwards 23/10/2015 Staffordshire University School of Computing Introduction to Android Sensors

20/04/23E.R.Edwards 20/04/23 Staffordshire UniversitySchool of Computing

Introduction to Android

Sensors

Page 2: 23/10/2015 E.R.Edwards 23/10/2015 Staffordshire University School of Computing Introduction to Android Sensors

20/04/23E.R.Edwards 20/04/23 Staffordshire UniversitySchool of Computing

Hardware Example Program

Hardware.java is the start activity – Activates Menu.java– 3 menu items

• Battery.java – demonstrates Battery sensors– Health, charging status, temperature

• Wifi.java – demonstrates Wifi – WiFi scan, signal strength

• Sensors.java– Accelerometer, Light, Magnetic Field,

Temperature, Orientation, proximity

Page 3: 23/10/2015 E.R.Edwards 23/10/2015 Staffordshire University School of Computing Introduction to Android Sensors

20/04/23E.R.Edwards 20/04/23 Staffordshire UniversitySchool of Computing

Running Hardware

Download the zip file Extract creating a folder called Hardware Create a new Android project (from an

existing file) Create an emulator with several sensors. Run the program on the emulator and test

some of the sensors (note not all work on the emulator)

Check with your lecturer to see it working on an actual device.

Page 4: 23/10/2015 E.R.Edwards 23/10/2015 Staffordshire University School of Computing Introduction to Android Sensors

20/04/23E.R.Edwards 20/04/23 Staffordshire UniversitySchool of Computing

Additonal Resources

Sample code from Developer.android.com– AccelerometerPlayActivity

• http://developer.android.com/resources/samples/AccelerometerPlay/src/com/example/android/accelerometerplay/AccelerometerPlayActivity.html

Sensor simulator to attach to android emulator

• http://code.google.com/p/openintents/wiki/SensorSimulator