iPhone JavaScript Cookbook

Clear and practical recipes for building web applications using JavaScript and AJAX without having to learn Objective-C or Cocoa

iPhone JavaScript Cookbook

Cookbook
Arturo Fernandez Montoro

Clear and practical recipes for building web applications using JavaScript and AJAX without having to learn Objective-C or Cocoa
$26.99
$44.99
RRP $26.99
RRP $44.99
eBook
Print + eBook
$12.99 p/month

Get Access

Get Unlimited Access to every Packt eBook and Video course

Enjoy full and instant access to over 3000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781849691086
Paperback328 pages

About This Book

  • Build web applications for iPhone with a native look feel using only JavaScript, CSS, and XHTML
  • Develop applications faster using frameworks
  • Integrate videos, sound, and images into your iPhone applications
  • Work with data using SQL and AJAX
  • Write code to integrate your own applications with famous websites such as Facebook, Twitter, and Flickr
  • These practical recipes include code and screenshots offering a clear step-by-step guide using different frameworks

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 apps a native look and feel though you won't be able to submit them to the App 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 Apple's totalitarian App Store regime.

Table of Contents

Chapter 1: Frameworks Make Life Easier
Introduction
Installing the iUI framework
Installing the UiUIKit framework
Installing the XUI framework
Installing the iWebKit framework
Installing the WebApp.Net framework
Installing the PhoneGap framework
Installing the Sencha Touch framework
Installing the Apple Dashcode framework
Chapter 2: Building Interfaces
Introduction
Creating a toolbar
Modifying the default status bar
Creating a footer
Creating a back button
Creating a button for the toolbar
Building a breadcrumb menu
Building the duo navigation buttons
Building the lists for items
Building menus using lists
Creating the toggle buttons
Creating a modal box with buttons
Building a search dialog
Building the information fields
Building forms with checkboxes, radio buttons, select fields, and text fields
Creating and customizing a notification box
Building a chat-style interface
Creating a date picker
Using different tabs
Chapter 3: Events and Actions
Introduction
Identifying the devices
Viewing applications in full screen
Detecting full screen or browser mode
Scaling to device width
Preventing scaling
Detecting one-finger events
Detecting multi-touch events
Preventing the default behavior for events
Chapter 4: A Picture Speaks a Thousand Words
Introduction
Choosing an icon image for the application
Specifying a splash image
Displaying an image inside a container
Creating a grid with images
Creating a carousel for images
Rotating images
Scaling an image by applying animations
Taking and displaying pictures
Drawing geometric figures
Applying colors
Working with gradients
Adding an activity indicator
Chapter 5: Mastering Sound and Music
Introduction
Making a beep alert
Making a vibrate alert
Creating an iPod playlist and playing a specific item
Loading an iTunes playlist
Playing an audio file
Playing a video
Recording an audio
Chapter 6: Exchanging Data: AJAX
Introduction
How to send HTTP requests
Processing JSON responses
Sending cross-domain requests
Chapter 7: Working with Data: Storage and SQL
Introduction
Creating a database
Creating a table
Inserting records
Searching and selecting records
Deleting records
Saving and reading preferences
Storing data in session
Chapter 8: This is a Phone
Introduction
Calling a number
Sending an SMS to a number
Selecting contacts
Creating a new contact
Searching and displaying contacts
Chapter 9: Location, Location, Location
Introduction
Detecting current orientation
Identifying the current location
Opening Google Maps at a specific location
Calculating distances between two points
Chapter 10: Web 2.0 Integration
Introduction
Embedding an RSS feed
Opening a YouTube video
Posting on your Facebook wall
Retrieving recent tweets from Twitter
Displaying photos from Flickr

What You Will Learn

  • Installing and configuring a set of frameworks to make your life easier for developing web applications for iPhone
  • Designing graphical user interfaces for iPhone applications using XHTML, CSS, and JavaScript
  • Working with different events, actions, and effects, including touch gestures, multi-touch events, drag & drop, and sliding
  • Dealing with images and pictures including accessing the device's camera
  • Adding video and sound for your iPhone web applications
  • Applying AJAX for better performance in web applications
  • Differences between native and web applications for iPhone
  • Working with data and SQL using the new HTML 5 features of Safari Mobile
  • Accessing phone-specific features such as the Address Book for contacts
  • Recognizing accelerometer movements and other features about positioning and geolocation
  • Integrating your application with popular third-party websites and services such as Facebook, Twitter, and Flickr

In Detail

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.

Authors

Table of Contents

Chapter 1: Frameworks Make Life Easier
Introduction
Installing the iUI framework
Installing the UiUIKit framework
Installing the XUI framework
Installing the iWebKit framework
Installing the WebApp.Net framework
Installing the PhoneGap framework
Installing the Sencha Touch framework
Installing the Apple Dashcode framework
Chapter 2: Building Interfaces
Introduction
Creating a toolbar
Modifying the default status bar
Creating a footer
Creating a back button
Creating a button for the toolbar
Building a breadcrumb menu
Building the duo navigation buttons
Building the lists for items
Building menus using lists
Creating the toggle buttons
Creating a modal box with buttons
Building a search dialog
Building the information fields
Building forms with checkboxes, radio buttons, select fields, and text fields
Creating and customizing a notification box
Building a chat-style interface
Creating a date picker
Using different tabs
Chapter 3: Events and Actions
Introduction
Identifying the devices
Viewing applications in full screen
Detecting full screen or browser mode
Scaling to device width
Preventing scaling
Detecting one-finger events
Detecting multi-touch events
Preventing the default behavior for events
Chapter 4: A Picture Speaks a Thousand Words
Introduction
Choosing an icon image for the application
Specifying a splash image
Displaying an image inside a container
Creating a grid with images
Creating a carousel for images
Rotating images
Scaling an image by applying animations
Taking and displaying pictures
Drawing geometric figures
Applying colors
Working with gradients
Adding an activity indicator
Chapter 5: Mastering Sound and Music
Introduction
Making a beep alert
Making a vibrate alert
Creating an iPod playlist and playing a specific item
Loading an iTunes playlist
Playing an audio file
Playing a video
Recording an audio
Chapter 6: Exchanging Data: AJAX
Introduction
How to send HTTP requests
Processing JSON responses
Sending cross-domain requests
Chapter 7: Working with Data: Storage and SQL
Introduction
Creating a database
Creating a table
Inserting records
Searching and selecting records
Deleting records
Saving and reading preferences
Storing data in session
Chapter 8: This is a Phone
Introduction
Calling a number
Sending an SMS to a number
Selecting contacts
Creating a new contact
Searching and displaying contacts
Chapter 9: Location, Location, Location
Introduction
Detecting current orientation
Identifying the current location
Opening Google Maps at a specific location
Calculating distances between two points
Chapter 10: Web 2.0 Integration
Introduction
Embedding an RSS feed
Opening a YouTube video
Posting on your Facebook wall
Retrieving recent tweets from Twitter
Displaying photos from Flickr

Book Details

ISBN 139781849691086
Paperback328 pages
Read More