Book Image

iPhone JavaScript Cookbook

By : Arturo Fernandez Montoro
Book Image

iPhone JavaScript Cookbook

By: Arturo Fernandez Montoro

Overview of this book

<p>Undoubtedly, the iPhone is one of the most exciting mobile devices in the world. Its iOS is used in other Apple devices such as the iPad and iPod Touch. With this book you'll learn how to build and develop applications for these devices without applying Apple's burdensome and at times restrictive technologies. Just use your experience and knowledge combined with web front-end technologies like JavaScript to build quality web apps. Nobody will know you haven't used Objective-C and Cocoa.</p> <p>The <i>iPhone JavaScript Cookbook</i> offers a set of practical and clear recipes with a step-by-step approach for building your own iPhone applications applying only web technologies such as JavaScript and AJAX. Web developers won't need to learn a new programming language for building iOS applications with a native look and feel.</p> <p>The first part of the book introduces you to the world of iPhone applications. Understanding how it works is required for designing good user interfaces for this device. You will continue learning about how to apply multimedia features to your applications. Common features of web applications, such as AJAX and SQL, can also be applied to our iPhone applications. The third part of the book explains how to deal with specific features of iPhone such as the accelerometer. At the end, you learn how to offer additional features through external websites. With the <i>iPhone JavaScript Cookbook</i>, you will be able to develop outstanding web applications with a for Apple's mobile devices, offering your users all of the advantages of the native look and feel.</p>
Table of Contents (17 chapters)
iPhone JavaScript Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

Undoubtedly, iPhone is one of the most exciting mobile devices in the world. Its iOS is used in other Apple devices, such as iPad and iPod Touch. With this book, you'll learn how to build and develop applications for these devices without applying Apple's burdensome and, at times, restrictive technologies. Just use your experience and knowledge combined with web frontend technologies, such as JavaScript, to build quality web applications. Nobody will ever come to know that you haven't used Objective-C and Cocoa.

iPhone JavaScript Cookbook offers a set of practical and clear recipes with a step-by-step approach for building your own iPhone applications by only applying web technologies such as JavaScript and AJAX. Web developers won't need to learn a new programming language for building iOS applications with a native look and feel.

What this book covers

Chapter 1 , Frameworks Make Life Easier, is the "getting started" chapter of this book. It covers how to install and set up different frameworks, which will be used for the recipes of the book.

Chapter 2 , Building Interfaces, introduces you to the world of iPhone applications. You'll learn how to build essential and advanced interfaces, such as buttons, lists, forms, and date pickers.

Chapter 3 , Events and Actions, discovers how to deal with events and actions. Both allow us a better control of the interaction between the user and the device.

Chapter 4 , A Picture Speaks a Thousand Words, takes advantage of the great screens of iPhone and iPad teaching you how to display a grid of images, how to apply different effects, and how to work with the built-in camera of the device.

Chapter 5 , Mastering Sound and Music, explores the audio and video capabilities of iPhone. You'll learn how to play and record audio and how to create iPod playlists.

Chapter 6 , Exchanging Data: AJAX, covers how to use this technology for exchanging data between the server and the client. Readers are walked through the process of sending HTTP requests and processing JSON responses.

Chapter 7 , Working with Data: Storage and SQL, provides coverage of the process for storing and retrieving data using the SQL language. Also, you'll learn how to deal with different kinds of storage available in iPhone.

Chapter 8 , This is a Phone, enlightens that we cannot forget that iPhone is a smartphone. This is the reason to get focused on learning how to create, select and display contacts, and how to call a number and send an SMS.

Chapter 9 , Location, Location, Location, introduces to readers to geolocation, showing how to detect the current orientation and position, and how to use the API provided by Google Maps for displaying a map at a specific location.

Chapter 10 , Web 2.0 Integration, helps readers learn how to integrate their iPhone applications with third-party popular services such as Facebook, YouTube, Twitter, and Flickr.

What you need for this book

If you're planning to build native applications, you'll need a computer with Mac OS X, iOS SDK, and Xcode installed.

Despite the fact that it's possible to use a WebKit-compatible web browser for the recipes of this book, we suggest to use a real Apple device, such as an iPhone and iPad. However, the iPhone Simulator is a very useful tool that you can use on your Mac for testing applications.

Who this book is for

This book is for web developers interested in applying their knowledge for building web applications for iOS devices. You can develop your own iPhone web applications using nothing but JavaScript combined with XHTML and CSS. You can even give these applications a native look and feel though you wont be able to submit them to the application store. You will develop an application for iOS without having to learn the Objective-C programming language. This is the book for any iPhone developer looking to side step the totalitarian application store regime of Apple.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "we'll need to add a span element for the smallfield label."

A block of code is set as follows:

<div id="leftnav">
<ahref="#">One</a>
<ahref="#">Two</a>
<ahref="#">Current</a>
</div>

Any command-line input or output is written as follows:

$ wget http://iui.googlecode.com/files/iui-0.31.tar.gz

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "After clicking on the Search button, we'll see our dialog box:"

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail .

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books — maybe a mistake in the text or the code — we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.