title: JNA for android
body: <ol>
  <li>I have a huge set of C source files that when compiled result in a shared library. </li>
  <li>There is also a Java version that uses JNA to access the already built c shared library. These files are available in another jar. This jar depends on jna.</li>
  </ol>
  
  <p>First I compiled the c files and then compiled the java code. In java, there are no errors. The problem arrises only when I try to port it to android. I could easily compile the c files using the android 'ndk-build' tool. This successfully creates the shared library.</p>
  
  <p>I am not able to import JNA in an Android Project because of something similar to this: <a href="https://stackoverflow.com/questions/15765212/android-jna-library">Android - JNA library</a></p>
  
  <p>However I don't understand the comments in that post. Is it possible to use JNA in Android?</p>
  
  <p>I tried removing a few files from the jna.jar (the files corresponding to other architectures). Yet, I get the same error that says: 
  The library 'jna.jar' contains native libraries that will not run on the device.
  Including: "com/sun/jna/android-arm/libjnidispatch.so"</p>
  
  <p>The jar (the one with the java wrapper for the C library), gets imported and I can write code.
  But, I still get 'ExceptionInInitializerError' with the first object I create using the classes in this jar.</p>
  
  <p>I am not well versed in java. I only have the knowledge of a rookie. Please bear with me and help out. Thanks.</p>