|
Replies:
2
-
Last Post:
Dec 15, 2008 12:51 AM
by: jaywayjohan
|
Threads:
[
Previous
|
Next
]
|
|
|
|
|
|
motion sensor
Posted:
Dec 1, 2008 4:37 AM
|
|
|
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
|
|
|
|
|
|
|
Re: motion sensor
Posted:
Dec 1, 2008 8:20 AM
in response to: warthds
|
|
|
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
|
|
|
|
|
|
|
|
Re: motion sensor
Posted:
Dec 15, 2008 12:51 AM
in response to: warthds
|
|
|
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
|
|
|
|
|