Return to Video

Device orientation and motion - Mobile Web Development

  • 0:00 - 0:04
    There are two different APIs for this: device orientation
  • 0:04 - 0:07
    and device motion, both of which are really interesting. Device
  • 0:07 - 0:10
    orientation tells you which way the device is tilted and
  • 0:10 - 0:13
    which way it's pointed. This can be useful for implementing
  • 0:13 - 0:17
    a virtual joystick for example, or implementing a compass. Device
  • 0:17 - 0:20
    motion gives you events and information about what forces are
  • 0:20 - 0:23
    being applied to the device. Which makes it easy to
  • 0:23 - 0:26
    tell if you're shaking the device but it also lets
  • 0:26 - 0:30
    you include and exclude gravity. This means it can tell you how the device is
  • 0:30 - 0:33
    oriented too. It's really a strict superset
  • 0:33 - 0:35
    of device orientation but it's a bit more
  • 0:35 - 0:38
    challenging to use in that way. So
  • 0:38 - 0:40
    given these descriptions in which of these scenarios
  • 0:40 - 0:43
    do you think you would use device orientation
  • 0:43 - 0:45
    And in which would you use device motion?
Title:
Device orientation and motion - Mobile Web Development
Video Language:
English
Team:
Udacity
Project:
CS256 - Mobile Web Development
Duration:
0:46

English subtitles

Revisions Compare revisions