Time for action – debugging a native Android application

  1. Create file jni/Application.mk with the following content:
    APP_PLATFORM := android-14
    APP_ABI := armeabi armeabi-v7a x86

    Tip

    These are not the only ABIs provided by the NDK; more processor architectures such as MIPS or variants such as 64 bits or hard floats exist. The ones used here are the main ones you should be concerned with. They can easily be tested on an emulator.

  2. Open Project Properties, go to C/C++ Build, uncheck Use default build command and enter ndk-build NDK_DEBUG=1:
    Time for action – debugging a native Android application
  3. In jni/com_packtpub_store_Store.cpp, place a breakpoint inside the Java_com_packtpub_store_Store_getCount()method by ...

Get Android NDK Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.