Giter Club home page Giter Club logo

latinime-android-studio's Introduction

Gradle build for LatinIME (Android Keyboard)

Develop LatinIME in Android Studio without a need to download and build whole AOSP.

Currently building LatinIME requires downloading and building whole Android sources. This requires tens of gigabytes of disk space and takes couple hours to complete. The aim of this project is to allow development of LatingIME using Android Studio, Android SDK and NDK.

Current status

This is still a work in progress. Currently building the Java part of the app works fine but you still need to build native libraries separately or extract them from existing APK. Building host tools (used to generate dictionaries) still requires some more work.

How to build LatinIME APK

  1. Checkout this build configuration:

     git clone https://github.com/iwo/LatinIME-Android-Studio.git .
    
  2. Checkout LatinIME sources to LatinIME subdirectory:

     git clone https://github.com/CyanogenMod/android_packages_inputmethods_LatinIME.git LatinIME
    
  3. Checkout frameworks/opt/inputmethodcommon into inputmethodcommon:

     git clone https://github.com/CyanogenMod/android_frameworks_opt_inputmethodcommon.git inputmethodcommon
    
  4. Import project into Android Studio

  5. Copy prebuild libjni_latinime.so to app/src/main/jniLibs/armeabi/libjni_latinime.so

  6. Remove LatinIME/java/res/values/strings-emoji-descriptions.xml (or fix encoding of the comments)

Enjoy your new Android Keyboard!

latinime-android-studio's People

Contributors

iwo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

latinime-android-studio's Issues

building native libraries

I'm pertty new to android development, I have no clue what you mean by building native libraries, can you point me to the right direction ?
Besides this, I followed every step but there is no src directory in app even after building without errors

libjni_latinime.so could not build

Hello! Thank you for this source! Project is build with no errors but it gives me the following error in runtime:

JNI DETECTED ERROR IN APPLICATION: JNI NewGlobalRef called with pending exception java.lang.NoSuchMethodError: no static or non-static method "Lcom/android/inputmethod/latin/BinaryDictionary;.createEmptyDictFileNative(Ljava/lang/String;J[Ljava/lang/String;[Ljava/lang/String;)Z"
12-11 14:58:22.545 19967-19967/com.android.inputmethod.latin A/art: art/runtime/java_vm_ext.cc:448]   at java.lang.String java.lang.Runtime.nativeLoad(java.lang.String, java.lang.ClassLoader, java.lang.String) (Runtime.java:-2)
12-11 14:58:22.545 19967-19967/com.android.inputmethod.latin A/art: art/runtime/java_vm_ext.cc:448]   at java.lang.String java.lang.Runtime.doLoad(java.lang.String, java.lang.ClassLoader) (Runtime.java:435)
12-11 14:58:22.545 19967-19967/com.android.inputmethod.latin A/art: art/runtime/java_vm_ext.cc:448]   at void java.lang.Runtime.loadLibrary(java.lang.String, java.lang.ClassLoader) (Runtime.java:370)
12-11 14:58:22.545 19967-19967/com.android.inputmethod.latin A/art: art/runtime/java_vm_ext.cc:448]   at void java.lang.System.loadLibrary(java.lang.String) (System.java:1076)
12-11 14:58:22.545 19967-19967/com.android.inputmethod.latin A/art: art/runtime/java_vm_ext.cc:448]   at void com.android.inputmethod.latin.utils.JniUtils.<clinit>() (JniUtils.java:33)
12-11 14:58:22.545 19967-19967/com.android.inputmethod.latin A/art: art/runtime/java_vm_ext.cc:448]   at void com.android.inputmethod.latin.utils.JniUtils.loadNativeLibrary() (JniUtils.java:0)
12-11 14:58:22.545 19967-19967/com.android.inputmethod.latin A/art: art/runtime/java_vm_ext.cc:448]   at void com.android.inputmethod.latin.LatinIME.<clinit>() (LatinIME.java:546)
12-11 14:58:22.545 19967-19967/com.android.inputmethod.latin A/art: art/runtime/java_vm_ext.cc:448]   at java.lang.Object java.lang.Class.newInstance!() (Class.java:-2)
12-11 14:58:22.545 19967-19967/com.android.inputmethod.latin A/art: art/runtime/java_vm_ext.cc:448]   at void android.app.ActivityThread.handleCreateService(android.app.ActivityThread$CreateServiceData) (ActivityThread.java:2995)
12-11 14:58:22.545 19967-19967/com.android.inputmethod.latin A/art: art/runtime/java_vm_ext.cc:448]   at void android.app.ActivityThread.access$1900(android.app.ActivityThread, android.app.ActivityThread$CreateServiceData) (ActivityThread.java:150)
12-11 14:58:22.545 19967-19967/com.android.inputmethod.latin A/art: art/runtime/java_vm_ext.cc:448]   at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1495)
12-11 14:58:22.545 19967-19967/com.android.inputmethod.latin A/art: art/runtime/java_vm_ext.cc:448]   at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102)
12-11 14:58:22.545 19967-19967/com.android.inputmethod.latin A/art: art/runtime/java_vm_ext.cc:448]   at void android.os.Looper.loop() (Looper.java:168)
12-11 14:58:22.545 19967-19967/com.android.inputmethod.latin A/art: art/runtime/java_vm_ext.cc:448]   at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:5885)
12-11 14:58:22.545 19967-19967/com.android.inputmethod.latin A/art: art/runtime/java_vm_ext.cc:448]   at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2)
12-11 14:58:22.545 19967-19967/com.android.inputmethod.latin A/art: art/runtime/java_vm_ext.cc:448]   at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:819)
12-11 14:58:22.545 19967-19967/com.android.inputmethod.latin A/art: art/runtime/java_vm_ext.cc:448]   at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:709)

I put the libjni_latinime.so file in app - src- main- jniLibs but it gives me this error all the time! Please help me out solving this issue! Thank you!

add more language dictionaries

I managed to build the keyboard following your guide. I prebuild the libjni_latinime.so files using this git ( https://github.com/modricwang/ctrlaltdel-aosp-ime) after i have changed all references to the package name. This way i have avoided to download and build the whole AOSP tree.
Allthough i would like to add more language predict words , so i need the binary .dict files for greek and arabic language. How can i add them? do i really need to download the whole aosp to build the dicts using dicttool?
Any help is appreciated

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.