
Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Developing Hybrid Applications for the iPhone: Using HTML, CSS, and Javascript to Build Dynamic Apps for the iPhone 1st Edition
For those not ready to tackle the complexities of Objective-C, this is a great way to get started building iPhone apps. If you know the basics of HTML, JavaScript, and CSS, youll be building apps in no time.
August Trometer, Owner of FoggyNoggin Software, www.foggynoggin.com
Discover the Easier, Faster Way to Build High-Quality iPhone Applications
Now, you dont need to dive headfirst into Objective-C to write state-of-the-art applications for the iPhone. You can use web development tools and technologies you already know: JavaScript, HTML, and CSS. In this book, long-time web and mobile application developer Lee S. Barney shows you how to use the QuickConnect and PhoneGap frameworks to create secure, high-quality, modular hybrid iPhone applications.
Lee S. Barney walks you through the entire hybrid iPhone development process, from creating great user interfaces to compiling, deploying, and executing applications. Along the way, he introduces techniques and sample code designed to streamline development, eliminate complexity, optimize performance, and leverage all iPhones native capabilitiesfrom its accelerometer and GPS to its built-in database. Coverage includes
- Using Dashcode and Xcode together to create unique, exciting hybrid iPhone applications
- Using the QuickConnect JavaScript API to perform tasks ranging from vibrating the phone to accessing the accelerometer and GPS location data
- Accessing native iPhone functionality using the PhoneGap JavaScript API
- Storing, retrieving, and managing data on the iPhone, even without network access
- Using XMLHttpRequest to access or synchronize remote data and use web services
- Creating Google-based maps for your own app that work like those you see in the iPhones Maps application
This book systematically lowers the barriers to iPhone development, enabling web developers to build any iPhone application they can imagine without long development cycles or steep learning curves!
- ISBN-100321604164
- ISBN-13978-0321604163
- Edition1st
- PublisherAddison-Wesley Professional
- Publication dateJanuary 1, 2009
- LanguageEnglish
- Dimensions7 x 0.5 x 9 inches
- Print length195 pages
Editorial Reviews
Review
Praise for Developing Hybrid Applications for the iPhone
“For those not ready to tackle the complexities of Objective-C, this is a great way to get started building iPhone apps. If you know the basics of HTML, JavaScript, and CSS, you’ll be building apps in no time.”
–August Trometer, Owner of FoggyNoggin Software, www.foggynoggin.com
“Lee S. Barney takes the complexities of iPhone application creation and utilizes simple and often witty examples and language to make this book an enjoyable and useful read. It is not a simple how-to book, but if you have some web programming background and an idea, this book can provide you with the foundation for well-made, maintainable, and useable applications for the iPhone.”
–William Dalton
“This is an outstanding book! If you are interested in building applications for the iPhone, this is the book for you. Lee S. Barney makes it simple and easy to understand. He has you creating a custom application from the very first chapter. Then, he brings you up the learning curve until you’re building applications with advanced iPhone features, such as the accelerometer, GPS, and embedded maps. This is an extremely well-written and easy-to-follow book.”
–Joey Skinner, CEO and President, Rodeo Software
“Lee S. Barney employs his solid background in JavaScript and Xcode to demonstrate useful techniques for building hybrid iPhone applications. I appreciate his candor as he shares some of the pitfalls that might trap newcomers, which then supports the direction for his solution. If you have a strong background in Javascript and are looking to break into iPhone application development, this book would make for a good segue.”
–A. Scott Mikolaitis
About the Author
Lee S. Barney (Rexburg, Idaho) is a professor at Brigham Young UniversityIdaho in the Computer Information Technology Department of the Business and Communication College. He has worked as CIO and CTO of @HomeSoftware, a company that produced web-based, mobile data, and scheduling applications for the home health care industry. Prior to this, he worked for more than seven years as a programmer, senior software engineer, quality assurance manager, development manager, and project manager for AutoSimulations, Inc., the leading supplier of planning and scheduling software to the semiconductor industry. He is the author ofOracle Database AJAX & PHP Web Application Development.
Excerpt. © Reprinted by permission. All rights reserved.
Preface
This book shows you how to create a new type of iPhone application: hybrid applications written in HTML, CSS, and JavaScript. Hybrid iPhone applications are standalone applications that run like regular applications on your iPhone, but don't require the files to live on a server on the Internet.
Creating hybrid iPhone applications reduces creation time and the learning curve required to get your application into the hands of your customers, because you don't have to learn Objective-C or have an intimate knowledge of the Cocoa frameworks.
Hybrid Application Development Tools
This book covers the two most commonly used open-source JavaScript software packages for writing applications for the iPhone and iPod touch devices: QuickConnectiPhone and PhoneGap. These packages enable you to build applications that access native device features directly from JavaScript, such as vibration, GPS location information, the accelerometer, and many other thingsmdall without writing a single line of Objective-C or Cocoa.
QuickConnectiPhone, downloaded from http://quickconnect.pbwiki.com, exposes the most native device behavior and provides a highly engineered, full-featured framework for development use. QuickConnectiPhone dramatically reduces your application's time-to-market because part of the framework consists of all of the glue code you have to typically write in Objective-C, Cocoa, and JavaScript. Best of all, it does not require a remote server for hosting JavaScript, HTML, and CSS files.
The second package is PhoneGap, downloaded from http://phonegap.com. PhoneGap exposes fewer native behaviors and is a library rather than a full-fledged framework. As a library, PhoneGap enables you to engineer your application any way you want. It does, however, require a remote server for hosting files.
To reduce the learning curve and improve your understanding, good, solid examples are used throughout this book.
If you want to create installable iPhone applications, have the web skills required, and if you want to create dynamic, compelling solutions that people will use, this book shows you how using these two packages.
Table P1 compares what each package can do at the time of writing this book.
Table P1: Comparing the Features of QuickConnectiPhone and PhoneGap
Behavior/Data Available
QuickConnectiPhone
PhoneGap
GPS
Yes
Yes
Accelerometer
Yes
Yes
Vibrate
Yes
Yes
System sounds
Yes
Yes
Ad-hoc (Bonjour) networking
Yes
No
Sync cable networking
Yes
No
Browser-based database access
Yes
No
Shipped database access
Yes
No
Drag-and-drop library
Yes
No
AJAX wrapper
Yes
No
Record/Play audio files
Yes
No
Embedded Google maps
Yes
No
Charts and graphs library
Yes
No
How to Use This Book
Each chapter is organized into two parts. The first part shows you how to use the relevant feature of either QuickConnectiPhone or PhoneGap to accomplish a particular task, such as getting the current geolocation of the device. The second part of the chapter shows how the code behind the JavaScript call is written and how it works. You can decide how deep into the JavaScript and Objective-C you want to delve.
The book is organized as follows:
- Chapter 1, "Developing with Dashcode and Xcode," teaches you how to use Dashcode and Xcode together with QuickConnectiPhone and PhoneGap to quickly create fun-to-use applications that run on the iPhone. This chapter includes basic Dashcode use and methods for moving your Dashcode application into Xcode for compiling and running on devices.
- Chapter 2, "JavaScript Modularity and iPhone Applications," teaches you how to dramatically reduce your time to market by taking advantage of the modularity of the QuickConnectiPhone framework. How front controllers, application controllers, and JavaScript reflection are used in code is explained.
- Chapter 3, "Creating iPhone User Interfaces," helps ensure that Apple App Store distribution approves your applications. It describes best practices for creating highly usable iPhone applications. The different types of applications usually created for iPhones are described as well as pitfalls to watch out for.
- Chapter 4, "GPS, Acceleration, and Other Native Functions with QuickConnectiPhone," shows you how to get GPS, acceleration, and device description information, and it teaches you how to vibrate your phone and play and record audio files. You use the QuickConnectiPhone framework to access and use these device behaviors. These abilities give your applications a truly native, fun feel.
- Chapter 5, "GPS, Acceleration, and Other Native Functions with PhoneGap," shows you how to get GPS, acceleration, and device description information as well as how to vibrate your phone and play and record audio files. You use the PhoneGap library to access and use these native device behaviors. These abilities give your applications a truly native, fun feel.
- Chapter 6, "Embedding Google Maps," shows you how to put a Google map inside your application using QuickConnectiPhone. This is one of the most requested pieces of functionality that means you won't have to send your users to the map application!
- Chapter 7, "Database Access," shows you how to get information from and store data in SQLite databases included in your application created with the QuickConnectiPhone framework. Do you need to ship a predefined set of data in a database with your new applications? Read this chapter.
- Chapter 8, "Remote Data Access," Do you need to access and use data from remote servers and/or services in your installed application? Chapter 8 shows you how to make this easy with a wrapper that lets you pull information from anywhere. Maybe you need to get data from an online blog and merge it with a Twitter feed. QuickConnectiPhone's remote-data-access module makes it easy.
The following appendices are also included:
- Appendix A, "Introduction to JSON," provides you with a brief introduction to JavaScript Object Notation (JSON). JSON is one of the most commonly used and easiest ways to transfer your data wherever it needs to go.
- Appendix B, "The QuickConnectiFamily Development Roadmap," provides you with an overview of the growth of QuickConnectiPhone in the future. If you are planning on creating applications for iPhones and other platforms, such as Google's Android phones, Nokia phones, Blackberries, and desktops such as Mac OS X, Linux, and Windows you should take a look at this appendix.
- Appendix C, "The PhoneGap Development Roadmap," provides an overview of the growth of PhoneGap in the future. If you plan to create applications for iPhones and other platforms (such as Google's Android phones, Nokia phones, and Blackberries) and desktops (such as Mac OS X, Linux, and Windows), you should take a look at this appendix.
Online Resources
QuickConnectiPhone and PhoneGap are undergoing rapid development. To keep up with the new functions and capabilities and to learn more, use the following links.
QuickConnectiPhone:
- Download examples and the framework from https://sourceforge.net/projects/quickconnect/.
- Review the development blog at http://tetontech.wordpress.com.
- Read the Wiki at http://quickconnect.pbwiki.com/FrontPage.
- Find the Google group at http://groups.google.com/group/quickconnectiPhone/,
- Twitter at http://twitter.com/quickconnect.
PhoneGap:
- Download examples and the framework from https://sourceforge.net/projects/phonegapinstall/.
- Visit the web site at http://www.phonegap.com/.
- Read the Wiki at http://phonegap.pbwiki.com/.
- Find the Google group at http://groups.google.com/group/phonegap.
- Twitter at http://twitter.com/phonegap.
Prerequisites
You need a basic understanding of HTML, CSS, and Javascript to effectively use this book. If you have created web pages using these tools, you are well on your way to creating iPhone applications. If you need help with Objecive-C in both QuickConnectiPhone and PhoneGap, it is provided. This book is not intended to be an introductory book on Objective-C or on how to use it to develop iPhone applications.
You need to download and install Apple's Xcode tools from the iPhone developer web site at http://developer.apple.com/iphone. This requires Mac OS X 10.5 or greater and an Intel-based Mac.
Although it isn't required, you should also have either an iPhone or an iPod touch, so you can test and run the applications on those devices.
Contacting the Author
To contact the author by email, use quickconnectfamily@gmail.com. For other types of contact, use Twitter, the Wiki, and Google Group links provided earlier.
© Copyright Pearson Education. All rights reserved.
Product details
- Publisher : Addison-Wesley Professional
- Publication date : January 1, 2009
- Edition : 1st
- Language : English
- Print length : 195 pages
- ISBN-10 : 0321604164
- ISBN-13 : 978-0321604163
- Item Weight : 12 ounces
- Dimensions : 7 x 0.5 x 9 inches
- Part of series : Game Design
- Best Sellers Rank: #1,976,813 in Books (See Top 100 in Books)
- #591 in Mobile App Development & Programming
- #854 in Handheld & Mobile Devices
- #3,114 in Internet & Telecommunications
- Customer Reviews:
About the author

Discover more of the author’s books, see similar authors, read book recommendations and more.
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on AmazonTop reviews from the United States
There was a problem filtering reviews. Please reload the page.
- Reviewed in the United States on June 3, 2013Format: PaperbackVerified PurchaseI've been trying to go through this book, written in 2009. I don't know how accurate the information was at the time. But with the modern tools available this book is just useless. The techniques don't work and the steps provided aren't applicable to the versions available now. I can usually translate pretty well from an older version of tools to newer. But this book is no longer of any help.
The book recommends starting with quick connect and dashcode. Dashcode has to be downloaded specially now and it doesn't seem to work properly with iOS 10.7.5. I can't even get the samples that come with dashcode to work.
quick connect iphone is very must still alive. But has departed so far from the book that the readme file on the git repository is more useful than the book.
- Reviewed in the United States on July 2, 2009Format: PaperbackI was very excited to get this book, as I had pre-ordered it before it was even published. I received it today and was surprised by how thin it was, 172 pages not counting the appendices. Not a big deal, though I'm used to huge volumes with other programing/development related books. In fact, it's nice not having to lug around a 20-pound volume.
The author dives right in on the subject in Chapter 1 discussing two distinct methods for developing iPhone apps with HTML, CSS and JavaScript. Applications can be deployed as full-fledged iPhone apps (not requiring hosted server files) or as iPhone web-apps (requiring hosting files on a server). The author goes on to explain how this is possible using Apple's iPhone SDK and either, QuickConnectiPhone or PhoneGap, both of which are JavaScript APIs. The author, Lee S. Barney, is actually the creator of the QuickConnectiPhone (hereafter, QCIP) project.
The first project uses the QCIP method in Dashcode, part of Apple's iPhone SDK, and is essentially 5 easy steps in a 'Hello World' project. Button, text, click button, text changes. Note, this doesn't actually create a final iPhone app proper, rather it creates a demo that will run in the iPhone simulator, sans the app button. Part two describes how to import the files you have just created into Xcode, another part of the iPhone SDK, to compile a finished iPhone app.
The problem is, that right out of the gate, the demo throws a compiler error and doesn't work as intended. After several re-reads of the text to make sure I'm not brain-farting, I begin digging into the code to find that the main.js file has some functionality that has been code generated that is creating the error and that seemingly has nothing to do with the demonstration at hand. I comment that functionality out, and the demo runs without error.
Step Two involves importing the files that were created in Dashcode into Xcode. Suffice it to say this is quite a lengthy multi-step affair, that is not as simple as going to the File menu and selecting Import files. I say this for any one who has not used Xcode before. It is software that many HTML/CSS/Javascript developers will find daunting. If you've used Xcode before, no big surprises, though much time is spent undoing things and deleting things, moving files around, etc. It seems that a better written QCIP project template could have handled alot of that, but then again, I've never written an Xcode project template before and am a novice Mac programmer.
The authors explanations in Step Two already have my head spinning and I can see that I am going to need to go though this material very slowly. The authors instructions read like a run on sentence with no pauses in between "do this" and "then click on that", making it rather hard to follow along, especially given the small, IMO, font size and tight leading of the text. The structure of the steps and explanations could have been written in a format that made following them easier.
To qualify this review, I will state that I have been a web designer/developer for about 8 years, using HTML, CSS, PHP, Lasso, ColdFusion and JavaScript. I just got into iPhone development within the last couple of months and was hoping this book would provide that "Ah, Ha!" moment, allowing me to develop iPhone apps without having to learn Objective-C. Even though the book suggests this is possible, it's contents are full of Objective-C explanations, code and methodologies.
Searching the publishers website, I could not find an errata to help with the problems I was having, albeit the book was just published this week.
I do like the premise the author has created with his methods, along with the QuickConnectiPhone framework, he is obviously a very smart individual on the subject.
Perhaps, the book has been rushed to market. The again, perhaps too, is this review.
I will keep working with the material in this book and am hopeful it turns a corner somewhere. If so, I will be sure to revise this review. If not, I'll be taking at least one of my stars back.
- Reviewed in the United States on July 28, 2009Format: PaperbackBefore my review I want to tell you about my background. I have been a web developer (html,dhtml,js,ajax,php,asp,asp.net,cfm) since 1999. I have also done a ton of client server apps on windows with unix / oracle backend. Just recently i released three apps on the android os, with one of them being a phonegap app. So my understanding of programming and is pretty extensive. I have also taken the Stanford iTunes course on iPhone development, which is a must do for any wannabe iPhone dev.
For me I wanted to be able to utilize my abilities to develop apps efficiently. Since I am not a huge fan of Obj-C, I couldn't do that with the native language of the iphone. This book helps you understand how to utilize the main functions of the phone (play sound / accel / gps) without having to write much Obj-C.
As far as moving Dashcode to xCode, this is a very simple process. Once you learn it, which it only takes one time doing it, you will fly through it. I do remember seeing a video the author posted on his website on how to do this. So if you struggle understanding how to migrate the source from Dashcode to xCode, take a look at the authors site.
Something that is really nice that the author did was include a ton of examples on how to use QCiPhone. This includes Dashcode and xCode examples. It includes a nice map example. However it is not the embedded 3.0 map, it is a little different but still works nicely. It allows you to place pins on the map as well as use your fingers to pinch and expand.
So far the book does not mention the use of google group the author set up. If you have questions, you can always post them on the QC google group. Which I have been out there many times searching for methods other users have posted. You can also communicate with the author directly on that site. He is very helpful.
I like how the author has given you a nice model to follow, ie. Validation Control Functions, Business Control Functions, View Control Function, and Error Control Functions. By following this model, you can create a nice modular app with reusable code.
Overall, the book is a great place to start developing your first web app that you put on the app store.
- Reviewed in the United States on July 30, 2009Format: PaperbackThis book demonstrates new ways and techniques for writing hybrid applications. It should be a part of any iPhone developer's library. It is clearly written and very easy to understand and follow. I was able to get the example projects running very quickly and use them to better understand the author' ideas.
If you can't easily follow this book, then you may not be ready to develop iPhone applications! It's very straight forward stuff.
Even if you are a seasoned Objective-C developer it would not be a bad idea to read this book, if only to see what these guys are up to.
Highly recommended