Inspiration

There have been several times where I might have been working on some coding problem, from a challenge or my own work, and a thought comes to mind when I'm on the move. When those times come around, I normally like to write a quick script so A.) I won't forget and B.) to make good use of my thirty minutes on the train. However, because a phone keyboard is so small, and autocomplete frequently becomes my enemy when writing function/variable names, it's a laborious process that doesn't feel worth the time. Also, since there aren't really any IDEs on the Play Store, it all ends up in a plaintext editor that just doesn't feel like a comfortable coding experience. What if we could change that, with an intelligent keyboard that knows what developers need at just the right time? That's where CodeBoard comes in.

What it does

CodeBoard is functionally the same as any other Android keyboard replacement. It can edit text in any field, from a text editor app to an SMS app. However, it scans over the code that's being written in real time to provide helpful and non-obtrusive suggestions. It also has an ergonomic design, with important keys in close reach, and support for macros. It even keeps track of declared variables, just like any name-brand IDE does. Currently, the only language supported is Python, however this is easily extensible to other languages.

How I built it

We used the Android framework, specifically the InputMethodEditor API, which allows you to create a service that acts as an input method (in our case, a keyboard). We took advantage of Android's recently released support for the Kotlin language, which aided us greatly in ensuring null pointer safety, avoiding potentially unhandled exceptions wasting our time. We deployed the keyboard to two different Android phones of different manufacturers and screen sizes for more rigorous testing.

Challenges I ran into

There was a distinct lack of (at least up to date) documentation for creating an Android keyboard. For the most part, our first six hours were spent examining the only example Google provided on the Android Developers website. We had to adopt Java code in a Kotlin environment, which added to our already formidable workload. We both had to learn more about programming to accomplish some of our tasks, like Regex for parsing user input and Kotlin syntax.

Accomplishments that I'm proud of

Once the keyboard was finished, I was surprised at how natural it felt to use! Also, it felt good that we didn't need any tutorials to figure out how to write an entire keyboard in just over 24 hours. We were also very good about version control, commiting as we went along and avoiding big merge conflicts. All in all, we worked well as a team, and as a result were able to make the best product possible.

What I learned

We both learned how to read Android source code to understand how our base classes worked, and we also discovered the exact cycle an Android keyboard goes through when a single key is pressed. This knowledge helped us make our macros. We did some research into what python developers type the most, as well.

What's next for CodeBoard

The most important thing that we want CodeBoard to have is multi language support, and so the first thing we would prioritize would be getting at least one other language option, likely HTML or Java. This would help accelerate user adoption. Other than that, we want users to be able to make the keyboard a unique experience for them, so custom macros and theme colors are on the table as well.

Built With

Share this project:

Updates