Multi VM Development using Androjena?

42 views
Skip to first unread message

Tim Janus

unread,
Oct 30, 2011, 6:50:33 PM10/30/11
to androjena
Hi,

we want to write a distributed network system where some nodes run on
an android device and other on a server using a normal VM.

Is it possible to write a java lib using Androjena that runs on a
normal Sun JRE and Android? My first thought was that I could use the
Androjena lib as basic (because Androids VM supports a subset of the
Java SE 1.5 Specification) and link it to a project which use the Sun
VM and to another project which uses Android.

But at least the slf4j port uses the Android API which is not
available at a normal server and so I must write the code twice? Or
did I miss something? Any suggestions?

Tim

Giorgio Orsi

unread,
Oct 31, 2011, 7:28:27 AM10/31/11
to andr...@googlegroups.com
Hi Tim,
The easiest thing that comes to my mind is to replace slf4j with
something that you have available also on standard platform.
The source code of Androjena is open so It shouldn't be much work.

However, I'm wondering why you cannot write a library that links
dynamically the "right" jena library depending on the platform.
Androjena is just a porting of OpenJena that you can use on a standard
platform.

Best,

--Giorgio

Tim Janus

unread,
Nov 3, 2011, 4:26:40 AM11/3/11
to androjena
Hi Giorgio,

dynamically at run-time is an option that I did not yet think of but
it should work. I'm not quite sure how restricted the android system
is (but there is surely a way to load libs dynamically). Another
question is: does the translation from class to dex works during
dynamically loading. If not I have to provide the androjena.jar
already converted in dex format. But I will test it in near future
(actually there is not so much time). When it's done I will tell you
my results.

Thanks for the thought-provoking impulse.
Tim

Giorgio Orsi

unread,
Nov 3, 2011, 4:36:08 AM11/3/11
to andr...@googlegroups.com
Hi Tim,

I don't know the details of your project but if I were about to program
a multi-platform distributed system handling ontologies what I would do
would be to program independent applications (depending on the platform)
and then let them exchange triples.

Unless your app uses very intensively the extensions of OpenJena that
are not present in Androjena, I guess that you can write your
application once and then simply import the packages from Androjena or
OpenJena depending on the platform.

I snooped around the net and I found this, I hope it helps:
http://stackoverflow.com/questions/3029783/how-to-add-a-dynamic-library-to-android

--Giorgio

lorenzo carrara

unread,
Nov 3, 2011, 4:53:38 AM11/3/11
to andr...@googlegroups.com
Hi Tim,
you don't need to dynamically link the library. Androjena is a porting of Jena, and this means that the original Jena API has not been modified. You can build your app using the Jena API without worrying about which library will be actually loaded at runtime. When you'll have to run your code, you will include Androjena (and all its required libraries, like slf4j-android) on Android, and Jena on J2SE-compliant systems.

Hope that helps!
Regards,
Lorenzo

2011/11/3 Tim Janus <dart...@googlemail.com>
Reply all
Reply to author
Forward
0 new messages