Android keyboard: Type in English, input Chinese

Xuan Wu
4 min readFeb 24, 2020

--

An Android Dev Challenge Submission

NOTE: below is from my cover letter submitted to Android Dev Challege 2019. The app is coming soon.

Tell us what your idea is.

An offline input method: when people type in some English sentence using the standard English soft keyboard, the corresponding Chinese meaning of that sentence will appear in the text field.

It doesn’t rely on online services, thus it can be used in areas without Internet or web services. Plus, it guarantees privacy, which is more and more of a concern for input method users.

One target user group are English speakers who need to communicate to Chinese who don’t speak English, like those who visit China for recreation or business.

Most use cases will be daily conversation with simple words, because the official business environments most likely have translators around. There are 30–40 million foreign visits per year to China, and assuming 20% of them can speak daily English, there are quite several million potential users even after taking into account the repeat visitors etc.

Another target user group are those who from time to time want to input Chinese but haven’t mastered Pinyin or other Chinese input methods. Consider there are millions of people learning Chinese, this can be helpful tool to part of them who speak English.

We can implement similar input methods for the opposite direction (input Chinese output English), and other language pairs. This whole family of input methods would cover tens of times of users in total.

Tell us how you plan on bringing it to life.

First I tried the official MLKit Translate sample, using simulator on my laptop while offline. The quality of the translation for the daily sentences like below seems decent, and the latency feels short enough to fit an input method.

Sentences tested:

╔═════════════════════════════════╦════════════════════╗
║ English ║ Chinese ║
╠═════════════════════════════════╬════════════════════╣
║ where’s the toilet? ║ 厕所在哪里?
║ thanks a lot ║ 非常感谢
║ See you at 2 tomorrow afternoon ║ 明天下午2点见到你
║ I was trying to help her ║ 我试图帮助她
╚═════════════════════════════════╩════════════════════╝

The demo.gif (as above) in the repository is the recorded test session. Just imagine swapping the typed in English and displayed Chinese on the screen (Chinese in the text field on the top).

Then I spent couple of days to create a pretotype by upgrading this app from @DonBrody and integrating ML Kit translation function. The repo with my changes is here. Note that the README wasn’t changed.

Please see pretotype.gif (above) for the actual session running on my LG stylo2. For demo purpose, I used punctuations, full stop and question mark, to trigger translating. That behavior could be adjusted. Another potential improvement would be to show in the now-missing candidate view the corresponding Chinese wordings while typing in English.

Ways I could use Google’s help:
1. suggestion on keyboard design, especially how to make it more user friendly and usable
2. guidance in setting up usability testing, alpha and beta tests to gather user feedback as early as possible
3. better understanding the factors that impact the quality of on-device translation, in order to adjust design accordingly

Timeline wise, below are some estimation:
1. by the end of year 2019: prototype with the very basic function, by integrating a standard English keyboardwith ML Kit on-device English to Chinese translation with proper UI
2. by end of February: based on issues realized during prototyping, adjust design and get application more solid, with more tests, on more devices
3. by end of March: prepare everything (icon, etc) for publishing, after alpha/beta testing. If needed, do some more iterations based on feedbacks.
4. one month of buffer before May

Tell us about you.

Reason I start with English-to-Chinese:

1. I know Chinese and English

2. a reason not to do the other way around first (input Chinese output English): Chinese input through Pinyin takes relatively more work, which brings more risk

Reason I join the dev challenge:

1. ML Kit seems to have the exact essential feature for this task: fast On-device Translation. As shown in the reference section in README.md, there was similar app five years ago, but it seems to suffer performance issue probably because it relies on online service.

2. I don’t see similar feature in iOS yet

3. luckily (this “input English output Chinese” idea just occurred to me couple of days ago, on 11/20, when I didn’t know about dev challenge or ML Kit) dev challenge is here, and I’d love to take this chance to make it happen in the fastest way

Below are some of my past projects.

Open Source Projects:

  1. VS Code Extension: Offline English to Chinese Translation
  2. Browser Extension:

i. Offline Identifier translation for Online Source Code (Chrome version)

ii. History in Threads, which organizes local browsing history in threads through clickstream

10+ years of developing experience, (different positions) on IDE extensions, end-to-end web applications, and customizing solutions for clients

occasionally develop mobile apps for fun, like a two-key (can only input ‘Yes’ or ‘No’) keyboard for Android back in 2015

--

--