Inspiration

Try It Online has served me well over many years, but I always have that issue where the moments I need it most, when I'm on my phone, it struggles to deliver as well as it could. That's why I built Try It On Your Phone, a native android app that serves as a user-friendly frontend for Try It Online, now on your phone!

What it does

Try It On Your Phone lets you write code in any language you can imagine right on your phone! Its design is intended to be simple and user-friendly, providing shortcuts to help you write code faster on a mobile keyboard and keeping every option available just a few easy taps away. Try It On Your Phone also brings over the beloved "Hello, World!" feature of Try It Online, allowing you to bypass a lot of boilerplate that might be a slog to type on a mobile keyboard. Lastly, Try It On Your Phone automatically stores all of your experiments and scratch files in a history tab so you can easily go back to them at any time.

How I built it

I built Try It On Your Phone using Kotlin and the standard android development APIs. I also used a few other libraries like OkHttp for networking, Klaxon for JSON parsing, and Room for database storage.

Challenges I ran into

While I had minimal experience contributing to open source android apps before, I had never really gotten into the thick of writing an android app before, and Kotlin was a fairly new language to me. It turns out that it's really quite challenging, and many of the hours I spent on this project were spent scrounging through documentation, Medium articles, and StackOverflow questions. Try It Online's API requires that the input be zlib deflated, and I must've spent at least one or two hours trying to figure out what was going wrong with my compression code (the standard libraries provided zlib compression tools, but they weren't as simple to use as just putting a byte array in and getting a byte array out, unfortunately).

Accomplishments that I'm proud of

Honestly I'm pretty proud that I got as much done as I did. Try It On Your Phone is truly a functional app that behaves well and I will probably keep on my phone and use in the future. I built something legitimately useful, rather than the mostly gimmicky projects I've made at prior hackathons.

As far as specifics go, I'm proud of how nicely the indentation works. I don't show it off in the video, but it behaves the same way you'd expect indent/dedent shortcuts to work on a desktop code editor with multiline indent and keeping the selection correct as indents occur. In some ways, I feel like the basic mobile text editor I built during this hackathon is a decent bit better than a lot of the mobile text editors you can find on the Play Store.

What I learned

I learned so much about android development; far too much to put it all in a list.

What's next for Try It On Your Phone

For now I think I'll take a break, but if in the future I feel like polishing it up a bit more, I might publish it to the Play Store some day. I know I'm not the only one who would find this app useful.

Built With

Share this project:

Updates