aspose file tools*
The moose likes Java Micro Edition and the fly likes Handset orientation detection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Handset orientation detection" Watch "Handset orientation detection" New topic

Handset orientation detection

Mahmudur Rahman

Joined: Aug 06, 2007
Posts: 2
Is there a way I can detect the orientation of the handset with respect to the user i.e. if the handset is held horizontal / vertical?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15632

That depends on the device. The Apple iPhone has a builtin accelerometer that handles that function, but it's not available to application programmers - at least yet.

My HTC phone doesn't have motion-detection hardware, but if you slide out the QWERTY keyboard, an event is fired that cause the screen image to rotate. I don't know how to intercept it (it's probably a Win/CE event anyway), but I suspect I could tap into it if I needed to.

Most phones aren't smart enough to know anything at all about how the user is holding them. Newer phones are somewhat more likely to have sensor abilities, however as the cost of hardware continues to drop.

Customer surveys are for companies who didn't pay proper attention to begin with.
Syam Sathyan George
Ranch Hand

Joined: Apr 26, 2006
Posts: 64
not yet in j2me!!!, Believe me, i am waiting for this to come out, might become a JSR soon.

(My boss is a Jewish carpenter)
I agree. Here's the link:
subject: Handset orientation detection
Similar Threads
J2ME APIs supported in NEC - 3G Phones
MS Word Tables to HTML Tables
Location API - Orientation example
How is Android doing in your Country?