Cover image for Building iPhone Apps with HTML, CSS, and JavaScript

Book description

It's a fact: if you know HTML, CSS, and JavaScript, you already have the tools you need to develop your own iPhone apps. With this book, you'll learn how to use these open source web technologies to design and build apps for both the iPhone and iPod Touch, on the platform of your choice -- without using Objective-C, Xcode, or Interface Builder.

What are the advantages? Device-agnostic apps are the wave of the future, especially for mobile devices, and this book shows you how to create one product that can be used on several platforms. You'll get guidelines for quickly converting your product into a native iPhone app, using the free PhoneGap framework. And you'll learn why releasing your product as a web app first helps you find, fix, and test bugs much faster than if you went straight to the App Store with a product built with Apple's tools.

  • Build iPhone apps using tools you already know how to use

  • Compare the pros and cons of web apps and native iPhone apps

  • Learn how to make an existing website look and behave like an iPhone app

  • Add native-looking animations to your web app using jQTouch

  • Take advantage of client-side data storage with apps that run even when the iPhone is offline

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

Table of Contents

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