public class UnitermNativeBridge
extends java.lang.Object
There is no need to use this class directly!
The primary user of this class is the UnitermService
. Only in
special circumstances should this class be used directly. Most interaction
should happen though the UnitermService
.
Constructor and Description |
---|
UnitermNativeBridge() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
BitmapToTiff(Bitmap bm) |
static boolean |
initialize(Context context)
Initialize the service.
|
static boolean |
modifyconfig(java.util.HashMap<java.lang.String,java.lang.String> kvs)
Modify the UniTerm ini configuration.
|
static java.util.HashMap<java.lang.String,java.lang.String> |
run_trans(java.util.HashMap<java.lang.String,java.lang.String> kvs)
Run a transaction with UniTerm.
|
static Bitmap |
TiffToBitmap(byte[] tiff) |
public static boolean initialize(Context context)
Start UniTerm and ensure any external files, such as the uniterm.ini are installed properly.
The UnitermService
will call this when it is started.
context
- Context for determining package information.public static boolean modifyconfig(java.util.HashMap<java.lang.String,java.lang.String> kvs)
This will only work when the service is running in the same address/thread as the service. This is a request to UniTerm which will modify the configuration and reload anything it needs. The configuration should not be modified outside of UniTerm. The only exception is during an app update where the service is not running and a new ini is provided. UniTerm will merge the new ini into the existing one to preserve any user settings.
kvs
- Config data.public static java.util.HashMap<java.lang.String,java.lang.String> run_trans(java.util.HashMap<java.lang.String,java.lang.String> kvs)
Running a transaction should happen though the UnitermService
using the IUniTermService interface. That will ensure UniTerm has been
properly initialized.
kvs
- Transaction data.public static byte[] BitmapToTiff(Bitmap bm)
public static Bitmap TiffToBitmap(byte[] tiff)