23/10/2015 E.R.Edwards 23/10/2015 Staffordshire University School of Computing Introduction to Android Sensors
23/10/2015 E.R.Edwards 23/10/2015 Staffordshire University School of Computing Hardware Example Program F 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
23/10/2015 E.R.Edwards 23/10/2015 Staffordshire University School of Computing Running Hardware F Download the zip file F Extract creating a folder called Hardware F Create a new Android project (from an existing file) F Create an emulator with several sensors. F Run the program on the emulator and test some of the sensors (note not all work on the emulator) F Check with your lecturer to see it working on an actual device.
23/10/2015 E.R.Edwards 23/10/2015 Staffordshire University School of Computing Additonal Resources F Sample code from Developer.android.com –AccelerometerPlayActivity meterPlay/src/com/example/android/accelerometerplay/A ccelerometerPlayActivity.htmlhttp://developer.android.com/resources/samples/Accelero meterPlay/src/com/example/android/accelerometerplay/A ccelerometerPlayActivity.html F Sensor simulator to attach to android emulator or