Writing software using a phone!

Developing without a laptop: Living the dream.

Update 3: This is probably the best way to do it now-a-days: https://medium.com/samsung-internet-dev/developing-on-android-phones-visual-studio-code-on-dex-4c99d2e80e91

Update 2: https://medium.com/samsung-internet-dev/web-development-on-a-phone-updated-for-linux-on-dex-4b8ed6f693fc

I was sat on my (long) train to work, just reached the halfway point, getting comfy, checking twitter on my phone.

Suddenly I realised!

“Shit!! I left my laptop at home, what should I do?!”

It was too late to turn back, but I had an idea: the last few days I had been testing websites on Samsung DeX. This is a small dock which turns your S8 smartphone into a desktop computer.

Perhaps it could get me out of trouble? The advertising I saw suggested productivity, but it was mostly focused on normal office job work excel/word/email/etc.

Still, perhaps it could work for me as a developer.

“Necessity is the mother of invention”

Developing on DeX!

The Slack android app has already been optimised for DeX and all the web tools I use day to day, github, trello, jira, can all be used through the full desktop web browser.

But for writing code? Well first I need a terminal!

I installed the app Termux. Termux provides a bash terminal for android with many GNU utilities, compiled for android. It brings tools like git, node and ruby to the phone. I had been using it previously for emergency devops on the go. It was the right choice. Although as a native app that is not adapted for DeX the window cannot be resized, this is not an issue as it is already a perfectly sized terminal window.

On Termux everything I needed could be installed: node, npm, git, python . I tested a http server; it was accessible out of the Termux sandbox via its IP address e.g. 127.0.0.1:8080 so I was able to test my sites in Samsung Internet. The mobile versions of Chrome and Firefox are available on DeX too.

Two weeks later

I left my laptop at home. On purpose this time. I didn’t need it!

Over two weeks I’d built an Open Source IDE for DeX called Web Code. It is a Web App which uses web sockets to access the Termux file system!

It’s based around Monaco, the same text editing core as Visual Studio Code, so all of my keyboard shortcuts remain the same as on my laptop. This was the missing link to a comfortable developer environment on DeX.

The rest of this article shows how to set it up yourself and how to work around some of the quirks in Termux, for developing on Android:

Setting it up for yourself

Want a development machine you can fit in your purse? This is an incredibly cool way to work!