It seems as though there’s no end to Android programming books out there, especially now that the platform has experienced its meteoric rise from new OS entrant to capable and formidable market player. Unfortunately, as a result, many good books get lost in the shuffle – when looking for a new book you’re likely to encounter a whole suite of them – some relevant and some, not. This trend applies even to specialized niches within Android, where books are put on the market quickly to capitalize on new OS versions.
In all this printed abundance, I luckily stumbled upon Pro Android C++ With The NDK by Onur Cinar. It’s a neat book that does what it sets out to do, and I would recommend it to anyone looking to put some C++ into their Android apps to speed up their performance.
For starters, the book is very focused. It’s most certainly not a book that aims to teach the reader about beginning steps in Android, Java, or C++ programming – it assumes more than a passing familiarity with all three. Besides the initial introduction of setting up the SDK, NDK, and required tools to ensure that you have the same development environment as the book’s examples, it does not go into anything resembling a tutorial or introductory period for Android’s normal components, like Java and the SDK.
The book instead goes into its purpose: familiarizing the user with the Android NDK and the steps required to use it effectively. Instead of simply delving into the different types of functions and libraries available straight away, the book devotes a chapter to exploring the Android NDK, including the structure of the NDK, common build steps, using the Android.mk and Application.mk Makefile fragments, and more. Many books of this type often omit this step, thinking that their reader is already familiar with the process, when in fact learning the NDK is the primary goal of anyone who picks this book up.
In a way, that’s one of the best strengths of this book: it very rarely loses its focus at any point. The book is about using the NDK to program native C on the Android platform, and it’s very good at keeping to that track. Each and every step of the book advances along that goal in a very logical and constructed way: from the NDK build processes to the explanation of functions and libraries, readers are given a logical progression of ideas in order to help them understand and gain a solid foundation of the methodologies behind it.
A great example of this is the way that the book treats learning the JNI. It starts off with using the JNI – declaring methods, variable mapping, etc. the traditional way. It lets the reader know, however, that often there are better ways of doing this than the cumbersome manual way; it then spends the next chapter introducing the reader to auto-generation of JNI code using SWIG. The entire chapter details the use of SWIG to simplify and speed up the writing of JNI code instead of doing it by hand all the time, and it does it immediately after the section on JNI, meaning the information is still fresh.
Another Cinar’s strengths throughout the book is its distinct level-headed approach to practicality in the way the book structures the information presented. SWIG, for example, isn’t entirely necessary when we use the NDK – norare the debugging and troubleshooting strategies presented in the chapter following the introduction to SWIG. What including this information does accomplish, however, is getting the reader up to speed and ready to work in a production environment where they’ll be encountering these sorts of methods and utilities. An Android developer looking to catch up on the NDK likely needs to know all the common steps projects use, and Pro Android C++ is very good at doing exactly that – getting a programmer production-ready by the end of the book.
If the book has any weaknesses, it is a tendency to move a bit too fast. The book covers a great deal of ground quite quickly, and in some of the chapters it can be a little hard to keep up – I found myself wishing a bit more clarification or example code blocks to help me through the material. This isn’t a major flaw since the target audience for the book is expert programmers already familiar with the underlying technology.
Onur Cinar’s Pro Android C++ With The NDK is a clear about what it sets out to do: introduce you to the Android NDK and help you get ready to put that knowledge to work right away in a practical, production environment. It accomplishes that goal admirably, with hardly any straying and at a pace that, though a bit fast, is more than adequate to get the job done. If you’re an Android developer that needs to get C++ native code into your Android application, Pro Android C++ With The NDK is definitely one that deserves a spot on your tech shelf!
|Amazon: Pro Android C++ With The NDK|