In the last month, I was in several situations where I was bored to death and had only my Android phone for amusement (Samsung Galaxy S2, for those wondering). I have the itch to program or do something productive in these situations, but for the life of me, I can’t think of any such option and I usually end up playing a brain-numbing game instead.
This is a companion discussion topic for the original entry at http://amir.rachum.com/blog/2012/09/11/is-it-possible-to-be-productive-with-only-a-smartphone/
How do you define "being productive"?
If it's just to write code then you're going to have a hard time doing it on a phone.
There are many other things you can do on a smartphone. Jot down your ideas for what you want to code in a notes application and think on how you can improve it. Then when you get access to a computer, you are ready to start churning out code like Singapore's "vomitting" merlion.
If you really want to code, I suppose the only way is to type them out in your notes app and then copy them out for compiling later. You won't be able to debug or run it but at least you've got the majority of the work done and all you need is to fix it or fill in the missing pieces when you get a computer.
Or just get one of those thin and light MacBook Airs that last several hours on a single charge.
What about web-based IDEs such as Compilr or ShiftEdit?
You could always install ConnectBot, ssh onto a remote server and painstakingly write code in vi.