Encontre seu próximo livro favorito

Torne'se membro hoje e leia gratuitamente por 30 dias.
iPhone Location Aware Apps by Example Beginner’s Guide

iPhone Location Aware Apps by Example Beginner’s Guide

Ler amostra

iPhone Location Aware Apps by Example Beginner’s Guide

735 página
3 horas
Lançado em:
Mar 23, 2012


Using a By example approach you will master the essentials of location awareness and augmented reality by building five complete apps using easy to follow step by step instructions geared towards newcomers. Novice to professional level iOS programmers who want to master location awareness and augmented reality. Build five practical location-based iOS Apps from scratch, a first for any book, converting learning into actual implementation.
Lançado em:
Mar 23, 2012

Sobre o autor

Relacionado a iPhone Location Aware Apps by Example Beginner’s Guide

Livros relacionados
Artigos relacionados

Amostra do Livro

iPhone Location Aware Apps by Example Beginner’s Guide - Zeeshan Chawdhary

Table of Contents

iPhone Location Aware Apps by Example


About the Author

About the Reviewers


Support files, eBooks, discount offers and more

Why Subscribe?

Free Access for Packt account holders


What this book covers

What you need for this book

Who this book is for


Reader feedback

Customer support

Downloading the example code




1. The Location-based World

Understanding Location-based Services

Time for action — consuming Location-based Services with Google

What just happened?

Buzzwords in the Location-based Industry

Application of LBS and common use cases




How Apple uses LBS in the iPhone, iPad, and iPod devices

iOS location API

Time for action — turning off Location Tracking in your iPhone

What just happened?

Behind LBS — GPS

User segment

Space segment

Control segment

Push and Pull methods of Location Services

Push Service

Pull Service

Life without GPS: Wi-Fi-based location detection

Life without GPS: cell ID positioning and cell tower triangulation

Time for action — using the SkyHook Wireless Loki framework to determine your location

What just happened?

Life without GPS: Google Maps API

Understanding Indoor and Outdoor Navigation

Pop quiz — play safe with location!


2. The Xcoder's World

Introducing Xcode 4

Xcode 4: Prerequisites and features



iOS 5 and Xcode 4.2: new and notable features

iOS 5 new features

Xcode 4.2's new features

Transitioning from Xcode3: What you need to know

Time for action — installation

What just happened?

Time for action — Hello Location

What just happened?

Tools for the overnight coders: HTML5


Time for action — using PhoneGap to build a Hello Location App

What just happened?

Time for action — using Titanium Appcelerator for building the Hello Location app

What just happened?

Time for action — Hello Location with Sencha Touch

What just happened?

Exploring location-based SDKs/APIs



Eventful and Last.fm API — some music is always good

Still more tools: SimpleGeo and Factual

Other Notable APIs — YQL and Location Labs

Pop quiz — so you think you can Xcode


3. Using Location in your iOS Apps — Core Location

Core Location framework an — overview

Time for action — location debugging

What just happened?

Core location services

Standard location

Significant change

Region monitoring

Geocoding and reverse Geocoding — CLGeocoder

Direction using heading

Core Location Manager — CLLocationManager

Time for action — checking for location service availability

What just happened?

User authorization

Time for action — using Core Location with user authorization

What just happened?

The CLLocation object

Time for action — receiving location updates in your application

What just happened?

Time for action — boundary monitoring with Location Manager

What just happened?

Have a go hero — remembering a user's location with Core Data

Extending Hello Location for nearby events

Important things to know before we begin

Time for action — extending Hello Location for nearby events

What just happened?

Time for action — Last.fm API in your app

What just happened?

Extending Hello Location for local search

Important things to know before we begin

Time for action — building a local search app with foursquare

What just happened?

Pop quiz — Location, Location, and Location


4. Using Maps in your iOS apps MapKit

Overview of the MapKit framework

Understanding map geometry

Time for action — using MapKit in your app

What just happened?

Time for action — using map gestures panning and zooming

Annotating Maps an overview

Time for action — adding annotations to your maps

Time for action — draggable annotations

What just happened?

Time for action — custom map annotations

What just happened?

Have a go hero — use CLRegion to detect a user's city

Map overlays an overview

Time for action — customizing map annotations

User tracking modes

Bonus — offline maps in your app

Time for action — using OpenStreetMaps with CloudMade API

What just happened?

Have a go hero — creating an offline map

Pop quiz — Map Mania


5. Weather App WeatherPackt

Storing and retrieving the user's location with SQLite

Time for action — storing and retrieving the user's location with SQLite

What just happened?

Converting location data into city name — using Geonames API

A bit on GeoNames

Time for action — converting location data into city name

What just happened?

Consuming the WeatherBug API

Important things to know before we begin

Time for action — using WeatherBug API

What just happened?

Have a go hero — creating the Weather Alert function

Building your Weather App: WeatherPackt

Start a new Xcode project

Define the Home screen

Time for action — defining the Home screen

Set up a default location

Formatting the Weather API for display

The settings page

Have a go hero — adding the Alerts page to WeatherPackt

Bonus: building WeatherPackt with PhoneGap

Bonus: text-to-speech

Pop quiz — Weather Alert


6. Events App — PacktEvents

PacktEvents: Overview and architecture

Architecture of PacktEvents

Storing and Retrieving Events with SQLite

Time for action — storing and retrieving events with SQLite

What just happened?

Plotting events on a map

Time for action — plotting events on a map

What just happened?

Have a go hero — add more dynamics to the map

Filtering Events display by Event Categories

Time for action — filtering Events by categories

What just happened?

Using the Event Kit framework to add events to your iPhone calendar

Time for action — adding events to your iPhone calendar

What just happened?

Using the Twitter framework

Time for action — adding Twitter capabilities to your iPhone app

What just happened?

Bonus: using the Layar Player API in your app: Augmented Reality

Time for action — adding Augmented Reality to your iPhone app

What just happened?

PacktEvents: building the app

Pop quiz — have a blast with events


7. Advanced Topics

Using directions with location

Direction using heading

Getting your app ready for direction

Understanding heading using magnetometer

Time for action — using heading for direction in your app

What just happened?

Direction using course

Time for action — using course for direction in your app

What just happened?

Core Motion: Motion Manager

How to use Core Motion

Time for action — using MotionManager: accelerometer

What just happened?

Core Motion conclusion

Background app execution

What apps can run in the background?

Background location

Understanding the iOS application life cycle

Push notifications - overview

Local notifications

Time for action — using local notifications

What just happened?

Have a go hero — add local notifications to WeatherPackt

Pop quiz — the rocket science


8. Local Search PacktLocal

Consuming the foursquare venue API

Venue categories

Time for action — consuming the foursquare venue API - categories

What just happened?

Recommended and popular venues

Time for action — recommended and popular venues

What just happened?

Search for venues

Time for action — exploring the foursquare Search API

What just happened?

Building an UI for our local search app - PacktLocal

Saving venue information on the device

Building the app: PacktLocal

Time for action — building the app - PacktLocal

What just happened?

Have a go hero — implement the add venue endpoint


9. Location Aware News — PacktNews

Understanding the Patch News API — HyperLocal News






Finding stories by location

Find location by names

Time for action — consuming the Patch News API

What just happened?

Adding the Geo Fencing support

Time for action — adding the Geo Fencing support

What just happened?

Building our app - PacktNews

A bit on StoryBoard

Time for action — building PacktNews

What just happened?


10. Social Governance — TweetGovern

Social governance — an overview

TweetGovern — behind the scenes


Our approach: Twitter

Icons and images

SDKs and frameworks

Time for action — creating the UI for TweetGovern

What just happened?

Time for action — detecting the user location and showing nearby issues

What just happened?

Time for action — creating and voting for an issue

What just happened?

Have a go hero — adding search to TweetGovern

Pop quiz


A. Pop-Quiz Answers

Chapter 1, The Location-Based World

Pop quiz — play safe with location !

Chapter 2, The Xcoder’s World

Pop quiz — so you think you can Xcode

Chapter 3, Using Location in your iOS Apps Core Location

Pop quiz — location, location, and location

Chapter 4, Using Maps in your iOS apps - MapKit

Pop quiz — map mania

Chapter 5, Weather App - WeatherPackt

Pop quiz — weather alert

Chapter 6, Events App - PacktEvents

Pop quiz — have a blast with events

Chapter 7, Advanced Topics

Pop quiz — the rocket science

Chapter 10, Social Governance - TweetGovern

Pop quiz


iPhone Location Aware Apps by Example

Beginner's Guide

iPhone Location Aware Apps by Example

Beginner's Guide

Copyright © 2012 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

First published: March 2012

Production Reference: 1160312

Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK.

ISBN 978-1-84969-224-3


Cover Image by Asher Wishkerman (<a.wishkerman@mpic.de>)



Zeeshan Chawdhary


Sebastian Borggrewe

Taylor Jasko

Robb Lewis

Jose Luis Manners

Shuxuan Nie

Martin Selva

Alex Zaltsman

Acquisition Editor

Alina Lewis

Lead Technical Editor

Susmita Panda

Technical Editors

Lubna Shaikh

LLewellyn Rosario

Project Coordinator

Leena Purkait


Mario Cecere

Copy Editor

Leonard D'silva


Monica Ajmera


Manu Joseph

Production Coordinator

Shantanu Zagade

Cover Work

Shantanu Zagade

About the Author

Zeeshan Chawdhary has been a keen developer for the last six years, and has worked in the location-based space for the past five years. He is currently the Chief Technology Officer of Wcities Inc, a San Francisco-based Location Content Provider. He is currently experimenting with PostGIS, PhoneGap, and iOS 5, and is currently trying his hand at blogging again at http://justgeeks.in.

I would like to thank all the lovely people at PacktPub, especially Mary Nadar for having introduced me to the PacktPub family.

A special thanks to Leena, Susmita, Lubna, and Llewellyn for working with me tirelessly on the book.

I would also thank Christopher D. Sloop from WeatherBug, Lauren Sperber and Janine Iamunno from AOL Patch.com, Tim Breidigan, and Robert Martindale from Eventful.com — for having allowed me to use their respective APIs in the book, you guys rock man!

About the Reviewers

Sebastian Borggrewe, born and raised in Germany, is a computer science Master's student at the University of Edinburgh/RWTH Aachen. Since he was 16, he has been freelancing for several web and mobile agencies, and has founded his own agency.

Currently, he is the co-founder and CTO of Loyalli Ltd., a London-based startup, developing mobile loyalty card solutions (http://www.loyalli.com).

When he is not coding, he is searching for new technology or ways to use technology to make life even more fun. You will probably find him hanging out with friends, hitting the gym, cooking, or playing the guitar in his 60's band.

One of his goals in life, apart from working in a kick-ass office in central London with an office slide, is obtaining a pilot license.

More information about Sebastian, and his projects can be found at http://www.sebastianborggrewe.de.

Taylor Jasko has been fascinated with technology ever since the day he laid his hands on a Windows 95-based computer. Since then, now being eighteen years old, he has dived into web design and development, computer programming, and even system administration with his favorite server-oriented operating system, Debian Linux.

He founded the technology blog Tech Cores (http://techcores.com), and has been working on it ever since it was created back in late 2008. Tech Cores is a great example of his work; he designed and created it using the powerful WordPress content management system, and with the help of his Wacom Intuos4 graphic tablet plus Adobe Photoshop.

While in school, he can be found freelancing graphic design and programming work. His technical strengths include PHP, JavaScript (including libraries such as jQuery), AJAX, HTML, CSS, Perl, Objective-C, Linux/UNIX, MySQL, Apache, Nginx, and to finish it all off, a dab of Python. Essentially, he is a programmer, system admin, and a designer!

He can be reached at<taylor@taylorjasko.com>.

Jose Luis Manners is a seasoned IT professional with over 20 years of software development experience, including project management, technical architecture, and full life-cycle systems development. His software development experience includes enterprise systems for Fortune 500 clients as well as federal, state, and local governments. Mr. Manners has been recognized on several occasions by Microsoft with their Most Valuable Professional award for his outstanding work with .NET, and his contributions to Microsoft's product teams. He specializes in .NET, iOS, and Android mobile development for clients in the Washington, DC metropolitan area.

He can be reached at<jose@josemanners.com>.

Shuxuan Nie is a SOA Consultant, specializing in SOA and Java technologies. She has more than 10 years of experience in the IT industry that includes SOA technologies, such as BPEL, ESB, SOAP, XML, and Enterprise Java technologies, Eclipse plugins, and other areas, such as C++ cross-platform development.

Since 2010, Shuxuan has been working in Rubiconred, and has been helping customers resolve integration issues.

From 2007 to 2010, Shuxuan had been working in Oracle Global Customer Support team, and focussed on helping customers solve their middleware/SOA integration problems.

Before joining Orcale, Shuxuan had been working in IBM China Software Development Lab for four years as staff software engineer, where she participated in several complex products on IBM Lotus Workplace, Webshpere and Eclipse platform, and then joined the Australia Bureau of Meteorology Research Center, which is responsible for implementation of Automated Thunderstorm Interactive Forecast System for Aviation and Defence.

Shuxuan holds an MS in the Computer Science degree from Beijing University of Aeronautics and Astronautics.

Martin Selva heads the Gaming team at Hungama Digital Media Entertainment Pvt Ltd, with over nine years of experience. His passion, experience, and expertise have also helped him develop a keen interest in Product Development for Online & Devices.

At Hungama, Martin is responsible for building a gaming portal called www.thegamebox.com, and heads a Gaming Studio that comprises of iOS Developers, PHP Developers, Game Designers, and Content Writers.

He can be reached at<martin@hungama.com> and.

Alex Zaltsman is the CEO and founder of Xcela Mobile, a software and mobile cloud infrastructure hosting company that develops applications for mobile devices, such as the iPhone, iPad, and Android. Prior to finding TourSpot, Alex was a co-founder and managing partner of a technology services company. Alex has been in the technology field for over 15 years. Prior to founding the technology services company, Mr. Zaltsman worked at Lucent Technologies, AT&T Labs, and Johnson & Johnson, in technical and management capacities. Alex is also on the Board of Advisors of BizWorld, a non-profit organization that has created curriculum for teaching entrepreneurship and money management to kids. Alex is on the Board of Directors for the New Jersey chapter for Entrepreneurs Organization (http://www.eonetwork.org).


Support files, eBooks, discount offers and more

You might want to visit www.PacktPub.com for support files and downloads related to your book.

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.


Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.

Why Subscribe?

Fully searchable across every book published by Packt

Copy and paste, print and bookmark content

On demand and accessible via web browser

Free Access for Packt account holders

If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.


iPhone Location Aware Apps Beginner's Guide is probably the first book from any technical publisher that teaches you to build real world applications (five of them). That's a bold step from PacktPub - by undertaking more lively practical examples, rather than 400 pages of text! The book lays emphasis on location services, due to the ever-increasing role of location in our day-to-day lives and increased geo-referenced content being produced/consumed on the Internet and Mobiles. Be it news, sports or gossip, consumers no longer want to read/search about content happening far off from their current location. If it is news it has to be local, similarly neighborhood gossip and news is more relevant to consumers seeking information on their smartphones. Applications such as foursquare confirm this behavior.

This book will help you learn location based techniques using iOS 5 as well as solutions to common location and mapping problems, ranging from simple location usage to caching user's last position, from simple Google maps examples to using OpenStreetMaps. Find five full working apps as a part of the book (along with the source code and business logic).

In this book, we have covered everything to make your next killer app, from app design to using free icons and background from the Internet (of course with due attribution to the author/designers), from integrating Twitter in your iOS 5 app to using the Nuance Speech SDK. This book is a practical beginners guide for new comers to the Apple iOS world. Happy Reading.

What this book covers

Chapter 1, The Location-Based World, explains location-based services, how it works, and the role of GPS in Location Services. We also learn how Apple uses location-based Services in iOS. Buzzwords in the industry are also explored.

Chapter 2, The Xcoder's World, explains the Xcode tool, introduction to HTML5 with Phonegap, Appcelerator Titanium, and Sencha Touch. We also have a look at a couple of location-based APIs/ SDK including FourSquare, EventFul, and Last.fm.

Chapter 3, Using Location in your iOS Apps Core Location, explains a number of techniques used to read location information from your iPhone. This includes reading location information on an event, and receiving location updates in your app automatically. We also look at Region monitoring with Core Location framework. Example apps using Foursquare, Eventful, and Last.fm are also included.

Chapter 4, Using Maps in your iOS apps MapKit, brings us to Maps We learn to use the MapKit Framework in our app. We go behind the scenes with a small review of Map Geometry. We also explore annotations and overlays along with their customizations.

Chapter 5, Weather App WeatherPackt, builds a complete Weather App using WeatherBug API. It also provides a Settings page in the app to customize the Weather display. As a bonus to the readers, we also included the Nuance Speech SDK for reading out the weather!

Chapter 6, Events App PacktEvents, builds an Events app that shows us nearby events, concerts, and gigs by Artists, by using the excellent Eventful.com API. This chapter also shows how to use the Twitter API in iOS 5, and gives us a taste

Você chegou ao final desta amostra. Inscreva-se para ler mais!
Página 1 de 1


O que as pessoas pensam sobre iPhone Location Aware Apps by Example Beginner’s Guide

0 avaliações / 0 Análises
O que você acha?
Classificação: 0 de 5 estrelas

Avaliações de leitores