Wiki

Clone wiki

lexicon / Download

Download


At the moment when I am writting this wiki page there is no pre-built version of this application except Java source. The only way of using this application is by compiling yourself the source code.

Required tools


In order to be able to use this application you have download the source code and compile it. Therefore you need the following tools:

It's worth knowing that when building the app with OCR support, the final .apk is 30 times larger than without OCR support ( ~ 3.5M vs. 124K)

Installing and running


To get the application running on your device, the first thing you must do is to build the application from sources, resulting a Android application package file (.apk) which can be later deployed and installed on your mobile device.

Once you have got it you will have to deploy it on your mobile device and then just to install it.

Prepare OCR support


If you want to build the program with OCR support then, as I've mentioned before, we need tess-two project.

To build the tess-two project you will need Android SDK Tools r16 and Android NDK r7 (or newer).

Follow the instructions available on the project home page:

git clone git://github.com/rmtheis/tess-two tess
cd tess/tess-two
ndk-build
android update project --path .
ant release

Build by Eclipse IDE


If you are an Java developer and you are already using the Eclipse IDE then the installing process should be smooth.

  1. Open the Eclipse project from the lexicon source folder.
  2. If you want OCR support:
    • import the tess-two project as a library in Eclipse: File -> Import -> Existing Projects into workspace -> tess-two directory.
    • right click the tess-two project, Android Tools -> Fix Project Properties.
    • right click the tess-two project then check that the following option is checked: Properties -> Android -> Check Is Library
  3. Configure lexicon project to use the tess-two project as a library project:
    • right click lexicon project then Properties -> Android -> Library -> Add, and choose tess-two.
  4. Compile the lexicon project.
  5. Make sure that you have connected your mobile device to your PC via USB (or whatever) and also that the device is configured in Debuggin mode.
  6. Run the application from Eclipse (Ctrl+F11) and when asked choose your mobile Android device as the target where the application should be launched. Contrary to the situation when you build the sources by hand, there is no need to deploy the .apk manually to the device.

Build by hand


If you are little more adventurous and you like the freedom that the command line gives you then you could try to compile everything just using the Android SDK tools. Open your terminal, and follow the instructions bellow:

  1. cd <lexicon-directory>
  2. android update project --path .
  3. ant release
  4. keytool -genkey -v -keystore /tmp/lexicon.keystore -alias lexicon -keyalg RSA -validity 10000
    • answer to all questions, finally you will get a keystore saved at /tmp/lexicon.keystore
  5. jarsigner -storepass <keystore-password> -keystore /tmp/lexicon.keystore bin/Main-release-unsigned.apk lexicon
  6. zipalign 4 bin/Main-release-unsigned.apk /tmp/lexicon.apk

At this point you have your /tmp/lexicon.apk which in fact is the lexicon application packaged into a ZIP file (with .apk extension).

The next step is to deploy and install (using the 'pm' command) this .apk into your device.

Deploy the .apk to device


In order to deploy the .apk file to your mobile device you have to connect your mobile device to your PC, as I have mentioned earlier above.

Once the mobile device is connected to your PC, open your terminal and follow the instructions bellow.

If the only Android device attached to your PC is your mobile device (no other Android emulators) then you can jump directly to the step 2, with the mention that you should not provide the -s parameter and its corresponding <device-serial> value.
  1. adb devices
    • it will list the Android devices attached to your PC
    • copy the serial of your mobile device
  2. adb -s <your-device-serial> push /tmp/lexicon.apk <sdcard-download-path>/
    • <sdcard-download-path> should be a read-write directory on your SDCard
  3. adb -s <your-device-serial> pm install <sdcard-download-path>/lexicon.apk

Note : if an older version of the program already exists on your device then you have to uninstall it before trying to install, i.e. :

adb -s <your-device-serial> pm uninstall -k se.lexicon.android
adb -s <your-device-serial> pm install  <sdcard-download-path>/lexicon.apk

Binaries


At the time I am writting this wiki (2012-05-20) I have not published this app on Google Play marketplace.

For those who do not want to bother with building & deploying the application by themselves I have built 2 packages:

  • one for Android SDK 2.1 (or later), which does not include the OCR functionality
    • click here for download (124K); right-click on the link then choose Save link/target as...
  • one for Android SDK 2.3.3 (or later), which does include the OCR functionality
    • click here for download (3.5M); right-click on the link then choose Save link/target as...
Note : after you downloaded the .apk you can follow the Deploy the .apk to device procedure for installing the .apk on your device.
Note the fact that when deploying you should use the .apk name that you have downloaded, instead the generic one described in the procedure above.

Run app for the first time


By default the application is not provided with any dictionary (the average packed dictionary size is ~ 4-5 MB, unpacked ~ 12-18 MB).

You will be prompted to install a new dictionary from those available on the download server(s).

Check one (or more) dictionary that you would like to install and then press Continue. The download process will start imediately.

Do not install those dictionaries that you don't need them, just to be there. You can do it later, if you really need them.

Updated