Thursday, 4 October 2012

Android NDK Beginner’s Guide

First thing that got me about this book was the comprehensive installation instructions, covering the installation of the JDK (Java Development Kit), Android SDK (Software Development Kit), Android NDK  (Native Development Kit) and the IDE (Eclipse) across a number of platforms, Windows PC, Mac OS X and Linux PC. Now this it great as it’s sure to cover all those wanting to develop on this platform, but does lead to a lot of page skipping, but I guess that can’t be helped.
Having already played with Eclipse and the Android SDK, I only had to install the NDK and refresh what I already had installed (indigo upgrade), but still it’s a lot of work to get this all lined up for Android development, really makes you appreciate Visual Studio and all it’s quirks. Another draw back as a VS developer is all the command line compilation, but once you are all set up you can then get into the book samples.
Anyway, back to the book and it’s content, from the off you get to command line compile some samples and see them running on the Android, then into the IDE (Eclipse) and creating your first simple project in eight pretty simple steps. Then onto the C/C++ integration, now, it may well have been me but I found an issue when trying to set javah.exe up as described in the book, just in case you also have the same issue, here is the arguments string that I ended up using to generate my header file:
-jni -verbose -d ${workspace_loc:/MyProject/jni} -classpath ${workspace_loc:/MyProject/bin/classes/} com.myproject.MyActivity
Other than my own issues with Eclipse and the odd typo, I quite enjoyed playing with native code on the Android plat form, the book will show you how to pass data to and from your hybrid Java/C++ code, to creating a fully native application, rendering with OpenGL ES (which i am playing with now) as well as handling devices and sensors and even has a chapter for porting existing libraries to the Android platform.
I think the only other suggestion I would have would be how the code is rendered, it may well be different in a physical book (I have an ebook) but it would have been nice if tabulation and syntax highlighting was used. Other than that I have enjoyed it :)

1 comment:

  1. Thank you so much. I've been trying to figure this out for hours.

    Typos in code are pretty horrible, specially in a Beginner's book, where the reader has no idea why things aren't working.