[mobile-devel] [sword-devel] Bishop (Android C++ SWORD)

Troy A. Griffitts scribe at crosswire.org
Thu Oct 28 04:52:06 MST 2010


Hey Martin,

You probably know this, but the difference between JSword and the SWORD
C++ engine is obviously that the C++ engine is written in C++ and JSword
is an alternate engine written in Java.

Bishop uses the Java jni bindings to the C++ engine.  In fact bishop is
simply a test harness for the bindings right now.  I wouldn't consider
it even close to a public frontend.

Both JSword and the SWORD C++ engine work against the same installed set
of books, so you should be able to use either or both in your frontend.

The C++ Engine will require about a 700K native bundle in your app and
the Java classes to use it are located in SVN here:

http://crosswire.org/svn/sword/trunk/bindings/java-jni/src/org/crosswire/android/sword/

(you can simply grab the binary blob out of the bishop.apk I posted if
you don't want to learn how to use the NDK to compile it yourself.  In
fact I think the total size of the bishop.apk is mostly just the 700k
for the binary blob).

The really interesting thing is that for the first time, Android might
be a real opportunity to use both implementations for different purposes
in the same application.

Anyway, I don't think the bishop source will be particularly interesting
to you.  The 3 Java classes at the SVN link above are a fairly
straightforward interface to the engine.  But still, if you'd like to
see it, I've been periodically posting the sources from my public home
on CrossWire.  Here is the latest bundle:

http://crosswire.org/~scribe/bishop-20101026.tar.gz


Hope this is helpful.

Troy




On 10/27/2010 09:07 PM, Martin Denham wrote:
> Hi Troy,
> 
> I didn't realise unindexed searches could be done so quickly.  Can you
> point me to the relevant source for the unindexed search and Bishop (I
> don't know my way around the Crosswire svn repository).
> 
> Kind regards
> Martin
> 
> On 27 October 2010 20:34, Troy A. Griffitts <scribe at crosswire.org
> <mailto:scribe at crosswire.org>> wrote:
> 
>     Thanks Brian,
> 
>     I am currently of the persuasion that indexed searching is not the
>     way to go on Android. 4 seconds is quite an acceptable speed to wait
>     for a search and no index creation time or versioning headaches.
>     Searches can also be more easily customised.  For example, full text
>     searches (i.e. unindexed searches) in the engine currently support
>     regex and searching on any entryAttribute created by any filter.
> 
>     There are benefits to indexed searching of course, especially when
>     dealing with searches across a large library of books, but for a
>     simple handheld reader of just a few books, I'm still leaning toward
>     favoring unindexed if the results can be returned in under 7 seconds.
> 
>     But we support both so it is a matter of use case and preference really.
> 
>     For example, in my personal study, I typically only search a single
>     Greek text or English text. I very seldom search a commentary or
>     lexicon.  So I might decide to index my 2 frequently searched
>     modules and be willing to wait 10 seconds to brute force search any
>     of my other 200 modules and not have them indexed.  In reality, on
>     my laptop the speeds to brute force are nearly instant anyway.
> 
>     Thanks for the numbers.  Any thoughts?
> 
>     Troy
> 
> 
> 
> 
>     "Brian J. Dumont" <bdumont at ameritech.net
>     <mailto:bdumont at ameritech.net>> wrote:
> 
>     >Troy,
>     >
>     >Search times for an HTC Evo running standard HTC-version of Android
>     2.2:
>     >
>     >God love world: 4.576s
>     >God: 12.111s
>     >
>     >As a side note, if we're looking for speed it seems like it would make
>     >the most sense to focus on indexed searches.  "And-Bible", which uses
>     >Java but indexed searches, seems to get roughly:
>     >
>     >God love world: 1s
>     >God: 7s
>     >
>     >Thanks for your work!
>     >Brian
>     >
>     >
>     >
>     >On 10/26/2010 07:43 PM, Troy A. Griffitts wrote:
>     >> OK, a couple things.  Changed result list logic from using
>     String+= to
>     >> using StringBuffer.append and cut out the time delay between the
>     end of
>     >> the search and the display of the large result set.
>     >>
>     >> I also have some numbers from my old G1 running Cyanogen 1.6
>     (Android 2.2+).
>     >>
>     >> Today's build:
>     >>
>     >> http://crosswire.org/~scribe/bishop-20101026.apk
>     >>
>     >>
>     >>
>     >> KJV "God love world" (6 results)
>     >>
>     >> 4.722 seconds                G2      stock Android 2.2
>     >> 19.485 seconds               G1      Cyanogen 1.6 / Android 2.2
>     >>
>     >>
>     >>
>     >> KJV "God" (3578 results)
>     >>
>     >> 13.966 seconds               G2      stock Android 2.2
>     >> 52.535 seconds               G1      Cyanogen 1.6 / Android 2.2
>     >>
>     >>
>     >> _______________________________________________
>     >> sword-devel mailing list: sword-devel at crosswire.org
>     <mailto:sword-devel at crosswire.org>
>     >> http://www.crosswire.org/mailman/listinfo/sword-devel
>     >> Instructions to unsubscribe/change your settings at above page
>     >>
>     >>
>     >
>     >
>     >_______________________________________________
>     >sword-devel mailing list: sword-devel at crosswire.org
>     <mailto:sword-devel at crosswire.org>
>     >http://www.crosswire.org/mailman/listinfo/sword-devel
>     >Instructions to unsubscribe/change your settings at above page
> 
>     --
>     Sent from my Android phone with K-9 Mail. Please excuse my brevity.
> 
>     _______________________________________________
>     mobile-devel mailing list
>     mobile-devel at crosswire.org <mailto:mobile-devel at crosswire.org>
>     http://www.crosswire.org/mailman/listinfo/mobile-devel
> 
> 
> 
> 
> _______________________________________________
> mobile-devel mailing list
> mobile-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/mobile-devel




More information about the mobile-devel mailing list