Book Image

iPhone JavaScript Cookbook

By : Arturo Fernandez Montoro
Book Image

iPhone JavaScript Cookbook

By: Arturo Fernandez Montoro

Overview of this book

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. The iPhone JavaScript Cookbook 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. 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 iPhone JavaScript Cookbook, 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.
Table of Contents (17 chapters)
iPhone JavaScript Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Working with gradients


iPhone's user interface makes intensive use of gradients and shading for achieving a good looking user experience. For example, a glossy effect can be created by applying gradients of different colors. Through colors and gradients we can get a closer interface to how native applications look and feel.

A gradient can be applied to a figure as either linear or radial to our shapes and figures, the difference being the direction in which the gradient is applied. Linear gradients need a starting and ending point. On the other hand, radial gradients need to define applied circle to be. From the geometric point of view, linear gradients are applied through a simple vector and radial gradients are defined using a two-dimensional array of vectors.

The required HTML files for this recipe can be reached at: code/ch04/gradients/ in the code bundle provided on the Packtpub site.

Getting ready

As you've seen in other recipes regarding canvas element, we don't need to use any specific...