Can’t tear yourself away from programming even when you’re away from your PC? Do you have a phone/tablet running Android, ideally with a hardware keyboard? I meet these 2, or rather 3 conditions, so I installed the app AIDE (Android IDE) on my Sony Ericsson Xperia Mini Pro, and it made my dream come true of being able to code even when I don’t have a PC at hand.
Of course, on a phone, especially one with a 3″ screen, there are certain limitations. Paradoxically, it isn’t really the screen, because the font is set sensibly enough that I can see it perfectly even from a distance, while it doesn’t take up much space on the screen.
All in all, my Xperia fits 18 lines of code in landscape mode, which isn’t bad at all. The app only runs in full-screen mode, so you would get fewer lines only if you set a larger font, which I think would be unnecessary, see above.
The real limitation is typing speed on the keyboard, but that’s probably just my problem – I hope I don’t wreck the phone, which I bought second-hand – I’m talking about the keyboard now. It’s a very pleasant change in programming to switch between desktop C# and “Android” Java, and I hope it stays that way. It’s also nice because Java is a bit different from C# and it forces me to think differently instead of just sticking to the beaten track.
And since it’s on a phone and in that specific Android “language”, it’s even better. My Xperia has arrow keys in all directions, a Shift key, an “Alt” key that switches which character each key sends for processing, and a SYM key which in other apps lets you enter mainly smileys, but here it’s overridden and used to type curly braces, which can’t be entered any other way on the keyboard. All other characters, such as the basic math symbols, parentheses (), the semicolon, period and comma, can be typed normally from the keyboard, which speeds up the work.
So what did I actually program? Nothing could be simpler than just 2 buttons that display the current time when you click the one just pressed.

The app in action:
Full source code:
package com.mycompany.myapp;
import android.app.*;
import android.os.*;
import android.view.*;
import android.widget.*;
import android.content.*;
import java.util.Date;
import android.util.*;
import android.view.ViewGroup.*;
public class MainActivity extends Activity implements View.OnClickListener
{
LinearLayout layout;
Context c;
Button button1;
Button button2;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
c = getApplicationContext();
//AttributeSet is an abstract class, it cannot be instantiated in any way
//-LinearLayout.LayoutParams cannot be created either because it has no constructor defined
button1 = new Button(c);
updateTime(button1);
button1.setOnClickListener(this);
button2 = new Button(c);
updateTime(button2);
button2.setOnClickListener(this);
layout = new LinearLayout(c);
layout.addView(button1, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
layout.addView(button2, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
setContentView(layout);
}
public void onClick(View view)
{
Button button = (Button)view;
updateTime(button);
}
void updateTime(Button button)
{
button.setText(new Date().toString());
}
}