Using JSR 256 (Mobile Sensor) in Java ME
We’ve reached an interesting age of mobile phones. The phone is no longer the most commonly used function of a mobile phone. Now, we use our phones for everything from instant messaging and email to social networking and gaming. Part of what makes all these extra features possible are all the extra sensors that come wired into our phones nowadays. One of the most ubiquitous sensors that ship with mobile devices is the accelerometer. We all know this can be used to change the orientation of the screen from landscape to portrait or it can be used to control your battleship in some futuristic game. Some background sensors that you may not have even thought about include the network field intensity monitor and the battery charge monitor. For obvious reasons, these can be very useful for developers to get a handle on. Some devices in the future will even ship with a thermometer or heart rate monitor. The possibilities are really endless when you think about how fast technology is developing and the kinds of things people will require in their mobile devices.
At AT&T, we are requiring that all of our devices coming down the pipeline support APIs to access these sensors. In the Java ME application platform, this comes in the form of JSR 256, or the Mobile Sensor API. This API is included in the packages javax.microedition.sensor & javax.microedition.sensor.control. For more technical information about JSR 256, please see our tech tip here.