Preface

The mobile phone—specifically the iPhone, which continues to define the state of the art for smartphones—has become the primary interface device for geographically-tagged data.

Who Should Read This Book?

This book provides an introduction to the hot topic of location on the iOS platform. If you are a programmer who has had some experience with iOS before, this book will help you push your knowledge further. If you are an experienced Mac programmer and are already familiar with Objective-C as a language, this book will dive deeper into Core Location and Map Kit, as well as some of the more important third-party tools, to give you a close look at the geolocation capabilities of the iOS platform.

What Should You Already Know?

This book assumes some previous experience with the Objective-C language. Additionally, some familiarity with the iOS platform would be helpful. If you’re new to the iOS platform you may be interested in Learning iOS Programming, also by Alasdair Allan (O’Reilly).

What Will You Learn?

This book will guide you through developing applications for the iOS platform. These applications make use of the onboard sensors and geolocation capabilities of the device in your hands to give you the background and skills to build your own applications using the hottest location-aware technology for any mobile platform.

What’s In This Book?

Chapter 1

This chapter summarizes the available sensors on the iPhone and iPad platforms and how they could be used in applications. It talks about the differences between the hardware platforms.

Chapter 2

This chapter includes a discussion on the Core Location framework, covering standard location monitoring as well as the significant-change location service, which provides a low-power way to get the current location and be notified of changes to that location. It also covers region monitoring, which provides geofencing capabilities on the platform.

Chapter 3

This chapter includes a discussion on the MapKit framework, which allows you to embed maps directly into your application’s views, and provides support for annotating these maps.

Chapter 4

This chapter shows how to use the onboard magnetometer, which is present in many iOS devices, as a digital compass using the Core Location framework.

Chapter 5

This chapter discusses the geocoding capabilities of the platform that allow you to go from a latitude and longitude to a place name, and vice versa.

Chapter 6

This chapter walks through code that allows you to display heat maps on top of a standard Map Kit view.

Chapter 7

This chapter points to more information and some of the available third-party software development kits (SDKs) that make it easier to carry out geocoding, geofencing, and real-time location streaming as part of your application.

Conventions Used in This Book

The following typographical conventions are used in this book:

Italic

Indicates new terms, URLs, email addresses, filenames, and file extensions.

Constant width

Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords.

Constant width bold

Shows commands or other text that should be typed literally by the user.

Constant width italic

Shows text that should be replaced with user-supplied values or by values determined by context.

Note

This icon signifies a tip, suggestion, or general note.

Warning

This icon signifies a warning or caution.

Using Code Examples

This book is here to help you get your job done. In general, you may use the code in this book in your programs and documentation. You do not need to contact us for permission unless you’re reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from O’Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product’s documentation does require permission.

We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: “Geolocation in iOS, by Alasdair Allan. Copyright 2012 O’Reilly Media, Inc., ISBN 978-1-4493-0844-5.”

If you feel your use of code examples falls outside fair use or the permission given here, feel free to contact us at .

Safari® Books Online

Note

Safari Books Online (www.safaribooksonline.com) is an on-demand digital library that delivers expert content in both book and video form from the world’s leading authors in technology and business.

Technology professionals, software developers, web designers, and business and creative professionals use Safari Books Online as their primary resource for research, problem solving, learning, and certification training.

Safari Books Online offers a range of product mixes and pricing programs for organizations, government agencies, and individuals. Subscribers have access to thousands of books, training videos, and prepublication manuscripts in one fully searchable database from publishers like O’Reilly Media, Prentice Hall Professional, Addison-Wesley Professional, Microsoft Press, Sams, Que, Peachpit Press, Focal Press, Cisco Press, John Wiley & Sons, Syngress, Morgan Kaufmann, IBM Redbooks, Packt, Adobe Press, FT Press, Apress, Manning, New Riders, McGraw-Hill, Jones & Bartlett, Course Technology, and dozens more. For more information about Safari Books Online, please visit us online.

How to Contact Us

Please address comments and questions concerning this book to the publisher:

O’Reilly Media, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
800-998-9938 (in the United States or Canada)
707-829-0515 (international or local)
707-829-0104 (fax)

We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at http://oreil.ly/geolocation-ios. Supplementary materials are also available at http://www.programmingiphonesensors.com/.

To comment or ask technical questions about this book, send email to .

For more information about our books, courses, conferences, and news, see our website at http://www.oreilly.com.

Find us on Facebook: http://facebook.com/oreilly

Follow us on Twitter: http://twitter.com/oreillymedia

Watch us on YouTube: http://www.youtube.com/oreillymedia

Acknowledgments

Everyone has one book in them. This isn’t it; it’s my fifth, and hopefully not my last by any means. Nonetheless, they don’t really get much easier to write. I’d therefore like to thank my editors Brian Jepson and Shawn Wallace for prodding and poking until I actually finally set some of this material down in print. I’d also like to thank my long-suffering wife, Gemma Hobson. I’m not entirely sure why she lets me keep writing; it’s almost certainly nothing to do with the royalty checks. Finally, to my son Alex, who is still young enough that he’s not entirely sure what daddy is doing. Sorry for being so grumpy while I went about this whole business one more time.

Get Geolocation in iOS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.