Installing the iWebKit framework (iPhone JavaScript)

The iWebKit is a framework focused on being fast, lightweight, and specifically for developing web applications and websites for Apple’s devices. Installation is a straightforward process, as we’ll see in this recipe.

Getting ready

This framework can be downloaded for free from its main website. As it is distributed as a ZIP file, we’ll need a web browser or command-line utility, as seen in the previous recipes, and a tool for decompressing.

How to do it…

Point your browser at the following URL and download the file through the Download button:

http://snippetspace.com/projects/iwebkit/ When the download is finished, decompress the file:

tmp1A19_thumb

Finally, copy the JavaScript, CSS, and graphic files to a folder under DocumentRoot. For example, on Ubuntu Linux, we’ll execute the following commands:

tmp1A20_thumb


Our iWebKit copy is ready to use for iPhone web application development.

How it works…

After decompressing the main ZIP file, you’ll see different files and folders. Most important is the Framework folder that contains the required JavaScript, graphics, and stylesheet files for developing our own applications. iWebKit also includes some PDF files, one of them is a practical user’s guide showing how to use the framework through many examples. The last folder included in the ZIP file is called iWebKit demo and it contains examples, including some PHP files for showing how to establish a communication between the client and the server side of web applications.

The HTML files of our applications developed using this framework should include the following lines in the head section:

tmp1A21_thumb

By observing the preceding lines, we guess style.css is the main stylesheet and functions.js is the file that has the main JavaScript code used for the framework. Probably, we’ll use some images as well. In this case, don’t forget to use a reference to the images folder.

There’s more…

The Userguide.pdf is a small tutorial introducing the iWebKit framework and it is really useful for an initial contact. This document is focused on practical issues, avoiding internal details. Another good starting point is the included examples; load the index.html file on your browser or on your Apple device. This file allows access to different examples showing some features and functionalities.

tmp1A-22

Before starting the development using this framework, you can take a look at some of the websites and applications developed by others. iWebKit’s website has a special page showing these examples:

http://snippetspace.com/projects/iwebkit/demo/

Forums allow the developers and users to exchange questions, answers, and knowledge. iWebkit has its own forum open to everyone; you only need to register to send your own questions and answers. This interesting forum can be reached at:

http://snippetspace.com/forum/

Next post:

Previous post: