Development on Mobile 2: A Working Dev Environment

(This is the second part of the “Development on Mobile” series, which covers the design and development of a web application using only mobile devices.)

The first challenge so far is obvious, but still comes as a shock: no local development environment. Aside from a few proof of concepts, I’m not able to find much existing work here. We’re just not going to be able to run ‘bundle’ and ‘rails server’ on mobile.

I’ll likely do some development on the iPad, but I’m working on the phone (Nexus 5) to start with.

I’ve decided to set up a cheap server as my development environment. This will be used to host my code during development. I’ll share my development environment with the mobile devices with Dropbox or SFTP, which more mobile editors seem to support. One concern I have at this point is latency- if I save a change on the phone with Dropbox, will the server update immediately?

Picking a Host

Surprisingly, this was an issue. Digital Ocean vs. EC2:

IMG_0132.PNGIMG_0133.PNG

So I went with Digital Ocean, in part because it’s cheaper and I just like them, but also because the EC2 interface isn’t usable on the phone. A strange reason to make a technical decision, and pitfall if working on an existing application (though there are some 3rd party tools in the stores).

SSH

Without much evaluation, I picked JuiceSSH for the phone. It had strong reviews and was free. Without much trouble, I was up and running with new Rails app.

IMG_0134.PNG

I recently picked up VIM, and it’s paying off. This is getting pretty hairy, but I’m happy to have some powerful keyboard shortcuts at the ready.

IMG_0135.PNG

I’m using Nginx and Passenger to host the site. It’s important to configure Passenger to use the development environment to view error messages and handle code updates without restarting.

Dropbox was surprisingly easy to set up, and is officially supported.

The Editor

I originally began with CodeAnywhere, another free app with good reviews. The design looks great, and aside from a few quirks I figured this was a good choice. After a little time, though, the problems became insurmountable. Namely, I couldn’t get syntax coloring to set automatically, and, most importantly, nearly every edit would introduce bad characters into my files. Simply opening my Gemfile made it unusable, with Bundler blowing up on bad multibyte characters, commas that weren’t really commas, and other weirdness. Worst, all settings were buried in the web app, which again is unusable on mobile.

I switched to DroidEdit, which resolved the worst of my issues. I had to drop $2.99 for Dropbox support. I’m sure opinion will change once I get started coding, but it was enough to add some gems, a route, a controller, and a view and get the project off the ground.

IMG_0136.PNG

And we’re running!

IMG_0137.PNG

I now have a fully running development environment. Now to design the app!

Leave a comment