title: android JNI loading mupdf (compile with NDK?)
body: <p>I am creating an Android Xoom application which displays a pdf in one of the Activities. </p>
  
  <p>I have downloaded the mupdf source files: mupdf.c, Android.mk, Application.mk, Core.mk, and ThirdParty.mk.</p>
  
  <p>I have also been to the mupdf.com web site and tried downloading various pre-compiled packages from here: <a href="http://ccxvii.net/mupdf/download/" rel="nofollow">http://ccxvii.net/mupdf/download/</a></p>
  
  <p>I just switched to Android from the iPhone and have a few things to learn regarding including C code. I put the mk / c files into /jni/ in my project. I have also tried to copy the precompiled files I downloaded from the web site above in /jni/ in my project.</p>
  
  <p>I have a simple class:</p>
  
  <pre><code>import android.graphics.*;
  
      public class PDFView {  
          static {
              System.loadLibrary("mupdf");
          }
      }
  </code></pre>
  
  <p>Every time I create an instance of this class the app crashes and it says "ExceptionInInitializerError" as well as "Couldn't load mupdf: findLibrary returned null" in the LogCat.</p>
  
  <p>I have also downloaded the android NDK and tried to compile the source myself. I get a missing mupdf.h error and fitz.h error. Just a whole list of errors and this seems overly complicated to included a library.</p>
  
  <p>I am working on a Mac in Snow Leopard. I think I'm on the right path needing to compile this as a binary, but it's been really frustrating having spent all this time learning about the NDK then it won't compile. Maybe I need an updated source. </p>
  
  <p>Can anyone help point me in the right direction?</p>