Upload
morgan-peters
View
221
Download
7
Embed Size (px)
Citation preview
20/04/23E.R.Edwards 20/04/23 Staffordshire UniversitySchool 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
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.
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