There used to be a keyboard layout designed specifically for handheld touchscreen devices called Fitaly[1]. I used this layout on my Palm Pilot back in the day.
One downside was that it seemed to have memory issues but this was years ago on a Samsung GS5.