Hi,

Those of you who use Apertium in your Android phone will probably know that
some language pairs are currently missing there, as HFST and CG are not
supported at the moment. The good news is that this could change soon!

So I have managed to build VISL CG3 for Android. The script I use for that
is attached. After running the script, you only have to copy everything in
the output directory to the directory of native libraries in your project,
and invoke cg-proc from Java doing something like this:

String[] envp = {"LD_LIBRARY_PATH=" + getApplicationInfo().nativeLibraryDir
+ ":$LD_LIBRARY_PATH"};
Process process =
Runtime.getRuntime().exec(getApplicationInfo().nativeLibraryDir +
"/lib...cg-proc...so", envp);

However, there are still some things to do before we see this in Mitzuli or
the official app. The one that I am the most concerned with is how to do
the integration and where to put the stuff.

After discussing it with Jacob, we think that the best thing would be to
put the build scripts in a new directory under the apertium-mobile folder
in the Apertium SVN repository (
https://sourceforge.net/p/apertium/svn/HEAD/tree/trunk/apertium-mobile/).
If desired, they could also be moved to the cg repository, of course.

But the above would only solve half of the problem: where to put the code.
For me, the big question is where to put the binaries. The easy solution
would be to copy them to each of the projects that want to use them (the
official Android app, Mitzuli etc.) but, for me, this would be a very bad
idea. The reason is that, at least for now, the binaries are huge (the ARM
version alone takes about 40MB), mostly because of ICU. This might not be
that much of a problem for centralized versioning systems like svn, which
is the case of Apertium, as the client only downloads the files in the last
revision. But, for distributed versioning systems like git, which is the
case of Mitzuli, the whole repository, including the files from past
revisions, are downloaded. So, after a few updates of the CG binaries, a
simple "git clone" would require to download hundreds of megabytes, which
makes no sense (and, in addition, github sets a limit on that). That's why,
in my opinion, we should have a remote dependency for the whole Apertium
library for Android (or at least one for CG) so a single gradle line like
this:

compile 'org.apertium.lttoolboxjava.android:1.0.0@aar'

would be enough to use Apertium from any app. This could also favour
adoption, as using Apertium in a new Android project would be super simple
as you see. However, I have no experience with that, and I don't know how,
where (jCenter?) and who (me as an independent developer? or as part of
Apertium as a project/organization?) should do that.

So please let me know what you think! Any thoughts on the above will be
welcome!

Mikel

Attachment: build
Description: Binary data

------------------------------------------------------------------------------
_______________________________________________
Apertium-stuff mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/apertium-stuff

Reply via email to