9780596805784
index.html

Building iPhone Apps with HTML, CSS, and JavaScript

Making App Store Apps Without Objective-C or Cocoa

Abstract

This book is published and is no longer accepting comments on OFPS. Please consider purchasing the print book or ebook. Thank you for supporting OFPS!

Note

This book uses the Open Feedback Publishing System (OFPS), an O'Reilly experiment that tries to bridge the gap between private manuscripts and public blogs.

Next to every paragraph, there is a link you can use to comment on what you're reading. We are grateful for any feedback you have: questions, comments, suggestions, and corrections are all welcome and appreciated.

Now web designers and developers can join the iPhone app party without having to learn Cocoa's Objective-C programming language. It's true: You can write iPhone apps quickly and efficiently using your existing skills with HTML, CSS, and JavaScript. This book shows you how with lots of detailed examples, step-by-step instructions, and hands-on exercises.

  • Learn how to build iPhone apps with standard web tools

  • Refactor a traditional website into an iPhone web app

  • Hook into advanced iPhone features (e.g. accelerometer, geolocation, vibration, and sound) with JavaScript

  • Do most of your development with the operating system of your choice

Learn more and order at the book's catalog page or watch an introductory screencast.


Dedication

To Erica—and that little jumping bean in her tummy.

Preface
Who Should Read This Book
What You Need to Use This Book
Conventions Used in This Book
Using Code Examples
Safari® Books Online
How to Contact Us
Acknowledgments
1. Getting Started
Web Apps Versus Native Apps
What Is a Web App?
What Is a Native App?
Pros and Cons
Which Approach Is Right for You?
Web Programming Crash Course
Intro to HTML
Intro to CSS
Intro to JavaScript
2. Basic iPhone Styling
First Steps
Preparing a Separate iPhone Stylesheet
Controlling the Page Scaling
Adding the iPhone CSS
Adding the iPhone Look and Feel
Adding Basic Behavior with jQuery
What You’ve Learned
3. Advanced iPhone Styling
Adding a Touch of Ajax
Traffic Cop
Simple Bells and Whistles
Roll Your Own Back Button
Adding an Icon to the Home Screen
Full Screen Mode
Changing the Status Bar
Providing a Custom Startup Graphic
What You’ve Learned
4. Animation
With a Little Help from Our Friend
Sliding Home
Adding the Dates Panel
Adding the Date Panel
Adding the New Entry Panel
Adding the Settings Panel
Putting It All Together
Customizing jQTouch
What You’ve Learned
5. Client-Side Data Storage
localStorage and sessionStorage
Saving User Settings to localStorage
Saving the Selected Date to sessionStorage
Client-Side Database
Creating a Database
Inserting Rows
Selecting Rows and Handling Result Sets
Deleting Rows
What You’ve Learned
6. Going Offline
The Basics of the Offline Application Cache
Online Whitelist and Fallback Options
Creating a Dynamic Manifest File
Debugging
The JavaScript Console
The Application Cache Database
What You’ve Learned
7. Going Native
Intro to PhoneGap
Using the Screen’s Full Height
Customizing the Title and Icon
Creating a Startup Screen
Installing Your App on the iPhone
Controlling the iPhone with JavaScript
Beep, Vibrate, and Alert
Geolocation
Accelerometer
What You’ve Learned
8. Submitting Your App to iTunes
Creating an iPhone Distribution Provisioning Profile
Installing the iPhone Distribution Provisioning Profile
Renaming the Project
Prepare the Application Binary
Submit Your App
While You Wait
Further Reading
Index
Site last updated on: September 7, 2011 at 07:00:43 AM PDT
Cover for Building iPhone Apps with HTML, CSS, and JavaScript

View 4 comments

  1. nroper – Posted Feb. 27, 2010

    Picked this book up from the O'Reilly stand at the UK PHP Conference 2010 yesterday - sounds like a great way to develop & deploy apps - paricularly those with a related web site - looking forward to getting stuck in!

  2. leemore – Posted April 15, 2010

    I've purchased the iphone App and the reading is 90% great. The only thing is example go off-page and I don't see an alternative to the cd-rom that is being referred to for the physical book.

  3. TomHawksmoor – Posted June 12, 2010

    Rather sad to see the abuse of this system by a person selling goods. Apart from "her" contributions, it all looks very tidy and readable, and an interesting experiment. I do wonder though whether (as appears in later comments) the feelings of those who actually paid for this book before this free edition appeared are considered; I would personally be pretty annoyed, I think, having parted with a lot of hard cash for the printed item, to see the same thing available for nothing on this web site. Though, equally, maybe I might feel the book is so good is so good that I'll be happy with buying the hard copy version. A difficult balancing act.

  4. mooncalf – Posted Aug. 23, 2010

    Thank you so much Jonathan Stark for your fantastic explanations! This is the best how-to site I've ever seen.

View 8 comments

  1. coachitpete – Posted Feb. 2, 2010

    This is a really good idea and I hope it's successful.

  2. jonathanstark – Posted Feb. 3, 2010

    Thanks! O'Reilly is visionary - I think it'll work out great.

  3. sjreyes – Posted March 20, 2010

    This is the book you referred to at your SXSW panel, right? Off to buy it at NerdBooks and wanted to make sure I have the right one. Great panel btw.

  4. jonathanstark – Posted April 2, 2010

    @sjreyes - Yep, this is the book. Glad you liked the panel and hope you like the book :)

  5. jonathanstark – Posted April 4, 2010

    @johncee Not sure I follow. Can you elaborate?

  6. douglerner – Posted April 30, 2010

    I am curious too. Is the entire book available here for reading/commenting on? I purchased the e-book and was curious if I could have just read it here instead. Of course I do want to support the author for his work, but was just curious. Thanks!

  7. gbrackett – Posted May 21, 2010

    I have paid for and downloaded both the PDF and ePub versions of this book, which I find extraordinarily informative and well-written. I've just found this great addition while working through the book (I'm in Chapter 5). I wanted to say how helpful it is to read a new book with other readers' commentary and questions, as well as notes and answers from the author.

  8. Michael Chan – Posted Dec. 6, 2010

    I have a few question that need to clarify before proceeding with creating the iPhone apps.

    After I created the iPhone app, can I make it available for download on my website other than Apple store?

    The iPhone app that I want to make available for free, but it links to my video storefront membership that if user subscribe, they will pay a subscription fee through Paypal gateway. In such a case, do I have to pay 30% of the recurring sales to Apple??

    Thanks!

View 1 comment

  1. Richard Nielsen – Posted July 24, 2011

    For me the biggest obstacle to overcome in developing an iphone app was learning the Cocao C programming language. Now that apps can be built using standard web tools, I'm able to easily develop the first non 12 step app.

            View 1 comment

            1. leemore – Posted April 23, 2010

              I had no idea there was a video. It just gets better. Now I'm just hoping it sails smoothly on Windows