Note that there are some explanatory texts on larger screens.

plurals
  1. POCross-compiling a C library for Android NDK
    primarykey
    data
    text
    <p>I'm a bit confused with what I'm currently attempting: I want to cross-compile a C library for use with Android through the NDK, so that I can create a JNI wrapper and call some of its functions from my Android java code.</p> <ul> <li><p>I followed this guide to crosscompile libopus (the library I want to include in my project): <a href="http://mortoray.com/2012/08/21/android-ndk-cross-compile-setup-libpng-and-freetype/" rel="nofollow">http://mortoray.com/2012/08/21/android-ndk-cross-compile-setup-libpng-and-freetype/</a> which means <strong>I currently have a standalone toolchain at /opt/android-ext/, with a lib folder that contains the library I cross-compiled (libopus.a, libopus.so, etc)</strong>.</p></li> <li><p>I also already have a jni folder on my Android project, which contains some C code with the JNI bindings that I want, and that I can call from my Java code, but it does nothing (I can call it but it's a blank function). This means that in my project, there's a /lib/armeabi directory with "libopusUtilsNative.so" (the wrapper).</p></li> </ul> <p>My question is:</p> <p>How do I add the library that I just crosscompiled to the project, so that (for example) I can just do an #include call on the C source code file that I already have and get access to the library functions? I'm a bit lost with how to:</p> <ol> <li><p>Include the library I cross-compiled into my project.</p></li> <li><p>How to make the wrapper code I created include it (I'm guessing this has something to do with adding some code to my Android.mk file, but I'm clueless).</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload