Tuesday 17 January 2012

Programming on an Android device

A surprisingly rare subject to find on the Internet. The ability to code on your Android and be somewhat effective.

The main problem with programming on one of these platforms is the lack of compiler/runtime environment for the language you are interested in. My interests for example cover Java, C and a wiff of TCL. However trying to program any of these on the Android is a non starter from a native compilation point of view. At least at this present time of writing.

So what are the options? I recently discovered an app called Touchqode. A text editor aimed at coding, it supports various language syntax. This solves one of the problems with coding on a smart phone. The development environment.


The other part is how to compile the code. Two I thought of were:

  • Ideone.com
  • DropBox + Compile/Run/Test Daemon

Ideone.com


Ideaone.com is an online compilation/runtime environment. It allows you to paste code in and see the results of the code executing. It isn't really intended to run full projects, at least from what I can see. (I suspect logging in will provide you with a few more features).

As a starting point, this might be a valid option.

DropBox + Compile/Run/Test Daemon


The other option is to make use of the fact that DropBox is awesome. If you load and edit a file on your smart phone, that change will be transmitted to all other computers that run DropBox.

If you have a computer you leave on, say your work PC, then you could easily setup a daemon which watches for the changes in files in a certain folder, and executes a specific command storing the output in another file.

Then you would simply need to wait and then reopen the 'results' file to see what happened. Make some more changes, resave, and wait for the recompile.

If you wanted to go one stage further, you could setup a command/control signalling mechanism either via DropBox file changes, or via a distributed network like Twitter to provide signalling that the compile is complete.

Conclusion


The obvious point to make here is, you are not going to write a complete application in this fashion. An application with user interface is not a sensible objective, however, something that can produce meaningful output on the command line still covers a wide range of applications.

The other main usage that comes to mind is unit testing, which is an important task and can output entirely to the command line.

No comments:

Post a Comment