Building Touch Interfaces with HTML5 |
Author: Stephen Woods Building a touch interface in a web app is obviously essential if you hope to complete with native apps on a mobile device so having a whole book dedicated to it is a really good idea.
The big problem with touch in HTML is that the APIs are relatively new and, as you might expect, poorly standardized once you look beyond the basics or beyond a single browser. The situation with IE10 and older browsers is even worse but given that your target is a mobile device you can restrict what you are aiming at to just the latest browsers on iOS, Android and Windows 8/Windows Phone.
The first chapter introduces the idea of the mobile landscape and the way HTML5 should in theory make it possible for you to write a single application for all devices. Unfortunately it doesn't emphasis the mess that CSS 3 implementation is at the moment. After the first chapter you might expect to wade into the subject of touch interfaces - but no. Chapter 2 is about creating a simple web site. This introduces the idea of the viewport and a lot of other basic concepts that don't have much to do with implementing a touch interface. You also encounter the the basic style of the book - lots of listings with lots of white space and very little explanation. The approach seems to be to let the code do the talking but even with this approach giving the reader a good idea of the overall strategy is a good idea. To get anything from this book you need to be fairly fluent in HTML, CSS and JavaScript. There are descriptions of some of the slightly more obscure topics but mostly you are expected to cope with learning by reading long listings without much help. So chapter 3 must get us into touch events? No it is about speeding up the first load of the web page. If you have read anything on this topic before there is nothing new here or in the next chapter about speeding up the next visit. Chapter 5 at least has "Touch" in the title - "Using PJAX to Improve the Touch Experience". If you don't know what PJAX is then you will have to read half the chapter to reach the point where it is finally revealed. Some clue at the start of the chapter would have been helpful in understanding why we were looking at the history API. PJAX is AJAX with History API used to provide what looks like a multipage site using AJAX to download HTML fragments and a router to interpret standard URLs. This is all very interesting but only tangentially related to touch input. In this case the description is too short and only at the end do we get to some frameworks that do the same job - and to be honest if you want to do this sort of thing you really would be well advised to use a framework.
Finally we have a chapter on touch - Chapter 6 starting at page 98 deals with the very basics of the touch API. It explains touch events by basically presenting us with tables of event summaries. From here we have some verly long examples with some very short explanations. It is difficult to know what the code is trying to achieve and how it achieves it without spending a lot of time reading and guessing. Chapter 7 returns to non-touch topics with a look at CSS Transitions, Animations and Transforms. Yes, this is helpful as part of a touch interface but it would have been nice to have another chapter on touch first. What makes it slightly worse is that none of the examples of animation make use of touch. Chapter 8 is about optimizing JavaScript and again has nothing much new to say about the subject and nothing much about touch. Chapter 9 returns us to the topic with a look at gestures. The example given is of a switch where we progressively improve the UI by moving from a click on/off to a swipe drag on/off. This is interesting but there is little in the way of explanation and a lot in the way of listings. The second big example is of a lightbox again interesting but not well presented. Chapter 10 continues the topic of touch with a look at scrolling and swiping and Chapter 11 focuses on pinching and other complex gestures. Both chapters are too short and indeed Chapter 11 finishes with: "this is just the beginning of what you can do with complex gestures" These last few words sum up precisely what is wrong with the book. It is a book on touch interfaces that has four out of eleven chapters actually on topic. If you removed the seven chapters mostly on the topic of optimizing HTML/CSS and JavaScript then you would have a long magazine article. Perhaps there isn't a book to be written on the topic of touch UI in HTML. Perhaps the API is just too limited to do anything deep or novel or .. but as the final chapter ends with a statement that there is indeed a lot more you could do clearly the author doesn't think this despite having written a book mostly on other topics. This is a book that might be of some use to you if you want to learn the basics of the touch API. It certainly isn't an in depth look at the possibilities of using touch in web apps and it isn't for the beginner.
|
|||
Last Updated ( Wednesday, 22 January 2014 ) |