Chapter 7. Going Further

I’ve covered a fair amount of ground in the last few chapters, and you should now have a solid grasp of the basics of handling the sensor data produced by the hardware.

The iPhone SDK

Predictably in a book talking about sensors I’ve focused on the parts of the SDK that will be most helpful, and allow you to use the basic sensor hardware in your own applications. But even there I’ve left out a lot in an attempt to simplify and get you started quickly, especially when it comes to audio. A more in-depth look at the iPhone SDK is available in Programming iOS 4, by Matt Neuburg (O’Reilly).

Geolocation and Maps

The iPhone is one of the most popular devices for geolocation: users use it for everything from driving directions to finding a restaurant close to them. As a developer, you can get in on the geolocation game by using the Core Location framework, one of the most powerful and interesting frameworks in the iPhone SDK. It abstracts the details of determining a user’s location, and does all the heavy lifting for you behind the scenes. From there you can use the MapKit framework to embed maps directly into your views, and then go ahead and annotate those maps. I’ll deep-dive into both these topics in upcoming title Geolocation in iOS, by Alasdair Allan (O’Reilly).

Third-Party SDKs

The same book will investigate third-party geo-SDKs such as the Skyhook Wireless Local Faves and Spot Rank SDKs, along with coverage of SimpleGeo and SG Context and Places.

Speech Recognition

I covered basic manipulation of the audio hardware, but moving on from this you might be thinking about integrating speech recognition into your application. At least until Apple gets round to adding this to the official iOS SDK, the best way to do this is probably using the CMU Pocketsphinx and CMU Flite libraries. There are actually two fairly good Objective-C wrappers to the libraries, these are VocalKit and OpenEars. Of the two, at least at the time of writing, OpenEars probably has is the best documentation which may be a deciding factor if you’re not a expert in speech recognition.

Computer Vision

The Open Source Computer Vision (OpenCV) Library is a collection of routines intended for real-time computer vision, released under the BSD License, free for both private and commercial use. The library has a number of different possible applications including object recognition and tracking. We delve into computer vision and face recognition in the upcoming title Augmented Reality in iOS, by Alasdair Allan (O’Reilly).

While you wait you might want to take a look at some of the sample code from this title which is already on the web at http://programmingiphonesensors.com/pages/oscon.html.

Augmented Reality

Unsurprisingly perhaps, the same title will also take a close look at Augmented Reality, which has become one of the killer applications for the iOS platform. The book walks you through building a simple location-aware AR toolkit, and some of the sample code is already online at http://programmingiphonesensors.com/masterclass/theclass.html.

If you’re interested in AR you might also want to take a look at the associated video masterclass on iOS Sensors which features me, amongst other things, walking you through the AR toolkit code.

Warning

The video masterclass Making use of iPhone and iPad Location Sensors was filmed using Xcode 3 and iOS 4.0. While the code is still fine, the step-by-step walkthroughs in Xcode are somewhat out of date.

External Accessories

While the iOS platform comes with a growing range of sensors; GPS, accelerometers, magnetometers and most recently gyroscopes. They also have a (near-)ubiquitous data connection, whether via a local wireless hotspot or via carrier data, and user positioning via multiple methods including GPS. The device makes an excellent hub for a distributed sensor network.

However until recently it was actually quite difficult to interface these otherwise interesting devices into a standard serial interface, as the iPhone’s proprietary dock connector is a major stumbling block.

All this has changed. In the upcoming title iOS and Sensor Networks by Alasdair Allan (O’Reilly) we’ll discuss using the MFi approved Redpark Serial Cable. This is an officially Apple approved route, and makes use of Apple’s own External Accessory Framework to connect your device to any standard serial (RS-232) capable device. In addition to this we will go on to discuss other methods to use the phone as the hub of a sensor network, and part of the Internet of Things.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset