Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Posts: 24
Registered: ‎04-20-2011
My Device: Playbook
Accepted Solution

Playbook rotation/orientation/tilt WebWorks API?

Where can I find the WebWorks API for rotation/orientation/tilt? In other words, how can I detect programmatically the rotation of my Playbook around the three axes? Apps such as "What's up?" clearly use such an API. Thanks.

Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Playbook rotation/orientation/tilt WebWorks API?

It sounds like you are looking for the DeviceMotion API to capture (x, y, z) motion.


Here's a demo:



Otherwise, if you are looking for portrait/landscape orientation, you can use the window.onorientationchange event:


Follow me on Twitter: @n_adam_stanley
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Posts: 24
Registered: ‎04-20-2011
My Device: Playbook

Re: Playbook rotation/orientation/tilt WebWorks API?

[ Edited ]

Thanks. I trust the BlackBerry DeviceMotion API also captures device rotation around the (x, y, z) axes? Will check out the demo later today.


Update: Yes, it works as expected. Nice....