Introduction

The amazing success of the iPhone over the past two years clearly indicates that application developers are entering a brave new world of sophisticated, multifunctional mobile applications. No longer do applications and various media need to live in separate silos. Instead, mobile Web-based applications can bring together elements of Web 2.0 apps, traditional desktop apps, multimedia video and audio, and cell phones.

This book covers the various aspects of developing Web-based applications for the iPhone and iPod touch. Specifically, you will discover how to create a mobile application from the ground up, utilize existing open source frameworks to speed up your development times, emulate the look and feel of built-in Apple applications, capture finger touch interactions, use Ajax to load external pages, and optimize applications for WiFi and 3G networks.

Who This Book Is For

This book is aimed primarily for Web developers already experienced in Web technologies who want to build new applications for iPhone or migrate existing Web apps to this platform. In general, readers should have a working knowledge of the following technologies:

  • HTML/XHTML

  • CSS

  • JavaScript

  • Ajax

However, if you are less experienced working with these technologies, be sure to take advantage of the primer at the start of this book.

What This Book Covers

This book introduces readers to the Web application platform for iPhone OS 3.0. It guides readers through the process of building new applications from scratch and migrating existing Web applications to this new mobile platform. As it does so, it helps readers design a user interface that is optimized for the iPhone touch-screen display and integrate their applications with iPhone services, including Phone, Mail, Google Maps, and GPS.

The chapter-level breakdown is as follows:

  1. Introducing Safari/WebKit Development for iPhone 3.0: Explores the Safari development platform and walks you through the ways you can develop for iPhone.

  2. Working with Core Technologies: Provides an overview of some of the key technologies you'll be working with as you develop iPhone Web apps. Pays particular attention to scripting and the Document Object Model.

  3. Building with Web App Frameworks: Highlights the major open source iPhone Web app frameworks and shows you how to be productive quickly with each of them.

  4. Designing a Usable and Navigable UI: Overviews the key design concepts and principles you need to use when developing a highly usable interface for Safari on iPhone.

  5. Styling with CSS: Discusses WebKit-specific styles that are useful for developing Web apps for iPhone and iPod touch.

  6. Programming the Interface: Provides a code-level look at developing an iPhone Web application interface.

  7. Handling Touch Interactions and Events: The heart of an iPhone is its touch screen interface. This chapter explores how to handle touch interactions and capture JavaScript events.

  8. Programming the Canvas: Safari on iPhone browser provides full support for canvas drawing and painting, opening opportunities for developers.

  9. Special Effects and Advanced Graphics: The Safari canvas provides an ideal environment for advanced graphics techniques, including gradients and masks.

  10. Integrating with iPhone Services: Discusses how a Web application can integrate with core iPhone services, including Phone, Mail, Google Maps, and GPS.

  11. Offline Applications: Covers how you can use HTML 5 offline cache to create local Web apps that don't need a live server connection.

  12. Enabling and Optimizing Web Sites for the iPhone and iPod Touch: Covers how to make an existing Web site compatible with Safari and then how to optimize the site for use as a full-fledged Web application.

  13. Bandwidth and Performance Optimizations: Deals with the all-important issue of performance of Web-based applications and what techniques developers can use to minimize constraints and maximize bandwidth and app execution performance.

  14. Packaging Apps as Bookmarks: Bookmarklets and Data URLs: This chapter explains how you can employ two little-used Web technologies to support limited offline support.

  15. Debug and Deploy: Discusses various methods of debugging Safari Web applications.

  16. iPhone SDK: From Web App to Native App: How do you know when you need to move your Web app to a native iPhone? This chapter explores migration strategies and introduces you to the iPhone SDK.

What You Need to Use This Book

To work with the examples of this book, you need the following:

  • iPhone

  • Safari for Mac or Windows

The complete source code for the examples is available for download from our Web site at www.wrox.com.

Conventions

I used several conventions throughout this book to help you get the most from the text.

  • New terms are italicized when I introduce them.

  • URLs and code within the text are in a monospaced font, such as <div class="panel">.

  • Within blocks of source code, I occasionally want to highlight a specific section of the code. To do so, I use a gray background. For example:

    addEventListener("load", function(event) {
        convertSrcToImage(0);
        photoEnabled = true;
        showPhoto(1);
        }, false);

Source Code

As you work through the examples in this book, you can type in all the code manually or download the source code files from the Wrox Web site (www.wrox.com). At the site, locate the book's detail page using Search or by browsing through the title listings. On the page, click the Download Code link, and you are ready to go.

You may find it easiest to search by ISBN number. This book's ISBN is 978-0-470-54966-7.

Errata

The editors and I worked hard to ensure that the contents of this book are accurate and there no errors either in the text or in the code examples. However, in case future iPhone OS releases impact what's been said here, I recommend visiting www.wrox.com and checking out the Book Errata link. You will be taken to a page that lists all errata that has been submitted for the book and posted by Wrox editors.

If you discover an issue that is not found on the Errata page, I would be grateful if you let us know about it. To do so, go to www.wrox.com/contact/techsupport.shtml and provide this information in the online form. The Wrox team will double-check your information and, as appropriate, post it on the Errata page. In addition, Wrox will correct the problem in future versions of the book.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.104.5