This book is an okay introduction to Kivy for a programmer who already knows their way around Python and MVC. I'm glad people are making the effort to write books for what I think is a really exciting emerging framework.
However, the only reason I'm even willing to give this book two stars is that the two example projects presented were very complete and good demonstrations of the capabilities of any framework, although frankly I feel this is mostly because it is very easy to build up awesome projects in Python.
Yes, the book gets the job done. But it's obvious any reviewers/editors involved didn't do theirs. The only 'editing' I'm willing to believe happened was a read-through by a friend who loved everything because they were too stupid to understand that honest critique is a necessary part of the creative process.
Yes, it's just a short introduction book. So how on earth are there so many awkward turns of phrase and bad explanations that slipped through? Just because I can work out what someone is trying to say after squinting at a sentence for thirty seconds doesn't mean I should have to. Especially not in a technical book.
The line numbers that continued throughout the whole book bugged me immensely, too. Nobody wants to flip back pages to a random line in an ages-earlier example that is being re-referenced. Just repeat the code fragment if it's so important! It's just not how anyone else I've seen uses line numbers in a book, and I don't know how anyone let it happen in this one.
I might be a little less annoyed if this wasn't the second or third time I'd gotten into a Packt short book and run into this sort of total disregard for proper editing. This book isn't anywhere near as bad as 'Getting Started with Django' - I am pretty sure that book wasn't even in any form of English used on this planet - but I'm seeing a dangerous pattern here. I love that Packt release these guides on fairly niche technologies, but if they are going to rush them out without any consideration for quality or whether the would-be author is actually competent enough in the English language to write about any topic, they should stop wasting readers' time.
The long and short of it - this book is not for beginners in Python, or beginners in programming. Or operating systems.
Even the author says so on page 2: "The book aims at Python developers who want to create exciting and interesting UI/UX applications. They should be already familiarized with Python and have a good understanding of some software engineering concepts, particularly inheritance, classes, and instances [...]"
What he fails to mention are OS differences and install issues. The book is short, and I think it's nice to skip the obligatory 3 or 4 primary chapters of filler that many books have where you "install" the OS/platform/etc., with the instructions being largely out-of-date. Having said that, it is no easy task to get Python and Windows playing together well, and so I'm guessing that the author assumes you have your OS figured out. I'm not sure that this is the best assumption to make. Providing a short page of URLs to install instructions and such would be a nice addition.
Realistically, the best idea is if the reader is using Linux (and I'm sure some friends on the Python Facebook page will disagree...), preferably a Debian spin so that packages are easily installed and there is little to no breakage on update/upgrade of the OS. Better yet is if the reader understands how to install and use Virtualenv and is a Linux user. I had a few troubles getting Pygame installed in a .virtualenv for Arch, but it all worked out in the end. Check out the extended review for more info on that.
To delve a bit more into what I mean by "don't use this book if you are beginner" - to make a long story short: 1. There are some convention/typo issues in the book, 2. many things are not explained that the reader is expected to know, 3. The book is overly technical, and sometimes I like a bit of layman speak to draw me in a bit. I can read docs, otherwise - books are good for reference but it is nice to be able to enjoy them as well.
If you download all of the code and don't try to type any of it in, you might be able to get around some of the issues encountered, but while typing in the code - as it happens with many web tutorials on open source software - I ended up "fixing" a few things so that I could move forward.
One issue that annoyed me is the author's usage (and non-usage) of tab conventions. Python uses a 4 space forced tab style, where the .kv language can use 2 spaces or more. It would have been nice for the author to stick to 4 spaces for both types of files - for consistancey and, most importantly - readability. This isn't Ruby, and so I see no reason to use two different styles of tabulation for the same application. That's as much of a knock on Kivy as anything, but the author could adjust and make the code more clear. E.g. There are points in the book where 2 spaces can look like no spaces, and then the .kv code breaks and you get a blank canvas instead of an application (or a page of debug logs in your virtualenv console).
Back to "experience": Kivy is highly based on Widgets, so if you don't have a firm grasp on that concept in Python, it's gonna be a rough road. Even an experienced Python programmer might not be great in this area. I think it is better to learn that concept somewhere else and come back to the book again with better understanding of how widgets work. Moreover, it's not necessary to use the .kv language, but it can help. All coding can be done in Python classes if you like to program that way, and some do, so it might be nice to see the code done both ways.
Layout: I don't like the way the beginning examples are layed out (before we get to the Comic project.) The code is broken up into pieces which can't be run independently. Combining the code together works, but once again - it's an experience thing. Does an experienced Python programmer know how to use Linux and the cat binary? Maybe, maybe not. It's possible to use an IDE and cut and paste pieces together - but why? And so instead, the reader might fall back on completed code instead of typing in code from the book, run it, and not learn as much by that process. In my humble opinion, there's no such thing as a "visual learner" when it comes to coding. You have to do it to learn it.
Line numbers: Argh! The line numbers start, and never, ever end. Line numbers should start and end at each code snippet. The line numbers in this book extend *over chapters*. Not good at all, confusing, and a horrible oversight on the part of the editors. Packtpub - fix this, and please encourage your authors to not commit an atrocity like this again.
The .kv files break Pep8 coding guidelines: This is why style and code should not mix. On page 27, this is blatantly obvious. Mixing ASCI codes with neo-html formatting inside quotes is not good if you add spaces according to Pep8. It would be nice to see pure Python code examples to go around this issue.
In defense of the author and Packtpub ebook style: the book is not quite 150 pages long, so it's supposed to be a quick "HOWTO" to get a Kivy programmer started. I wonder if this format can actually work without references to dependancies and requisite knowledge needed for the task at hand.
In closing, I'll say that this book is generally well written, and is a fantastic guide for an experienced Python programmer who wants to get into application development. The platform itself is very advanced and well designed and can export to various OS without license fees like other App engines have. For someone new to Python who isn't at least intermediate level with an OS like Ubuntu Linux, I'd say that you could still follow along and run the code examples, but that this book should be a goal for you to reach after learning Pep8, Widgets, classes, and other concepts that are necessary to be successful with this book. The author does explain this, but I'd guess that many will jump in head-first anyway and hope/expect the internet to be a good research/cheat tool. It won't be - nothing will substitute for knowledge and experience here.
I applaud the author for making a very good first text to bring Kivy to the masses. Now, the real work begins on adding install guides online and links to style guides and best practices for the emerging Python programmer. As well, pure Python code examples could be added online as extra content.
This second edition of "Kivy - Interactive Applications and Games in Python" is much improved from the first edition. The atrocious grammar throughout the first edition book has mostly been fixed, although it's still worse than what I expect from a professionally edited book. The new chapters showcase current Kivy features while reiterating how to build a basic Kivy app, and the book covers an impressive amount material in its nearly 185 pages. I think this is due largely to the efficiency and power of coding in Python and Kivy, but also to the carefully-chosen projects the author selected for his readers to create. Despite several indentation issues in the example code and the many grammar issues typical of Packt's books, I can now recommend this book for intermediate to experienced Python programmers who are looking to get started with Kivy.
Chapter one is a good, quick introduction to a minimal Kivy app, layouts, widgets, and their properties.
Chapter two is an excellent introduction and exploration of basic canvas features and usage. This is often a difficult concept for beginners to understand, and this chapter handles it well.
Chapter three covers events and binding of events, but is much denser and difficult to grok than chapter two. It will likely require multiple reads of the chapter to get a good understanding of the topic, but if you're persistent, everything you need is there.
Chapter four contains a hodge-podge of Kivy user interface features. Screens and scatters are covered well, but gestures still feel like magic. I have yet to find a good in-depth explanation of gestures in Kivy, so this does not come as a surprise. Behaviors is a new feature in Kivy and a new section in this second edition of the book. Changing default styles is also covered in this chapter. The author does not talk about providing a custom atlas for styling, but presents an alternative method for theming involving Factories.
In chapter six the author does a good job of covering animations, and introduces sounds, the clock, and atlases. He brings these pieces together to build a version of Space Invaders, in about 500 lines of Python and KV. It ends up a bit code-dense, but the result is a fun game and a concise code base to play around with.
In chapter seven the author builds a TED video player including subtitles and an Android actionbar. There is perhaps too much attention paid to the VideoPlayer widget, but the resulting application is a useful base for creating other video applications.
With these type of books there's a sweet-spot between being a series of trivial examples demonstrating specific features and being a regurgitation of official documentation/ examples. There's another sweet-spot between too little useful practical information and overwhelming the reader with too much detail. This book hits the sweet-spot on both counts. It does so in five easy going chapters and, amazingly, in a little over 100 pages!
The book focuses around two main examples, both non-trivial, potentially useful/entertaining and with plenty of scope for further experimentation. This is even more amazing when you consider the first two chapters cover essential Kivy basics and the real action doesn't begin until chapter three, in which the bulk of the "Comic Creator" application is developed. Chapter four goes deeper into some other useful Kivy features including the creation and handling of custom gestures. Chapter five introduces the second example application, a variation on the classic "Invaders" game while covering a number of Kivy components that make your programming easier and give you the ability to add whizz-bang behaviour to your applications.
One small criticism I have of this book is that although it employs Kivy's "Kv Design Language" throughout, it only mentions in passing what the benefit is of splitting an application into essentially two distinct code bases. However, anyone who has worked in a team involving non-programmers will recognise the potential usefulness of this approach and if not then you will do eventually ;-) Apart from this I have a number of small niggles and suggestions but they can easily be addressed with errata and/or future revisions.
All in all, I would thoroughly recommend this book to anyone learning Kivy and say that the two or three days it takes to digest is time well spent!
The first chapter is a nice intro to both Kivy in python and the Kv language. It explains the basics of the language like applications, widgets, and layouts in addition to embedding these smaller pieces into one another to build a usable UI. I had some issues running some of their examples and per the python debugger; it was showing up in Kivy itself. I did not have Internet at the time of reading this chapter in order to download the code, but I typed them verbatim and checked many times. I could still not get a few of the examples to run.
It details the basics of the layouts (and any common and relative variables with them), but I would have liked a little bit more information in certain areas (its possible these could be expanded upon later).
The grammar sometimes leaves a bit to be desired at times but it is easy to figure out what its trying to say the majority of those times.
The remainder of the first chapter details the front end frame work for the project that is built for the remainder of the book. It does a good job of explaining what each piece is and how it fits into the big picture of the application. I enjoyed learning about the Kv language the most and how they present building a UI from scratch.
This book is not a good choice for someone new to Python or programming in general. There is very little help in getting Kivy installed and usable on any operating system - which is commonly a complicated problem for newcomers.
For the intermediate Python programmer it does a good job of introducing many core Kivy concepts and capabilities via two interesting example projects. There are indentation (KV files must use 4 space indentation) and code errors which can make re-creating the examples difficult from the text alone. The book also lacks a single listing of all of the code, so make sure you download the separate download for that.
The horrendous grammar used throughout the book makes it feel very unprofessional and even difficult to read. I doubt that this book was proof read by a native English speaker. Indeed, this inattention to basic editing makes me question the quality of Packt publications in general.
If not for the sloppy language and errors, this book would suffice as a quick introduction to Kivy. However I cannot recommend it at this time. hopefully they will fix these problems in the second edition.