Giter VIP home page Giter VIP logo

giellakbd-android's Introduction

giellakbd-android

A fork of LatinIME (by Google for Android), targeting marginalised languages that also deserve first-class status on mobile operating systems.

Note. This project is the place where all the code is kept. It also has som basic configuration, but crucially - you can't open this project in Android Studio and run it (yes, you can. In a way, but it's no good. Look. Stop interrupting me and pay attention).

Backgound

On one hand, you have all the linguists and other related folks at UiT working on getting spellers and suggestions and reasonable keyboard layouts. They work in one repo per language.

On the other hand you have the android app that's supposed to be one single app that ships many languages.

The linguists don't only make the android app, they make ios, mac, windows etc. They shouldn't have to worry about android stores etc. To facilitate this, they create a yaml layout such as this

If you wanna build an android app though, that won't help you. You need layout xml:s. Introducing - kbdgen. Kbdgen downloads layout files. It does it by cloning this repo and then meta-programming on some layouts and xmls.

To compile the problem slightly, we don't really want to distribute one keyboard per language. Hence, we combine multiple languages per keyboard. There are two repos for this. https://github.com/divvun/divvun-dev-keyboard and https://github.com/divvun/divvun-keyboard . Right? Right.

Building

You're gonna need kbdgen. You can download it from pahkat. Technically.

$ wget https://pahkat.uit.no/devtools/download/kbdgen\?channel\=nightly\&platform\=macos

The following will download divvun-dev-keyboard and create you a runnable android project.

cd source/divvun
git clone [email protected]:divvun/kbdgen.git
git clone [email protected]:divvun/divvun-dev-keyboard.git 
cd kbdgen
cargo run -- fetch -b /Users/srdkvr/source/divvun/divvun-dev-keyboard/divvun-dev.kbdgen #fetches deps since divvun-dev-keyboard is shallow
cargo run -- target --bundle-path /Users/srdkvr/source/divvun/divvun-dev-keyboard/divvun-dev.kbdgen --output-path ~/source/divvun/android_keyboard android build

You might need

$ brew install imagemagick@6
$ echo 'export PATH="/opt/homebrew/opt/imagemagick@6/bin:$PATH"' >> ~/.zshrc

If you got this right, you can open ~/source/divvun/android_keyboard in Android Studio and work on your project. If you make any code-changes, make sure to upload them in this repo and this repo alone. Don't upload all the files kbdgen put in this directory for you.

License

Apache 2 license. See LICENSE.

giellakbd-android's People

Contributors

alvskar avatar bbqsrc avatar dylanhand avatar ena-fly avatar ftyers avatar lenguyenthanh avatar rawa avatar snomos avatar trondtr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

giellakbd-android's Issues

App version on app About page

We need an easy way for users to identify which version of the keyboard app they are using. The obvious place to put it would be on the About page in the app.

Divvun keyboard does not work with work profile

On newer Android versions, one can have multiple profiles. One user has this profile setup: private ("Henkilökohtainen") and work ("Työ"), cf screen shot.

image

The North Sámi Divvun keyboard works without issues when the private profile is active, while it is inaccessible in the work profile.

Update emoji keyboard

To cover all recent additions, bringing it on par with the default Android keyboards.

Keys skewed to left in recent versions

Screenshot_20230828_143554_com whatsapp

This is true for the SJD, SME and SMJ keyboards, probably other keyboards. This started with an Android update this summer using automatic updates. Possibly after system upgrades to Android 13. Nothing has changed with the actual keyboards during this period.

Samiske tastaturer: Choose preferred sami language on installation

On installation, when activating the keyboard, an option page (perhaps the existing languages option page) should be opened "forcing" the user to choose one or more sami languages.

As it is now, the user is given an option to setup more languages in the third step of the installation, and might not understand that this is where the sami languages should be chosen (I have fallen into this trap). If a sami language isn't actively chosen, we end up with (yet) another keyboard for the system language, and this is not what we want to achieve.

MODIFIER LETTER PRIME not a letter

Reported by @Trondtr:

sms mobile keyboar, android.
Tested on Samsung S7 Edge, Android 8.0.0, Samsung's own Notepad program, with the sms keyboard of 31.1.2019.

PROBLEM:
The keyboard recognises MODIFIER LETTER PRIME but is not able to suggest it.

To repeat:
Open the sms keyboard for android and write e.g.

anteʹnn

The keyboard will display
anteeʹnn anteʹnn anteʹnn

So far so good.
But then I click on the word
anteʹnn

What then happens is that only the part "ante" is underlied, and I get the suggestions
aktt snt ahnte
(all three related to a situation where input is "ante" and not "anteʹnn"

Similarily, if i write anteʹnnn
the program is not able to correct it, since it sees it as two words.

The letter in question, MODIFIER LETTER PRIME, position D12 on the sms keyboard, is a letter according to Unicode, but unfortunately a delimiter according to Android.

Letters with combining diacritics smaller than precomposed letters

sjd-4row-android

Hypothesis: Android counts number of codepoints, not character class, and concludes there are "two" letters, thus they must be smaller to fit. The proper solution would be to ignore codepoints that belong to the Nonspacing_Mark (Mn) unicode class, or to any Combining class.

But the cause can of course be something completely different.

Frozen SJD keyboard

Several SJD users have reported cases where the keyboard freezes, and must be deactivated and reactivated to be usable. In some cases it must even be reinstalled.

The following is a rough translation of a user report:

The SJD keyboard disappears after the phone has been used with another keyboard, e.g. Swedish or Russian, for a while ("a while" varies a bit, from some minutes to a couple of hours). That is, one can select the SJD keyboard in the globe menu, but the keyboard does not display, only a black or gray area, see screen shots:

Screenshot_SMS

And this:

Screenshot_Wattsapp

It also seems to require an Internet connection during (de)activaion, which makes the situation even more frustrating.

Please fix this, some users have already stopped using the keyboard because of all the trouble.

Plains cree is Plains cree - only

There is no difference in the keyboard list or elsewhere between the Latn & Cans layouts, so people will have to guess. Not good.

2020-06-05 08 09 23

Samiske tastaturer v. 1.1.2 crashes constantly

I installed v1.1.2 today, and it crashes constantly when I try to activate it. The only way to get a working keyboard is to uninstall v.1.1.2.
v.1.1.1 worked for me.

I have a Moto G4 Plus, with Android 7.0 on it.

Crash on language settings

I tried to test #35 but only get crashes when trying to open language selection setting with this stack trace

java.lang.RuntimeException: Failed to call observer method
	at androidx.lifecycle.ClassesInfoCache$MethodReference.invokeCallback(ClassesInfoCache.java:226)
	at androidx.lifecycle.ClassesInfoCache$CallbackInfo.invokeMethodsForEvent(ClassesInfoCache.java:194)
	at androidx.lifecycle.ClassesInfoCache$CallbackInfo.invokeCallbacks(ClassesInfoCache.java:186)
	at androidx.lifecycle.ReflectiveGenericLifecycleObserver.onStateChanged(ReflectiveGenericLifecycleObserver.java:37)
	at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:354)
	at androidx.lifecycle.LifecycleRegistry.forwardPass(LifecycleRegistry.java:265)
	at androidx.lifecycle.LifecycleRegistry.sync(LifecycleRegistry.java:307)
	at androidx.lifecycle.LifecycleRegistry.moveToState(LifecycleRegistry.java:148)
	at androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent(LifecycleRegistry.java:134)
	at com.android.settingslib.core.lifecycle.ObservablePreferenceFragment.onStart(ObservablePreferenceFragment.java:98)
	at com.android.settings.core.InstrumentedPreferenceFragment.onStart(InstrumentedPreferenceFragment.java:73)
	at com.android.settings.SettingsPreferenceFragment.onStart(SettingsPreferenceFragment.java:1112)
	at com.android.settings.dashboard.DashboardFragment.onStart(DashboardFragment.java:219)
	at androidx.fragment.app.Fragment.performStart(Fragment.java:3019)
	at androidx.fragment.app.FragmentStateManager.start(FragmentStateManager.java:568)
	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:277)
	at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:113)
	at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1331)
	at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2772)
	at androidx.fragment.app.FragmentManager.dispatchStart(FragmentManager.java:2722)
	at androidx.fragment.app.FragmentController.dispatchStart(FragmentController.java:273)
	at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:486)
	at com.android.settingslib.core.lifecycle.ObservableActivity.onStart(ObservableActivity.java:74)
	at com.android.settings.SettingsActivity.onStart(SettingsActivity.java:589)
	at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1566)
	at android.app.Activity.performStart(Activity.java:8572)
	at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3934)
	at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
	at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
	at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2415)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:211)
	at android.os.Looper.loop(Looper.java:300)
	at android.app.ActivityThread.main(ActivityThread.java:8410)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:559)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:954)
Caused by: java.lang.ClassCastException: com.android.settingslib.inputmethod.InputMethodSubtypePreference cannot be cast to com.android.settingslib.PrimarySwitchPreference
	at com.android.settingslib.inputmethod.InputMethodAndSubtypeUtilCompat.saveInputMethodSubtypeListForUserInternal(InputMethodAndSubtypeUtilCompat.java:249)
	at com.android.settingslib.inputmethod.InputMethodAndSubtypeUtilCompat.saveInputMethodSubtypeList(InputMethodAndSubtypeUtilCompat.java:174)
	at com.android.settingslib.inputmethod.InputMethodAndSubtypeEnablerManagerCompat.setAutoSelectionSubtypesEnabled(InputMethodAndSubtypeEnablerManagerCompat.java:227)
	at com.android.settingslib.inputmethod.InputMethodAndSubtypeEnablerManagerCompat.updateAutoSelectionPreferences(InputMethodAndSubtypeEnablerManagerCompat.java:276)
	at com.android.settingslib.inputmethod.InputMethodAndSubtypeEnablerManagerCompat.refresh(InputMethodAndSubtypeEnablerManagerCompat.java:88)
	at com.android.settings.inputmethod.InputMethodAndSubtypePreferenceController.onStart(InputMethodAndSubtypePreferenceController.java:60)
	at com.android.settingslib.core.lifecycle.Lifecycle.onStart(Lifecycle.java:124)
	at com.android.settingslib.core.lifecycle.Lifecycle.-$$Nest$monStart(Unknown Source:0)
	at com.android.settingslib.core.lifecycle.Lifecycle$LifecycleProxy.onLifecycleEvent(Lifecycle.java:222)
	at java.lang.reflect.Method.invoke(Native Method)
	at androidx.lifecycle.ClassesInfoCache$MethodReference.invokeCallback(ClassesInfoCache.java:222)
	... 38 more

Sentry crash reports to look into

The following is some crude statistics gathered from Sentry emails. We should look into at least some of them to fix crashes in our keyboards:

  • 92 DivvunSpellException
  • 63 NullPointerException
  • 50 CursorWindowAllocationException
  • 37 OutOfMemoryError
  • 22 RuntimeException
  • 16 UninitializedPropertyAccessException
  • 15 UnsatisfiedLinkError

Sentry reports with less than 10 occurrences have been disregarded.

Further details from https://sentry.io/organizations/divvun/issues/?project=1335356 (restricted access).

Android 10 mixing in English and Norwegian speller suggestions?

Typed a string with a spelling error:
Screenshot_20200120-124412-kopi

Then typed a space (triggered a red underline), then deleted the space, triggering another set of suggestions, with less Sámi:
Screenshot_20200120-124422-kopi

Android 10 because this seems to be new behavior sinse then, but that is not confirmed.

Deadkeys not working

Instead I get a sequence of accent + base letter. Tested with latest beta (2.99.0) on a Samsung 9" pad.

2020-06-05 08 05 34

Crash while loading BHFST file

The bhfst works with divvunspell:

05-07 13:14:12.558  3861  5596 I ActivityManager: Start proc 6056:org.nlhowell.ddo/u0a298 for service org.nlhowell.ddo/com.android.inputmethod.latin.LatinIME
05-07 13:14:13.516  6056  6056 D onCreate: Locale: ddo
05-07 13:14:13.518  6056  6056 W System.err: java.io.FileNotFoundException: layouts/ddo.json
05-07 13:14:13.608  6056  6056 D DivvunUtils: getSpeller() for ddo
05-07 13:14:13.760  6056  6056 F libc    : Fatal signal 6 (SIGABRT), code -6 in tid 6056 (rg.nlhowell.ddo)
05-07 13:14:13.893  6208  6208 F DEBUG   : pid: 6056, tid: 6056, name: rg.nlhowell.ddo  >>> org.nlhowell.ddo <<<
05-07 13:14:13.904  6208  6208 F DEBUG   :     #02 pc 00000000000b2538  /data/app/org.nlhowell.ddo-ynF5hEComh1mmiLOUVspPQ==/lib/arm64/libdivvunspell.so (_ZN3std3sys4unix14abort_internal17he54cec259ec454baE+4)
05-07 13:14:13.904  6208  6208 F DEBUG   :     #03 pc 00000000000bac30  /data/app/org.nlhowell.ddo-ynF5hEComh1mmiLOUVspPQ==/lib/arm64/libdivvunspell.so (rust_oom+36)
05-07 13:14:13.904  6208  6208 F DEBUG   :     #04 pc 00000000000cf514  /data/app/org.nlhowell.ddo-ynF5hEComh1mmiLOUVspPQ==/lib/arm64/libdivvunspell.so (_ZN5alloc5alloc18handle_alloc_error17h3272256472896dcbE+4)
05-07 13:14:13.904  6208  6208 F DEBUG   :     #05 pc 00000000000b43a8  /data/app/org.nlhowell.ddo-ynF5hEComh1mmiLOUVspPQ==/lib/arm64/libdivvunspell.so (_ZN3std10sys_common12os_str_bytes5Slice8to_owned17h09902bd5dac085a4E+52)
05-07 13:14:13.904  6208  6208 F DEBUG   :     #06 pc 00000000000b39ec  /data/app/org.nlhowell.ddo-ynF5hEComh1mmiLOUVspPQ==/lib/arm64/libdivvunspell.so (_ZN3std4path4Path11to_path_buf17he4f43a16748e5dc6E+16)
05-07 13:14:13.904  6208  6208 F DEBUG   :     #07 pc 0000000000085df4  /data/app/org.nlhowell.ddo-ynF5hEComh1mmiLOUVspPQ==/lib/arm64/libdivvunspell.so (divvun_thfst_chunked_box_speller_archive_open+60)
05-07 13:14:13.904  6208  6208 F DEBUG   :     #08 pc 000000000000fe70  /data/app/org.nlhowell.ddo-ynF5hEComh1mmiLOUVspPQ==/lib/arm64/libjnidispatch.so (ffi_call_SYSV+96)
05-07 13:14:13.904  6208  6208 F DEBUG   :     #09 pc 000000000000f660  /data/app/org.nlhowell.ddo-ynF5hEComh1mmiLOUVspPQ==/lib/arm64/libjnidispatch.so (ffi_call+292)
05-07 13:14:13.904  6208  6208 F DEBUG   :     #10 pc 0000000000006cf0  /data/app/org.nlhowell.ddo-ynF5hEComh1mmiLOUVspPQ==/lib/arm64/libjnidispatch.so
05-07 13:14:13.904  6208  6208 F DEBUG   :     #11 pc 000000000000fbac  /data/app/org.nlhowell.ddo-ynF5hEComh1mmiLOUVspPQ==/lib/arm64/libjnidispatch.so
05-07 13:14:13.904  6208  6208 F DEBUG   :     #12 pc 000000000000fefc  /data/app/org.nlhowell.ddo-ynF5hEComh1mmiLOUVspPQ==/lib/arm64/libjnidispatch.so
05-07 13:14:13.904  6208  6208 F DEBUG   :     #13 pc 0000000000025e18  /data/app/org.nlhowell.ddo-ynF5hEComh1mmiLOUVspPQ==/oat/arm64/base.odex (offset 0x20000)
05-07 13:14:14.951  3861  4768 I ActivityManager: Process org.nlhowell.ddo (pid 6056) has died: fore IMPB

Here is the bhfst file base-64 encoded:

ddo.bhfst.b64.txt

You can decode it using :

$ base64 -d < filename.txt > ddo.bhfst

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.