title: How to use swi-prolog with android
body: <p>I have developed a prolog program with swi-prolog and I attached a interface for it using regular java with JPL.jar,
  That is running perfectly.</p>
  
  <p>Now I want do the same with android mobile interfaces instead of java desktop interfaces. So I created a android application, add the JPL as external jar and called the prolog files as earlier. There are no errors showed in the code.  </p>
  
  <p>But when I run it as a android application it says jpl.query$1 cannot be found. </p>
  
  <p>here is the logcat</p>
  
  <pre><code>08-21 17:36:35.782: D/dalvikvm(659): DexOpt: unable to opt direct call 0x0cd8 at 0x08 in Ljpl/Query;.abort
  08-21 17:36:35.812: W/dalvikvm(659): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Ljpl/fli/Prolog;
  08-21 17:36:35.812: D/AndroidRuntime(659): Shutting down VM
  08-21 17:36:35.822: W/dalvikvm(659): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
  08-21 17:36:35.916: E/AndroidRuntime(659): FATAL EXCEPTION: main
  08-21 17:36:35.916: E/AndroidRuntime(659): java.lang.ExceptionInInitializerError
  08-21 17:36:35.916: E/AndroidRuntime(659):  at jpl.Query.open(Query.java:286)
  08-21 17:36:35.916: E/AndroidRuntime(659):  at jpl.Util.textToTerm(Util.java:162)
  08-21 17:36:35.916: E/AndroidRuntime(659):  at jpl.Query.&lt;init&gt;(Query.java:198)
  08-21 17:36:35.916: E/AndroidRuntime(659):  at com.example.trtest.swi.main(swi.java:21)
  08-21 17:36:35.916: E/AndroidRuntime(659):  at com.example.trtest.MainActivity$1.onClick(MainActivity.java:70)
  ------
  ----
  
  08-21 17:36:35.916: E/AndroidRuntime(659): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load jpl: findLibrary returned null
  08-21 17:36:35.916: E/AndroidRuntime(659):  at java.lang.Runtime.loadLibrary(Runtime.java:365)
  08-21 17:36:35.916: E/AndroidRuntime(659):  at java.lang.System.loadLibrary(System.java:535)
  08-21 17:36:35.916: E/AndroidRuntime(659):  at jpl.JPL.loadNativeLibrary(JPL.java:100)
  08-21 17:36:35.916: E/AndroidRuntime(659):  at jpl.fli.Prolog.&lt;clinit&gt;(Prolog.java:85)
  ...
  </code></pre>
  
  <p>So what is the error could be.</p>
  
  <p>I found some says that JPL(swi prolog) cannot be used in android, is that true.</p>
  
  <p>What can I do to have my prolog app run on android</p>
  
  <p>thanks
  Mathee</p>