HACKER Q&A
📣 noobermin

Coding on Your Phone?


What are your solutions, if any, for editing code on your phone? I often have an idea on public transit that I usually have to jot done in a note but it would be useful to have a solution to edit code on the fly. I personally don't always use github/gitlab or other online repos, but tools using online repos suggestions are welcome.


  👤 TheCapeGreek Accepted Answer ✓
I'm more on the fence of "mobile UX sux so rather just don't".

But did want to note, the AR/VR glasses space seems to be progressing[0], so perhaps with the correct peripherals for typing it might be possible to code in VR in transit in the not-too-distant future.

[0]https://www.xreal.com/air2


👤 drbaba
In general, Vim on an iPhone (via iSH, a-Shell, or iVim) works surprisingly well. I thought the idea was ridiculous until I gave it a proper try (even though I was already a Vim user on “real” computers), since it doesn’t really leverage the touch interface for e.g. cursor movement and scrolling.

However, Vim’s design gives you maximum expressive power per key you press - and since pressing each key on an iOS keyboard is a bit inconvenient, this design philosophy ends up working really well on a soft keyboard. Moreover, most common actions can be done without special keys (i.e. arrow keys, ctrl/meta modifiers, etc.) which I usually find awkward to use on augmented mobile keyboards. With Vim, you can get quite far using just a standard iOS with an added Esc key (all of the apps I mentioned above adds an Esc key).

If you use Vim on desktop/laptop but haven’t tried it on iOS, I’d recommend giving it an hour of trial sometime, at least if you sometimes want to edit code on the go. (Personally, I rarely do that, but I like that I can.)


👤 Aachen
I code in Vim on desktop, so that also runs fine on my phone (I use an app called Linux Deploy, but probably Termux or similar are more native solutions for the same, or perhaps there's a specific Vim app also). SwiftKey lets you select a keyboard with lots of symbols on the keys, so making < or { or | is just one long press. It's still slow and cumbersome, but it's possible and I do it when on the move and there's a small script to write

Not sure how your remark of not using hosted git ties into a solution for coding on your phone. You mean using a web IDE? I guess that'd be possible also but then you need constant connectivity


👤 nicbou
I edit markdown on the go for quick website updates and even that is painful. I usually finish things up and commit once I get on a computer. The files are synced with Syncthing.

It's hard to move the cursor, hard to select text, hard to input special characters, hard to manipulate files, and so on.

Instead I use that time to annotate content with my Apple Pencil on my iPad. It feels like correcting paper documents, and keeps me more focused because I can't edit anything.


👤 psyklic
Was at Handmade Seattle a few weeks ago and saw a (still early beta) Android editor called MobileCode - https://play.google.com/store/apps/details?id=dev.mark.mobil...

Lets you download GitHub repos to work offline and has common coding actions in a quick tap menu.


👤 retrocryptid
I'll add another +1 for Termux on an android phone. I have a hub that lets me charge my phone and plug a real keyboard into my android device.

It (termux) is mildly annoying as you don't get to set your own username and you can't ssh into your phone (or maybe you can if you're on a rooted device.)

Also, there's no sixel support, so it's somewhat limited as a remote management platform.

But I've successfully scp'd remote files to local, then used emacs to modify the files and then scp them back. Git works fine, so you can clone, branch, commit and push if that's your workflow. Make and gcc all work fine, so you can compile other tools (prolog, scheme, node) if you need them.

Sbcl should work, but I ran into problems compiling I haven't yet resolved (not sure it isn't related to me monkeying around with local library links) so ymmv.

I know python is available via the package system, but I'm not a python person.

It IS definitely a terminal oriented experience. If you're looking for something like VSCode, this ain't it.


👤 DeepSeaTortoise
(Fdroid) Termux + helix editor + lsp and compiler of choice + customized termux keys for best dx

The experience was surprisingly decent. I'm quite new to coding and this was the most "batteries included and works out of the box" solution I could wrap my head around, didn't try to scam me into paying for a subpar experience and wasn't online.


👤 gabrielsroka
Replit has a mobile app.

Also, I wrote a simple web page where I can run JavaScript or a Python-like language I created called Pith.

https://github.com/gabrielsroka/gabrielsroka.github.io/blob/...


👤 082349872349872
It looks as if https://tryapl.org/ might have put some effort into being mobile-useful. (the terse symbology was once valuable at 110 baud, and could be again if one has to use an onscreen keyboard)


👤 dsq
Vim and tmux on the server, and juicessh with hacker's keyboard on the phone. It's still not easy, there's not much real estate. But for small edits it's adequate.

👤 mortallywounded
Maybe I'm old school, but there's something cathartic about a nice pen and a small notebook.

Even when I have a screen and keyboard nearby, it's often best to get my ideas out on paper. It just feels more "complete" in some way.

It's also a much better dumping ground for random ideas I want to get out before they distract me from real work. I can dump them on paper and forget about them for a while. I can't seem to do that with digital notes. The ideas still linger and distract me.


👤 cushpush
In theory all you need is a keyboard and a screen, the other hardware is whatever shape works, right? Coding "on the phone" sounds like a "veritable nightmare" if I'm using the stock screen and "keyboard" solution that is half the visible field. VSCode + SSH lets me code on the cloud box, whatever combination of unlocking/jailbreaking/hardware purchasing gets you that, is a solid way to go.

👤 night-rider
I can only code on phones/tablets/phablets with a small bluetooth keyboard. I have bad dexterity so I can't use the touchscreen keyboard very well, and no matter how much I convince myself I'll get better at using a touchscreen keyboard, I still end up fat fingering keys and making loads of typos and mistakes.

👤 jones1618
You didn't say what language(s) or if you needed an offline solution. Here are two online REPLs that I sometimes use on my phone when I have coding ideas on the train:

  1. https://www.online-python.com/ - Python IDE
  2. https://jsitor.com/ - JavaScript IDE

👤 syndicatedjelly
Write on a pen and paper, or tablet. If neither of those are available, type a quick note or record a voice memo

👤 spit2wind
Emacs Android native build

However, it's not clear to me how to access a compiler or interpretor other than the Emacs Lisp interpretor. Termux won't install for some reason on my phone.


👤 fragmede
I mean, what are you trying to write? On IOS, Pythonista is a full fledged environment for writing programs. I imagine there's similar on Android.

👤 trumbitta2
Gitpod is fine for that, if you have a big enough screen on your phone. An external keyboard would also help in any mobile scenario.

👤 flowzai
One of my top go-tos is Juno for iOS or Termux for Android

👤 up2isomorphism
Obviously K is the best language for this.

👤 Nextgrid
Carry a small laptop. Phone keyboards are atrocious enough for basic english text, let alone code.

👤 KomoD
Get a laptop

👤 sertbdfgbnfgsd
If you have an idea on public transit, how about pen and paper to write down the idea?

👤 hardkorebob
Pydroid3 with a bluetooth keyboard

👤 Mrirazak1
Nah I don’t think would ever be a good idea. To learn yes but not to actually code. Sorry.