Synopses & Reviews
What really sets the iPhone apart from laptops and PCs is its use of onboard sensors, including those that are location-enabled. This concise book takes experienced iPhone and Mac developers on a detailed tour of iPhone and iPad hardware by explaining how these sensors work, and what they're capable of doing.
With this book, you'll build sample applications for each sensor, and learn hands-on how to take advantage of the data each sensor produces. You'll gain valuable experience that you can immediately put to work inside your own iOS applications for the iPhone, iPod touch, and iPad. This book helps you focus on:Camera: learn how to take pictures and video, create video thumbnails, customize video, and save media to the photo albumAudio: use the media picker controller and access the iPod music library in your own application, and enable your app to record and play sampled audioAccelerometer: write an application that uses this sensor to determine device orientationMagnetometer: learn how this sensor verifies compass headingsCore Motion: use this framework to receive motion data from both the accelerometer and the vibrational gyroscope
This short book is part of a collection that will, along with new material, be compiled into a larger book, iOS Sensor Programming. The other books in this collection are Augmented Reality in iOS, Geolocation in iOS, and iOS Sensor Apps with Arduino.
Modern mobile platforms, such as Apples iPhone and iPad, come with a growing range of sensors; GPS, accelerometers, magnetometers and gyroscopes. This book guides you through how to make use of these sensors, giving you the necessary tools and experience to develop applications that makes best use of the hardware.
About the Author
Alasdair Allan is a senior research fellow in Astronomy at the University of Exeter, where he is building an autonomous, distributed peer-to-peer network of telescopes that reactively schedule observations of time-critical events. He also runs a small technology consulting business writing bespoke software and building open hardware, and is currently developing a series of iPhone applications to monitor and manage cloud-based services and distributed sensor networks.
Table of Contents
Preface; Who Should Read This Book?; What You Should Already Know?; What Will You Learn?; What's In This Book?; Conventions Used in This Book; Using Code Examples; Safari® Books Online; How to Contact Us; Acknowledgments; Chapter 1: The Hardware; 1.1 Available Sensor Hardware; 1.2 Differences Between iPhone and iPad; 1.3 Detecting Hardware Differences; 1.4 Setting Required Hardware Capabilities; Chapter 2: Using the Camera; 2.1 The Hardware; 2.2 Capturing Stills and Video; 2.3 Video Thumbnails; 2.4 Saving Media to the Photo Album; 2.5 Video Customization; Chapter 3: Using Audio; 3.1 The Hardware; 3.2 Media Playback; 3.3 Recording and Playing Audio; Chapter 4: Using the Accelerometer; 4.1 About the Accelerometer; 4.2 Writing an Accelerometer Application; 4.3 Determining Device Orientation; 4.4 Detecting Shaking; Chapter 5: Using the Magnetometer; 5.1 About the Magnetometer; 5.2 Writing a Magnetometer Application; 5.3 Measuring a Magnetic Field; Chapter 6: Using Core Motion; 6.1 Core Motion; 6.2 Accessing the Gyroscope; 6.3 Measuring Device Motion; Chapter 7: Going Further; 7.1 The iPhone SDK; 7.2 Geolocation and Maps; 7.3 Speech Recognition; 7.4 Computer Vision; 7.5 External Accessories; Colophon;