August 07, 2003

In brief: Eclipse J2ME development with P800

http://weblog.cemper.com/a/200308/07-eclipse-j2me-wireless-development-with-sony-ericsson-p800.php
Posted by osfameron at 01:45 PM | Comments (0) | TrackBack

August 05, 2003

In brief: new Symbian developer writeup (Dr Diego)

Dr Diego's excellent Symbian adventure. Yes, learning about Symbian and Java can be quite confusing!
Posted by osfameron at 12:01 PM | Comments (0) | TrackBack

June 12, 2003

IntelliJ: 7 days to go

I now have use of the IntelliJ trial for another 7 days.
Sadly, due to other time-commitments, this doesn't mean that I've had the opportunity to actually use IntelliJ for the elapsed 23 days of the trial. But I've been impressed enough to be a little sad that it finishes so soon. Some thoughts:

Yes, it does make sense to move from an editor that you love to an IDE. You do lose some expressive power of the keyboard mappings of the editor (and no, I've not tried the vim plugins available) but you gain:

  • Syntax checking: I'm relatively new to Java, and I still make a lot of mistakes. With Vim, I got used to finishing a piece of work, running my ant script and mentally placing a guess on how many compilation errors I'd have caused. With unobtrusive highlighting and hints, I very rarely have to go back and debug for them.
  • Refactoring: One of those things that you never realize you need till you need it. Of course you can rename a method by grepping through all buffers and changing it manually each time. But the built-in refactorings are quick, syntax aware, can check documentation, and have a nice persistent results window so that you can go through any required manual changes without losing your place.
  • Autocomplete: I love Vim's autocomplete - it's quick and powerful. But Vim doesn't know Java, and IntelliJ (which does) can really add value by only autocompleting with something that's sensible in the context.
  • Intention actions: I love that in class Foo you can write a non-existent method: bar.doBaz(this); and with a couple of clicks be transported to class Bar with a function already fleshed out for you
    public void doBaz(Foo f) {
    	return null;
    }
    Similarly, it's easy to flesh out getters and setters, interface or abstract methods that need to be filled in, and the like.
  • Automatic imports: No more scouring the API for which package an imported class is in.
  • Editor niceties: I love the way that typing a quote (") automatically generates the closing quote too (""). This feature could have been intrusive but isn't: if you type the closing quote anyway, IDEA just hops your caret after both quotes rather than ending up with 3 ("""). Same with parenthesis.
  • Todo, error, and warning indicators: To the right-hand side of the edit window appear coloured bars indicating the relative position in your file of various things: Yellow for Warnings (like unused fields), Red for compile errors, Blue for TODO items. Clicking on these bars takes you to the relevant line. I found this interface a bit odd at first, but it's very useful.
  • Project view: For ease of hopping between files. I know that Vim can hop buffers using the :bu firstfewcharactersofname which is nice, but actually just choosing the class from a constantly visible window is great. I was surprised how much I liked doing this.
I have only a few concerns with it:
  • The garbage collection seems a bit slow, over 10 seconds when the whole application just hangs. As there's no warning this is a bit bizarre (but you can see from the memory usage bar at the bottom-right before and after what it's been doing). Considering the productivity gain elsewhere, I can live with it, but it is a little annoying.
  • The transparent windows: (no actually I think you can turn them off, in fact the user interface is very nice and uncluttered).
  • I sometimes found the 'go back' function (Ctrl-Alt-Left) would get confused with 'go to previous tab' (Alt-Left).
Oh, and the price. Software development is not my main job, and I have to think really hard about whether I can afford this. (But I will think hard).
Next... Eclipse.
Posted by osfameron at 02:51 PM | Comments (0) | TrackBack

May 22, 2003

IntelliJ IDEA - first impressions

As I've mentioned on javajunkies.org, I've been looking into IDEs: I've never learned to use one (actually, this is a lie: I've programmed VBA within Microsoft Word and Excel's IDE based on Visual Studio, and I have to admit I think it's quite good, though unstable). OK, I've never learned to use a modern, proper IDE with the languages I currently code in (Java and Perl), because I've found that Vim does the job till now. And it's not just out of some snobbish thought that IDEs get in the way of real macho coding, but also out of laziness (an IDE is a large, complex application that you have to learn how to use.)

But I'd read various articles linked to from the IDEA website, including one from a dedicated Vim user who now uses IDEA for Java development. It sounded excellent - uncluttered interface, with genuinely powerful features that are easy to use and which don't get in the way. So I've downloaded it and got the 30-day evaluation license. I've only had a quick play with it so far but I'm quite impressed.

I like how it really understands the Java syntax. You you can do Control-Q to get a 'quick Javadoc' on the relevant class or method. It does automatic analysis of imports, for example if you refer to Vector it will suggest to add the corresponding import java.util.Vector for you (and if you remove all references to it, it'll suggest to remove the import!) If you forget to cast an object to the right class it will give various options for dealing with that.

You might think that such cleverness would be incredibly irritating, but it's handled very well: code errors are underlined like speling erorrs in Word, and the suggestions for code changes are given by small light-bulb icons embedded in the code which you can ignore until you want to. Yesterday, I copied the DFS and Node code from my recent entry into a class file called DFS.java. IDEA noticed that the class Node wasn't in a file called Node.java and suggested in this way that it could move the code into that file. Very nice! When I created and later deleted some test classes, IDEA scanned the code to check that I hadn't referenced it from anywhere else (admittedly it found false positives, I'd named my class Test which it confused with junit's class of the same name).

I'm a little worried that I'll like IDEA too much. I guess that it's not expensive for the power and ease of use that it offers, but it's a little costly as I'd be paying for it myself. When the 30 days run out, I'm planning to try out Metrowerks CodeWarrior - this is more or less the standard IDE for Wireless development, supported by Sony Ericsson and Nokia for example. Also, Metrowerks with Motocoder were/are offering a free license for filling in the Motocoder survey, so it's worth checking out. After this, I'll try Eclipse (update which, as Prashant mentions but I forgot to, is reputed to be very like IDEA, only free.) Convincing reasons to try other IDEs are gratefully received, but of course the time spent evaluating productivity tools is time spent not being productive, so it'll be a hard sell!

Posted by osfameron at 12:40 PM | Comments (7) | TrackBack

May 16, 2003

J2ME Floating Point Libraries

Michael Zemljanukha (the author of the MicroMath library and the MicroCalc spreadsheet) posted a number of helpful comments, including some pointers to floating point libraries
  • http://sourceforge.net/projects/jmfp
  • http://henson.newmail.ru/j2me/Float.htm
Alan Eliasen previously mentioned that he uses
  • http://www2.hursley.ibm.com/decimalj/
for Frink.
Posted by osfameron at 09:44 PM | Comments (0) | TrackBack

April 27, 2003

Toolset

The project is "open source", or rather will be, when I release some source-code... So, to help would-be contributors, here is the description of the toolset that I have been using and considering so far.

Gilgamesh will be coded in Java, specifically in J2ME as a 'MIDlet suite'. I'm on a steep learning curve with Wireless Java myself, so if these terms are unfamiliar, don't worry: I've given some references in the table below, and I'll be blogging links to useful Java and Symbian documentation now and then.

Why Java? C++ is another viable alternative for the platform (Symbian 7.0 with UIQ, e.g. Sony Ericsson P800), and might be considered more reasonable for the application (A complex spreadsheet could get quite computationally intense).
My personal reasons were "I don't know C++", and "I like Java, and I want to learn more of it". If you really want to know, I'd have rather coded in Perl, but that's not supported on the P800...

Tool Version Description Download Additional info
Java 2 SDK 1.4.1 The Java compiler, tools, and API documentation. Vital of course java.sun.com/
(You will want to download the documentation too)
Lots of info at java.sun.com" including various tutorials

Recommended books: O'Reilly's Java in a Nutshell. (Not a tutorial: there are plenty of good ones about, but don't even think about the awful Chris Wright 'Teach Yourself Java')
In fact O'Reilly has a good Java series
And Sun have a good booklist, among which I've read and can recommend Effective Java (definitiely not a tutorial though.)

Java 2 Micro Edition Wireless Toolkit 1.0.3 Contains the subsets of Java language and API specified by J2ME (Micro Edition). Includes a compiler called ktoolbar which makes sure that your code sticks to that set. It also has emulators to show you what the application will (probably) look like running on a phone or PDA. java.sun.com/products Lots of info at wireless.java.sun.com
I've bought Jonathan Allin's Wireless Java for Symbian Devices and the Java series Programming Wireless Devices with the Java 2 Platform, Micro Edition which had good reviews. Both seem useful but I'm not yet at the stage of having used them a great deal.
UIQ SDK 1 Development Kit for the Symbian 7.0 based UIQ User Interface. This is a massive download (which I haven't yet made as I'm on a dialup connection, and I'm hoping to blag a CD at the Exposium... http://www.symbian.com/developer/
http://www.ericsson.com/mobilityworld/ (you need to register the Ericsson Mobility World developer programme: this is free.)
Lots of information from Symbian, Sony Ericsson mobility world, UIQ.
It's worth joining the developer programmes so that you can read their white papers and download tools.
Ant 1.5.3 Ant is an automated build tool, similar to make. It's Java's de facto project build tool, and very easy to use. A single command can:
  • Compile just the source files that have changed
  • Run the regression-test suite (see junit below) to make sure that the project still works ;->
  • Update the javadoc documentation
  • Create .jar distributions of the project
  • Archive
  • Send e-mail notifications about the build
ant.apache.org The Ant documentation is quite good. Worth reading the article Ant in Anger (also bundled with the download). Apparently Erik Hatcher and Steve Loughran's Java Development with Ant is worth reading, but I've not bought it yet.
junit 3.8.1 junit is a unit-testing framework, which is now pretty much standard with Java. It makes it easy to write regression tests which is A Good Thing. Project Gilgamesh will require unit tests to exist for all classes. www.junit.org junit comes with some excellent documentation.
The Ant book site has a freely available chapter on using Ant with junit.
Oreilly's Java Extreme Programming Cookbook has a free chapter on junit available for download.
12 reasons to write unit tests is a nice introduction to the benefits of unit testing.
javadoc n/a javadoc is a standard tool with the Java SDK. All classes submitted to Project Gilgamesh must be well documented (for the appropriate definition of 'well'. More details in due course). n/a javadoc -help
The Java SDK has pages of information about Javadoc under "Tool Docs" - "Javadoc Tool Page" and especially under "Javadoc Tool Reference Page (~your platform~)".
CVS 1.11.5 (client) cvs (Concurrent Versioning System) is a source control system. This means that one or more developers can look at the same Java source and make changes to any part safely (because changes can be tracked, rolled back, etc.)

Source Control, like automated testing, is A Good Thing.

So far, Gilgamesh is not available on a CVS server. This should be rectified over the next few weeks (but I could do with some help setting it up.)

www.cvshome.org cvshome has plenty of documents: I'm have to admit that I find the documentation very confusing by the documentation: the concepts are fine, but it takes a leap to understand what's going on. So hand-holding on CVS for me and other CVS newbiew would be really appreciated... This introduction seems about as straight-forward as I can find. The manual is complete but opaque for the beginner.
Java Editor / IDE n/a I'm using gvim with ctags to edit my Java source files. But this isn't obligatory. I'm interested in learning more about Eclipse (free) and Intellij IDEA (not free). www.vim.org
ctags.sourceforge.net
Posted by osfameron at 12:26 AM | Comments (3) | TrackBack