Book Image

Sencha Touch Cookbook

By : Ajit Kumar
Book Image

Sencha Touch Cookbook

By: Ajit Kumar

Overview of this book

Sencha touch is a versatile HTML5-based framework for developing mobile web apps that look and feel native on touch screen devices, and with it you can write your code once and deploy it to both iOS and Android saving you both time and money. The Sencha touch cookbook has a comprehensive selection of recipes covering everything from installation right through to HTML5 geo location. The Sencha Touch Cookbook really is your one stop resource for cross platform HTML5 application development. It covers the basics such as setting up an iOS and Android development environment right through to much more complex development issues such as touch gestures, animation, rich media and geo location. Every recipe is practically focused. Maximum action. Minimum theory.
Table of Contents (17 chapters)
Sencha Touch Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Introduction


Like any other development, the first and foremost thing which is required, before we embark on our journey, is setting up the right environment so that the development, deployment, and testing becomes easy and effective. Moreover, this calls for a list of tools which are appropriate in this context. In this chapter, we will cover the topics related to setting up the environment using the right set of tools. Sencha Touch works on Android, iOS, and Blackberry platforms. For each of these platforms, we will see what steps we need to follow to set up the complete development and deployment environment. We will be packaging our Sencha Touch-based application using PhoneGap. PhoneGap is another JavaScript framework which provides the following two important capabilities:

  1. The APIs needed to access the device features such as camera, address book, and so on.

  2. A build mechanism for writing the code once (in the form of JS, HTML, CSS) and packaging them for different platforms such as iOS, Android, and so on.

Throughout the book, we will be using the following software:

  • Sun JDK Version 1.5 or above

  • Eclipse 3.3 or above

  • PhoneGap 1.0.0

  • Sencha Touch 1.1.0 library

  • Android SDK

  • ADT Plugin

  • XCode 4

  • Blackberry SDK

Before we get any further, you should download and install the following, which will act as a common base for all our discussions:

  • Sun JDK 1.5 or above

  • Eclipse 3.3 or above

  • Sencha Touch 1.1.0 library

After downloading the Sencha Touch library, extract it to a folder, say c:\sencha-touch. When you extract the folder, you would see the folders as shown in the following screenshot:

There are many files, however, which are not required for development and testing.

Note

The docs folder contains the documentation for the library and is very handy when it comes to referring to the properties, configs, methods, and events supported by different classes. You may want to copy it to a different folder, so that you can refer to the documentation whenever needed.

Delete the files and folders which are enclosed within the rectangles as shown in the following screenshot:

This prepares us to get started. As Sencha Touch is a JavaScript library, you may want to configure your Eclipse installation for JavaScript development. You may install the Spket plug-in and configure it for Sencha Touch development. Steps to do so are detailed on the Spket website (http://spket.com/) and hence have been excluded from this book.