Tuesday, March 5, 2013

Handling Sensors in Android

Hi everyone!

Today I was looking at the APIs available for handling the sensors and I came across few classes in Android SDK that might be useful for the project. I am listing the classes and their brief functions.

i) android.hardware.camera
                A class that enables application to interact with the camera to snap a photo, acquire images for a preview screen, and modify parameters used to govern how the camera operates.

ii) android.hardware.SensorManager
           A class that permits access to the sensors available within the Android platform. Not every Android-equipped device will support all of the sensors in the SensorManager, though it's exciting to think about the possibilities.

iii) android.hardware.SensorListener
           An interface implemented by a class that wants to receive updates to sensor values as they change in real time. An application implements this interface to monitor one or more sensors available in the hardware. For example, the code in this article contains a class that implements this interface to monitor the orientation of the device and the built-in accelerometer.

iv) android.media.MediaRecorder
           A class, used to record media samples, that can be useful for recording audio activity within a specific location (such as a baby nursery). Audio clippings can also be analyzed for identification purposes in an access-control or security application.

v) android.FaceDetector
           A class that permits basic recognition of a person's face as contained in a bitmap. You cannot get much more personal than your face. Using this as a device lock means no more passwords to remember — biometrics capability on a cell phone.

vi) android.os.*
                   A package containing several useful classes for interacting with the operating environment, including power management, file watcher, handler, and message classes. Like many portable devices, Android-powered phones can consume a tremendous amount of power. Keeping a device "awake" at the right time to be in position to monitor an event of interest is a design aspect that deserves attention up front.

No comments:

Post a Comment