Sencha Touch Cookbook – 2nd edition


Overview

Ajit Kumar (CTO, Walking Tree) is a very good friend of mine and we co-founded Walking Tree in 2008. It is my pleasure to be reviewing his fourth book, “Sencha Touch Cookbook, Second Edition”. I must say that previous three books “ADempiere 3.6 Cookbook“, “Sencha Touch Cookbook“, “Sencha MVC Architecture” have been of great help to the community and our own developers have taken significant advantage of these books. Like other cookbooks of Packt Publishing, the Sencha Touch Cookbook also provides you number of recipes to help you understand and use the complete Sencha Touch framework.
Every recipes comes with “Getting ready”, “How to do it”, “How it works”, “There’s more” and “See also”, which enables you to understand the problem, solve the problem, understand the mechanism of the solution and cover the related concept and further expand your knowledge. Further, the recipes for the similar topics are grouped into chapter, which gives you a holistic view of the topic. Through “Warnings or important notes” and “Tips and tricks” the author has shared his experiences with the audience, which makes the reading further pleasant.
Before we get into the content of the book, you may like to know that “Sencha Touch is an HTML5-based, high-performance mobile application framework which enables developer to build applications for touch devices which runs on most of the commonly used platforms (for example Android, iOS, Blackberry and Windows Phone 8).“.
In the beginning of the book, Ajit talks about the list of software that you would need to be able to practice the concepts discussed in the book. For example for an android application development I have set-up following software:
In order to appreciate the book, it is important that you do play with the examples given in the book. Also, occasionally you may like to refer to Sencha docs to gain required completeness in terms of API definitions.

Review Comments

This book tries to set you up and running on multiple OS / Devices and that is a commendable job. To large extent it gives you a detailed step; many times with screenshots in place; to set-up the required environment variables and paths and that keeps you away from the unnecessary anxiety. Getting the first android app created by just following the steps was thrilling and it demonstrates that the author exactly knows what a developer need.

I like the way this books starts by letting you create your project for the target device(s), identify the available features on your device , make use of the profiles capability to give device specific view to your application and recognize orientation change to make use of the changed orientation.

The chapters on Forms contains exhaustive list of recipes for different field types and important configurations around them. Finally in the end it also talks about form validation and it rightly talks about having various ways to perform validation in Sencha Touch. However, I would have liked to see the form validation using the model’s data validation capability as additional example. Specially when you retrieve or save data of a form using the model then this will of course be handy. The model validation has been covered later in the book and you may like to try validating your forms once you complete the chapter on data models.

Understanding of layout is always important and it is really good to see a dedicated chapter on that. Also, it was cool to see the card layout being explained using the navigation example and of course the author followed that up with a very detailed explanation for the inbuilt navigation view. Further a dedicated chapter on views enables you to build your own custom views, where off-the-shelf Sencha Touch components may not be sufficient.

As soon as you feel that you are ready to build you own views, the book comes up with explanation on a very important aspect of the application; the data itself. It talks about models, stores, storage and their usage in great detail. It also talks about practical problems like cross origin issues, caching, pagination, remote sorting vs local sorting, etc and that makes this chapter even more engrossing.

Once you have clarity on the views, layout and data then what do you do next? You need to figure out the components which will suit best in a given layout. The author goes in deep details on the visuals including graphs and charts. Most importantly, he explicitly explains – “How can you create and use your own components / plug-ins?”. Further, the author does recognize the fact that occasionally you may have a need to override the existing classes (may be even the framework’s classes). That pretty much gives you everything that you would need to be in control. For the charts I experienced a minor hiccups as the touch version 2.2.3 that I had downloaded, it has charts package missing in the src directory. I was getting error, “Failed to load resource: the server responded with a status of 404 (Not Found)http://localhost/touch-cookbook/touch/src/chart/CartesianChart.js” . Hence, in case you see that graph is not being rendered then you may like to check console and make sure that you have got everything that the author recommended in the beginning chapter.

Finally, comes the most interesting part; the part where business often asks you “Can Sencha Touch do this?”. The authors goes ahead and talks about how you can take your applications offline and keep them in sync with the online server, how you can make use of various device APIs offered off-the-shelf by Sencha Touch, how you can store and use your content from cloud and how you can make use of Cordova to ensure native experience across different types of devices and platform supported by Sencha Touch.

Overall, while the contents were detailed and extremely well explained, the sequence of topics is just awesome. This just shows author’s understanding about how one should learn Sencha Touch.

While you will find this book extremely useful, there is another book from the same author with title “Sencha MVC Architecture“, which enables you to understand and use Sencha’s MVC architecture. I believe the cookbook in combination with the MVC Architecture book makes a perfect combination for being more effective Sencha Touch developer.

For the readers of 1st edition

If you have already gone through the first edition of this book then as expected you will see certain continuation. However, the focus on native packaging using Cordova, a dedicated chapter on device integration, storage on cloud and some of the practical problems which has come from the hard core experience of the author are of tremendous value.
While the author has explained the new charts that are being offered in Sencha Touch, if you have ever worked on financial projects (specifically for trading) then you are going to love the inclusion of Candlestick / OHLC charts. At least I was excited to see that being explained in the book. I hope one fine day Sencha will also support these chats in ExtJS.
In the previous edition there was a dedicated chapter on events (“Engaging Users by Responding to Events”) and I quite liked that. However, I am not sure why it was taken out during this edition. Working with events have always been interesting and sometimes challenging. I wonder if it was the number of page constraints, but I felt that it would have been nice to have that chapter.

What could have been better?

I believe with following things being considered, I would liked the book even more:

  • Cardova Latest Version – The Apache Cardova’s latest version if 3.1.0, while this book is referring to 2.4.0. I do believe that in in addition to new functionality, the latest version Apache Cardova has fixed quite a few bugs which are important for the Sencha Touch application developer.  This is even more important as Sencha has worked closely with PhoneGap / Cardova team to have better integration in place.
    • While there is a lot on device integration being talked about in the last chapter, I believe there is a need for more. While I am not sure if it will fit into the scope of the book or not, but it will be nice to read about integrations to achieve google analytics or any custom analytics, twittter, facebook, etc. May be a hint for Ajit and Packt publication to have a dedicated book on this topic :-).
    • Further Sencha doesn’t seem to provide an easy way to get their previous version of the software. For example I do see a link for Sencha Touch 2.3 on http://www.sencha.com/products/touch/download/, however, I don’t see an explicit link for the prior versions (of course it seems to be available for the support subscribers).
  • With following additional chapters in the book, it would have looked more complete
    • Working with Events
    • Using Sencha Command
    • Sencha Touch best practices

My suggestion will be to review the potential gaps between the existing set-up (i.e.  Sencha Touch 2.2 and Cardova 2.4) and the current state of the involved products (Sencha Touch 2.3 and Cardova 3.1)  and provide required guidance to the readers of this book.

Where can I get this book?

You can find the book on below URL:

http://www.packtpub.com/sencha-touch-cookbook-second-edition/book

Summary

While I could not get involved into the draft phase of the book, it was personally satisfying to review this book. If you are reading this summary then more or less you do have interest in touch application development and this book is for you. As stated earlier, the book sets you up by helping you to create desired project with minimal functionality and then it enables you to do whatever you want to achieve as in your application. I encourage you to take advantage of Ajit’s experience.
Along with Sencha, Walking Tree does endeavour to make application development as easy as possible and this book is a small contribution from Ajit in that bigger goal. In case you do have any specific need or question, we will be happy to assist.
Tagged with:
Posted in Sencha Touch
2 comments on “Sencha Touch Cookbook – 2nd edition
  1. Ajit Kumar says:

    Thanks a tonne for the encouraging feedback, Alok! Much appreciated!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 652 other followers

%d bloggers like this: