From Android NDK Beginners Guide