Book Image

Sencha Touch Cookbook, Second Edition

By : Ajit Kumar
Book Image

Sencha Touch Cookbook, Second Edition

By: Ajit Kumar

Overview of this book

<p>Sencha Touch is one of the most popular HTML5 and JavaScript frameworks for building touch-based mobile devices. Using Sencha Touch, you can create applications for touch mobile devices with ease, and once created, the same application works on multiple platforms – iOS, Android, Blackberry – without having to change anything.</p> <p>Sencha Touch Cookbook, Second Edition is a practical, hands-on guide with easy to follow recipes that provide you with clear, step-by-step instructions, which will help you take complete advantage of the power of Sencha Touch 2 and will help you to build amazing applications for the mobile world.</p> <p>Sencha Touch Cookbook, Second Edition starts by showing you how to set up your project for development, then walks through building, packaging, and running it in a browser, emulator, or a real device. With the groundwork set, the subsequent recipes of the book take you through the different UI components offered by the framework and explains how to use them, when to use them, and, if needed, how to extend them for your own application need.</p> <p>You will also learn how to model your client side data, load data from different data sources, and use them on the data-centric UI components. The later parts of the book cover the practical day-to-day problems like how to create a custom view, how to take your application offline and support automatic sync, how to utilize the Geolocation to learn more about the user, how to utilize device features such as camera, contact, orientation, and how to link your application behaviour with the device buttons such as Back, Search, and so on. At the end, the book shows you how to create native packages without using PhoneGap/Cordova using Sencha Cmd.</p> <p>Using this book, you will learn everything about using Sencha Touch classes and components to build mobile applications that can run across multiple platforms.</p>
Table of Contents (17 chapters)
Sencha Touch Cookbook Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

Sencha touch is a versatile HTML5-based framework for developing mobile web applications that look and feel native on touchscreen devices; 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 Second Edition has a comprehensive selection of recipes covering everything from installation right through to HTML5 geolocation.

This book really is your one-stop resource for cross-platform HTML5 application development. It covers the basics such as setting up an iOS, Android, and Blackberry development environment right through to much more complex development issues such as animation, rich media, geolocation, and device features. Every recipe is practically focused. Maximum action. Minimum theory.

What this book covers

Chapter 1, Gear Up for the Journey, covers the steps required to set up the environment to develop, deploy, and test Sencha Touch-based applications.

Chapter 2, Catering to Your Form-related Needs, explains how to create a form using Sencha Touch and the different form fields that can be used to work effectively with the forms.

Chapter 3, Containers and Layouts, covers all the layouts that the framework offers and how one can use them to structure their widgets on the screen.

Chapter 4, Building Custom Views, explains how one can create very custom-looking, data-driven, interactive view, and which classes need to be used for the same.

Chapter 5, Dealing with Data and Data Sources, covers every aspect of loading data from local or remote data sources, dealing with XML/JSON data, data translation, building client-side caches, and sharing the data across different UI components.

Chapter 6, Adding Components, covers components such as lists, buttons, the picker, action sheets, and tab panels. It also explains how to create new components or extend the existing ones.

Chapter 7, Adding Audio/Visual Appeal, covers how to work with audio and video components. Also, it covers the different charts that one can use to present data, visually, to the user.

Chapter 8, Taking Your Application Offline, introduces the concept of offline support and covers the steps that an application developer shall take to make their application work in online as well as offline mode.

Chapter 9, Increased Relevance Using Geolocation, covers how to get geolocation details inside the application and integrate it with Google Map.

Chapter 10, Device Integration, explains the different device features across different devices (for example, cameras, contacts, back button, and home button) and how one can integrate them inside the application to give a better user experience to the device user.

What you need for this book

To run the samples, provided in the book, you need the following software:

  • Sun JDK Version 1.5 or above

  • Android Developer Tools (ADT) Bundled Eclipse

  • Apache Cordova 2.4.0

  • Apache Ant 1.8.4 or above

  • Sencha Touch 2.2.1 library

  • XCode 4

  • BlackBerry WebWorks SDK

Who this book is for

This book is ideal for anyone who wants to gain the practical knowledge involved in using Sencha Touch mobile web application framework to make attractive web applications for mobile phones. If you have some familiarity with HTML and CSS, then this book is for you. This book will give designers the skills they need to implement their ideas and provide developers with creative inspiration through practical examples. It is assumed that you know how to use touchscreens, touch events, WebKit on mobile systems, Apple iOS, Google Android for mobile phones, and BlackBerry.

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: "Create and open a new file ch01_05.js in the ch01 folder and paste the following code in it."

A block of code is set as follows:

Ext.application({ 
    name: 'MyApp',
    launch: function() {

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

Ext.application({ 
    name: 'MyApp',
    launch: function() {

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

ant blackberry build

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: "Launch Xcode and go to Preferences."

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 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. You can also find the code at: https://github.com/ajit-kumar-azad/SenchaTouch2Cookbook

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/submit-errata, 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.