Archive | January 2012

Running External Commands

Version 1.9 of DroidEdit Pro allows you to run external commands through your SSH connection. These external commands will run on your server. With this new functionality you can do a number of cool things directly from DroidEdit:

  • Compile your code
  • Run your code
  • Convert LaTeX files to PDF
  • Apply a filter to your text

In this short video you can see some external commands in use:

  • Compile a C++ program – g++ ${file} -o ${name}
  • Run the compiled code – ./${name} ${number_1} ${number_2}
  • Capitalize a file – cat {$file} | tr [a-z] [A-Z]

As you can see, you can even pass parameters to the command. ${file}, ${name} and ${path} are reserved parameters that are replaced by the current file name, name without extension and path but you can create your own parameters that will be asked before execution.

Hope you enjoy this. Feel free to share your external commands in the comments and report any bugs.

By the way, version 1.9 also supports private keys protected with a passphrase.


Change Syntax Highlighter

Since version 1.8 you can select the syntax for the current document by long pressing in the editor pane. You can also set a syntax highlighter as default for a certain file extension.

Custom Themes

Don’t like DroidEdit’s built-in color themes? No problem. Since version 1.7, DroidEdit Pro users can create their own themes.

DroidEdit on ReadWriteWeb

DroidEdit got mentioned in ReadWriteWeb:

DroidEdit is a free source code editor for Android. It has Syntax Highlighting for the most popular coding languages and can open files from Dropbox or other file managers. Need to edit some code while away from your computer? DroidEdit is the app for you.

Text Wrap

Text wrap may seem like a trivial feature to implement. After all, it should only be a matter of breaking lines at the right places. However, DroidEdit uses an extended version of the EditText class that comes with the Android SDK to simplify most of the editing stuff (copy/cut/paste, selections, cursor and drawing text in general) and changing some of its internal behaviors isn’t easy at all.

I’ve been trying to get it working for some time now and I think I finally have a reasonable working solution with minimum compromises. So, since version 1.6 you can enable text wrapping in the preferences screen of DroidEdit. Keep in mind that this is the first version having this feature and that there is plenty of new code, so some things might not work as expected. Please be patient and report any bugs in this post.

Known outstanding issues:

  • One strange thing that you might notice is that DroidEdit will never break a word in half. This might seem odd when editing code, specially if you are using a small screen. The reason for this is, once again, the EditText class. This class was not meant to edit code and I still haven’t figured out how to workaround this problem.
  • DroidEdit may become very slow with larger files if text wrapping is active.