How to use protege owl API in Android project


Last Updated:

  1. superemolee

    superemolee New Member This Topic's Starter

    Joined:
    Jul 10, 2010
    Messages:
    2
    Likes Received:
    0
    I have a practical seminar this semester, and I want to use ontology on Android application. I choose Protege owl ontology as a ontology API and this tool worked in normal Java project. But when I tried to import these jar files which for the owl ontology API in Android project, the project will fail and I haven't found any solutions in the Internet.
    Some expert who can help me?
    Thanks in advanced!
     

    Advertisement
  2. markb

    markb Well-Known Member

    Joined:
    Sep 14, 2009
    Messages:
    148
    Likes Received:
    26
    The Java language used on Android isn't exactly the same as "standard" Java.
    You could take some source code and it would compile with the Sun JDK and with the Android Java compiler. But the compiled bytecodes you get would be different, and incompatible.
    You can't take the results of the Sun Java compiler and run them on Android, and vice versa.

    The jar files for the Owl ontology API will contain .class files probably compiled with the Sun JDK, and they won't be usable with Android.

    If you can get hold of the source files, and re-compile them, then they should work.

    There's a bit of extra background information here, if you're intested:

    Dalvik - Google's tweaked, non-standard JVM for Android!!!! - O'Reilly ONJava Blog

    Mark
     
  3. superemolee

    superemolee New Member This Topic's Starter

    Joined:
    Jul 10, 2010
    Messages:
    2
    Likes Received:
    0
    Hi, Mark,
    Thank for the response.
    Do you mean if I can get the source files, and re-compile them using Android Java compiler, then the API(Jar files) will work?
    And how to do that? Creating a new Android project and add the scr into the new project and then ?
    Thanks in advanced!
     
  4. markb

    markb Well-Known Member

    Joined:
    Sep 14, 2009
    Messages:
    148
    Likes Received:
    26
    The existing jar files you have don't work, and will never work with android.
    If you have the source files then you could compile then in a separate android project and then put the .dex files in a jar file, or you could add the source files to your existing android project.

    Adding the source files to your existing project will probably be quicker and easier.

    Mark

    (Replying using phone, so keeping it short.)
     
  5. minoss

    minoss New Member

    Joined:
    Apr 8, 2013
    Messages:
    1
    Likes Received:
    0
    Hi superemolee,

    have you solve your issue? because I have the same problem but I think we can use the jena version for android (AndroJena https://code.google.com/p/androjena/) but unfortunately I have used OWL-API to handle my ontology. what's your opinion?
     
  6. jonbonazza

    jonbonazza Well-Known Member

    Joined:
    Jul 13, 2010
    Messages:
    1,934
    Likes Received:
    458

    This is simply not true... Both the Sun JVM, as well as the Dalvik JVM compile to the same byte code. Any jar file written in java will work with Android, provided they don't try to access any APIs that are not available in Android. the Android SDK uses a small subset of the standard Java APIs, and most common APIs are supported. More often than not, a Sun Java JAR file will work with Android. If the JAR file uses any UI stuff, however, it will NOT work with Android as neither the AWT or the Swingset are supported in Android (obviously).
     
  7. vidyazope

    vidyazope New Member

    Joined:
    May 29, 2013
    Messages:
    1
    Likes Received:
    0
    do mail me the steps of integrating protege ontology in android project.........its my me project...
     

Share This Page

Loading...