Book Image

Android NDK: Beginner's Guide

By : Sylvain Ratabouil
Book Image

Android NDK: Beginner's Guide

By: Sylvain Ratabouil

Overview of this book

Table of Contents (18 chapters)
Android NDK Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – compiling and deploying San Angeles sample


Let's use Android SDK and NDK tools to build a working APK:

  1. Open a command-line prompt and go to the San Angeles sample directory inside the Android NDK. All further steps have to be performed from this directory.

    Generate San Angeles project files with the android command:

    cd $ANDROID_NDK/samples/san-angeles
    android update project -p ./

    Tip

    You may get the following error upon executing this command:

    Error: The project either has no target set or the target is invalid.
    Please provide a --target to the 'android update' command.
    

    This means that you have not installed all the Android SDK platforms as specified in Chapter 1, Setting Up Your Environment. In which case, either install them using the Android manager tool or specify your own project target, for example, android update project --target 18 -p ./.

  2. Compile San Angeles native library with ndk-build:

  3. Build and package San Angeles application in Debug mode:

    ant debug
    
  4. Make sure your...