title: NDK compiling multiple libraries
body: <p>I am using native code in my android app. Firstly I was only using one library. So everything worked fine. But now I have to integrate one more library into it. I've no idea what should be the ideal structure of the jni folder of my project (as in where to place the entire code, etc.). I found a work around. I created two folders inside jni .i.e library1 and library2. Again created a jni folder inside both the folders and placed respective code in the folders.</p>
  
  <p>I got it to compile. Both .so files are being generated, but I am unable to use it in my application. I cant load the library using System.loadLibrary("library1.so"); Also tried providing full path. But failed </p>
  
  <p>Also I have no idea what to write inside the parent jni folder's Android.mk file.</p>
  
  <p>Current structure: 
  project_folder -> jni -> library1 -> jni -> "source code" an Android.mk is written here
  project_folder -> jni -> library2 -> jni -> "source code" an Android.mk is written here</p>
  
  <p>UPDATE #1 : </p>
  
  <pre><code>Gdbserver      : [arm-linux-androideabi-4.6] libs/armeabi/gdbserver
  Gdbsetup       : libs/armeabi/gdb.setup
  make: *** No rule to make target `jni/zap/jni/zap/zap/error.c', needed by `obj/local/armeabi/objs-debug/zap/jni/zap/zap/error.o'.  Stop.
  </code></pre>
  
  <p>I am not using Application.mk.
  This is my Android.mk:</p>
  
  <pre><code>TOP_PATH := $(call my-dir)
  
  # Build library 1
  include $(CLEAR_VARS)
  LOCAL_PATH := $(TOP_PATH)/zap
  LOCAL_MODULE := zap
  LOCAL_C_INCLUDES := $(LOCAL_PATH)/zap
  LOCAL_SRC_FILES := $(LOCAL_PATH)/zap/error.c \
  $(LOCAL_PATH)/zap/hello-jni.c \
  $(LOCAL_PATH)/zap/zap.c \
  $(LOCAL_PATH)/zap/zapd.c \
  $(LOCAL_PATH)/zap/zaplib.c 
  include $(BUILD_SHARED_LIBRARY)
  </code></pre>