The Source for Java Technology Collaboration

Home » java.net Forums » Mobile & Embedded » ME Interest

Thread: motion sensor

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
This question is not answered. Helpful answers available: 2. Correct answers available: 1.

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 2 - Last Post: Dec 15, 2008 12:51 AM by: jaywayjohan Threads: [ Previous | Next ]
warthds

Posts: 7
motion sensor
Posted: Dec 1, 2008 4:37 AM
 
  Click to reply to this thread Reply

HI,

hi, is it possible to to listen to an event with java2me if the resolution of an mobile phone changes through the motion sensor?

for example if i turn the phone about 90 degrees and the phone has an motion sensor.



thanks

sfitzjava

Posts: 263
Re: motion sensor
Posted: Dec 1, 2008 8:20 AM   in response to: warthds
 
  Click to reply to this thread Reply

Depends on the device, and the special APIs it has on it.
Native event calls that the OS might post from a motion sensor may not be visible from JavaME.
If the operator has special hooks into the motion sensor and provides access to it there may be the need to sign your midlet as well.

Now you might be able to do something yourself, by using the MMAPI to capture images from the camera and then do a comparison of the images to determine motion. If the phone auto orientates when capturing the image, you might be able to use the width & height of the captured image to determine a 90deg rotation has occurred.

-Shawn

jaywayjohan

Posts: 95
Re: motion sensor
Posted: Dec 15, 2008 12:51 AM   in response to: warthds
 
  Click to reply to this thread Reply

Hi,

have you tried the Mobile Sensor API? The API gives access to the motion sensor(s). This might do the trick.

For more information about the API:
http://jcp.org/en/jsr/detail?id=256

On some phones it is possible to read a system property to find out if you are in landscape or portrait mode, but this is a less portable solution.

Regards
Johan




 XML java.net RSS