[sword-devel] JNI Bindings

Troy A. Griffitts scribe at crosswire.org
Fri Mar 2 08:39:06 MST 2012

The JNI bindings should be ready to go.  I finished them to within 
epsilon of my goal for Android.  Maybe a few rough edges to iron out. 
They are located in the bindings/ folder of the API.

Though for a web application, I'm not sure they would be best.  The 
inherent multithreaded nature of web applications might not be handled 
well by the JNI bindings.  For example, they share a common SWMgr 
internally.  A few rules must be followed when using SWORD in a 
multithreaded environment, and the first rule is that each thread should 
have its own SWMgr.

We use a stateful class model, so you don't want one thread to set the 
state of an object just to have that state changed by another thread.

The SWORDWeb tools work fine without the consumer needing to worry about 
threading issues.

For example code see:




(there are some others in there that should be labeled 'experiments' 
instead of 'examples')

On 03/02/2012 03:19 PM, Greg Hellings wrote:
> At some point in the middle-distant past Troy was working on some JNI
> bindings for the engine and built a minimalistic proof-of-concept
> Android application to demonstrate them.  I know the application was
> not intended for regular usage but I have two questions regarding it:
> 1) Where is the latest copy? The only version I was able to locate
> seems earlier than the latest version I remember using and fails to
> install a module for me to test it on my phone (a VERY under powered
> phone from a major Chinese manufacturer).
> 2) What state are the JNI bindings in? I'm trying to tool around and
> find a Java web framework I like (might as well grow to at least
> appreciate our main language at work and become more familiar with
> it!) and so I'm trying to locate Java versions or bindings of all my
> favorite tools and libraries so that I know how and where to leverage
> them properly. I'd be interested to know if the JNI bindings offer a
> better experience than jSword or if they're still in a very fragile,
> precarious state.
> --Greg
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page

More information about the sword-devel mailing list