hackerskeyboard icon indicating copy to clipboard operation
hackerskeyboard copied to clipboard

Auto suggestions disappeared after upgrading to Android 13

Open blochl opened this issue 3 years ago • 28 comments

WARNING: This is a rather ancient project that was originally developed back in 2011 based on the Android 2.3 (Gingerbread) AOSP keyboard. While it still works as-is for many users, it would need some major rewrites to work with newer APIs, and some features such as language switching or popup keys don't work right on modern Android systems. I'm not currently planning on significant updates, and it's possible that it will stop working on modern devices or will no longer be updateable via the Google Play store due to minimum API level requirements. Play Store requires targeting API level 29 (Android 10), while the code was written for API level 9 (Android 2.3) from 2011.

I am aware it's an old project, but I absolutely love it, and didn't find a suitable alternative for years now.

Describe the bug After upgrading to Android 13, the word suggestions disappeared. I do have the dictionaries installed.

To Reproduce Start typing a message - no orange suggestions appear above the keyboard.

Expected behavior Once typing a message, word suggestions appear above the keyboard. Even before typing - suggestions for punctuation marks appear.

Screenshots no-suggestions

Smartphone (please complete the following information):

  • Device: Pixel 4a 5G
  • OS: Android 13
  • App version 1.40.7

blochl avatar Aug 25 '22 09:08 blochl

I've noticed the same thing on Pixel 5. The predictions seem to be generated since space/punctuation completes the word as expected.

mansr avatar Sep 01 '22 15:09 mansr

S22 Ultra, same issue. So, not just the pixel

AeSix avatar Nov 06 '22 05:11 AeSix

Same on the Galaxy Note20

MrSent avatar Nov 16 '22 18:11 MrSent

This happens on all devices running Android 13 afaik. It would be a shame if this kinda kills Hacker's Keyboard, because it's the world's best keyboard ever. Seriously, if anyone's able to fix it, please do so. I would try to fix it if I could. Unfortunately my knowledge of developing Android apps is pretty much non-existing. :(

acidstout avatar Dec 01 '22 23:12 acidstout

It looks like there was a change in Android 13 that affected all soft keyboards, not only this one.

According to https://issuetracker.google.com/issues/246132117 , this issue is assigned; so there should be an Android update at some point that will fix it (hopefully soon). I tried the workaround that they mention, setCandidatesViewShown(true);, but the issue persists. Maybe I did it wrong, idk, I'm not familiar with soft keyboard development, nor with this codebase...

There's also a recent StackOverflow question which might be related, it can be worth keeping an eye on it: https://stackoverflow.com/questions/75353455/from-android-12-onward-candidateview-or-suggestion-list-not-showing-up-in-custom

Foo-Manroot avatar Feb 06 '23 10:02 Foo-Manroot

I believe I fixed this. It isn't pretty but it seems to work fine for now. Patch is at https://github.com/klausw/hackerskeyboard/commit/c504b79f3783cbf1f6228014fdd0bad288ad0d2c

I also fixed an incompatibility between new ConnectBot versions and Hacker's Keyboard, refer to https://github.com/connectbot/connectbot/issues/1038 -- patch is at https://github.com/klausw/hackerskeyboard/commit/d5a4ef1bb59bf09a5c8e5f78c5f70fa454b4450a

ecm-pushbx avatar Mar 24 '23 18:03 ecm-pushbx

Added another fix to avoid the "double tap on Back needed for some applications" problem of my prior patch, this was mentioned in https://issuetracker.google.com/issues/246132117#comment18

https://github.com/ecm-pushbx/hackerskeyboard/commit/859b0d490603aa013e15dc53adfc1d7bf4a80234

ecm-pushbx avatar Mar 25 '23 16:03 ecm-pushbx

If someone wants to try without having to build from the sources, I uploaded debug APKs that work on my device, a Nothing Phone (1), to https://pushbx.org/ecm/test/20230325/

ecm-pushbx avatar Mar 25 '23 16:03 ecm-pushbx

Hi

Thank you very much for taking the time! I'm not quite sure what I did wrong, because setCandidatesViewShown() does indeed work correctly... Maybe I just added it to the wrong subclass, idk

In any case, I confirm this fixes the issue on LineageOS 20.0. Now I can see the suggestions again

Foo-Manroot avatar Mar 25 '23 21:03 Foo-Manroot

It's important to call super.setCandidatesViewShown. In my testing it appears you only need to call the super. prefixed function actually, and not the ones provided by our class. I'm just learning all of this so it is trial and error.

Also, there still are bugs around this, for example whenever I send a message in the blabber.im app the keyboard disappears and immediately re-appears.

ecm-pushbx avatar Mar 25 '23 22:03 ecm-pushbx

Updated with another bugfix to address the last problem I mentioned, https://github.com/ecm-pushbx/hackerskeyboard/commit/b12891bb5836d935320606280ece130e912a8f0d

ecm-pushbx avatar Mar 26 '23 14:03 ecm-pushbx

I wrote about my bugfixes on my blog: https://pushbx.org/ecm/dokuwiki/doku.php?id=blog:pushbx:2023:0326_more_ldebug_getinput_work_hacker_s_keyboard_app_modding (This also contains a description of what I had to do to make the app build.)

ecm-pushbx avatar Mar 26 '23 15:03 ecm-pushbx

Any chance that it will be updated on Google Play?

blochl avatar Oct 22 '23 16:10 blochl

Any chance that it will be updated on Google Play?

Hi, just wanted to quickly reply. I think that the targeted Android platform version is too old for the Play store. I don't know how much work it would be to update that. I also don't know generally what is entailed in getting an app published there. This is the very first time I did any work on an Android app.

ecm-pushbx avatar Oct 22 '23 16:10 ecm-pushbx

@ecm-pushbx Still, if you were to open a PR here for @klausw to review & approve, it would make it to F-droid, where HK's a mainstay.

TPS avatar Oct 23 '23 03:10 TPS

Just a note to flag up that I'm having the same issue on a Nokia X30 running Android 13, stock not rooted.

Kl3nch avatar Jan 01 '24 18:01 Kl3nch

I wrote about my bugfixes on my blog: https://pushbx.org/ecm/dokuwiki/doku.php?id=blog:pushbx:2023:0326_more_ldebug_getinput_work_hacker_s_keyboard_app_modding (This also contains a description of what I had to do to make the app build.)

If you have a moment, would you be so kind as to tell me how to implement your fix please? I'm not a programmer/developer, so this is new territory for me. TYSM!

SelenaSaberWind avatar Feb 28 '24 19:02 SelenaSaberWind

If someone wants to try without having to build from the sources, I uploaded debug APKs that work on my device, a Nothing Phone (1), to https://pushbx.org/ecm/test/20230325/

@SelenaSaberWind Did you try the build uploaded here?

TPS avatar Feb 28 '24 23:02 TPS

I can reproduce this (at least I think this is the same thing): on Lineage 16 (Android 9), I see the punctuation bar populated: and on Lineage 21 (Android 14), it's still there, but empty:

Installing @ecm-pushbx's fork (building android programs is insurmountable for me, so from https://pushbx.org/ecm/test/20230325/20230326.1.apk (thanks for linking the page in the blog post, sorry for scraping it for the newest version)) fixed it :)

nabijaczleweli avatar Apr 22 '24 13:04 nabijaczleweli

Or not; it actually works everywhere except for ConnectBot where clicking on the text to pop up the esc/ctrl/left/&c. controls hides the keyboard and it's sometimes difficult to pull up again.

nabijaczleweli avatar Apr 22 '24 20:04 nabijaczleweli

With minor issues (https://101010.pl/@nabijaczleweli/112320802836461846) I found the bug in @ecm-pushbx's fix (https://github.com/nabijaczleweli/hackerskeyboard/commit/d9a4041e463e5b9da9fd7b690d41fcc1c9435754), yielding 1041006.apk in https://lfs.nabijaczleweli.xyz/0019-org.pocketworkstation.pckeyboard (cf. bisect in INDEX and branches/tags on https://github.com/nabijaczleweli/hackerskeyboard).

nabijaczleweli avatar Apr 23 '24 13:04 nabijaczleweli

@nabijaczleweli: https://github.com/SeventhM/hackerskeyboard seems to be the most active current fork. Maybe PR there so @SeventhM might review?

TPS avatar Apr 23 '24 23:04 TPS

Note: after some testing around, ecm-pushbx's fix only kinda works on my fork. I managed to break viewing candidates. Probably something to do with how I updated to AndroidX though I need to do a bit more follow ups. I also realized that particularly fix causes issues in some apps (notably chromium based browsers) where the keyboard gets shown, but hidden, requiring a use of the back button to dismiss it despite the keyboard not being entirely on the screen. I think I know what the relevant issue is here, but again, I need to do some follow up checks to understand what I broke about the candidates

SeventhM avatar Apr 24 '24 03:04 SeventhM

For anyone wanting to follow along with figuring out what I might've broke by accident: https://github.com/SeventhM/hackerskeyboard/issues/4

This would be a lot easier if I had a dictionary that worked. I know HK is supposed to work with AnySoft dictionaries, but they no longer release those as a separate app. I think(?) almost the whole app can be found here, so that might be an avenue to check. But I suspect that'll be a dead end. Plus it would likely be a better idea to implement the dictionary within the app as a default (while simply allowing external dictionaries as well) so we don't have this issue in the future

SeventhM avatar May 01 '24 02:05 SeventhM

Somehow I don't think this is at all related to dictionaries, given that I'm (was) affected by this and don't use a dictionary.

nabijaczleweli avatar May 01 '24 11:05 nabijaczleweli

I'm pretty sure even though you don't use dictionaries for spell checking, that a dict is used for the suggested words. Since that's an integral part of the top bar, if that's not working properly - that bar may misbehave.

AeSix avatar May 01 '24 13:05 AeSix

It can't really be an integral part of the top bar if i haven't seen a word suggestion in the last five years and the bar works perfectly and as-expected. Probably.

nabijaczleweli avatar May 01 '24 13:05 nabijaczleweli

Turns out dictionaries wasn't entirely relevant, but getting them working is still helpful for me

SeventhM avatar May 07 '24 02:05 SeventhM