O'Reilly logo

Sencha Touch Cookbook - Second Edition by Ajit Kumar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with orientation

If you have looked at car game applications on mobile phones and liked the idea of using the phone as a way to steer your car, you will know that one of the uses of interfacing with the device's orientation API, using which you can get to know about the current orientation and also the device, is that it tells you about the new orientation as soon as it detects the change.

Sencha supports two implementations of orientation APIs, one using HTML 5 APIs as outlined in http://dev.w3.org/geo/api/spec-source-orientation.html, the specification of W3C, and the second where it works with the WebView.

In this recipe, we will see how to use the orientation APIs in our application. And since it has not been packaged using Sencha Cmd, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required