Saturday, July 24, 2010

Working on a neat project

Usually I have the most fun with design and coding. Rarely do I go back and play with the UI in the sense of having fun with it.

It's just mostly checking if the UI is okay and if there are any bugs/misspellings.

Well I've just got a project that I'm having fun with the UI as well because the interface is a Text based User Interface (TUI, if you are so inclined to use that).

It's cool using JCurses. JCurses is a very loose JNI for the Curses environment, nCurses on Linux. Since it does use JNI that means that you do loose the cross platform compatibility, but JCurses comes with sources and Win32 and Linux x86 binary libraries.

I've been able to compile JCurses for Linux amd64, Mac OSX, and PPA systems. So you should be covered for systems that you may want to run this on.(Note: I don't have access to an ARM chip so I don't know if you can use JCurses there).

The setup at work is to provide a SSH session via RF scanner to our warehouse users, noting new there we've been serving TN-5250 sessions via wireless for the past fifteen years (longer than I've been there).

However, this is the first time that I've actually been calling EJBs from a text based interface. The principal is basically the same, call the remote endpoint from the Java code, present results bark to user.

The fun part is with a text based interface, you really have to concentrate on features and how you present them. A screen full of text is impossible to use effectively, and the more options you present at once the more cluttered the screen appears.

I've found that the best way to break up things is not present all the needed input at once, but instead to take an ask on need approach. So when the next step is to get an EAN or UCC128 code that's what you ask and only that and the options that might effect that.

Also, keyboard functions are limited to basically, TAB, ENTER, F1 through F4, the numbers 0 through 9, and BACKSPACE. Obviously there are no mouse functions.

All of this, limited input, limited screen size, and limited ways of getting the user's attention (Curses can only ring the system bell) really forces you to really think out the UI in a manner that end users usually can't help with.

That's not to say that I never think of the UI for GUIs, but usually we have a company layout and guideline on how our GUIs are created. You simply follow that, get end user feedback, and modify as needed without breaking something.

I'll have to post some examples of JCurses and EJBs soon.


Gregorio Bersales II said...

Hey, how did you import jcurses on your java? I tried adding the path of the jcurses.jar to my classpath but it seems importing it in my java code is not working.


Justin said...

@Gregorio Bersales II:

With the jcurses jar there are two parts. One is the JAR that you talked about the other is a native library that has all of the hooks required to get you up and running.

You either need to place that native library ina folder called lib that rests beside the JAR file like this:


Or you need to put it in the directory that your JVM looks at for system resources. That's the lib folder in the JDK or JRE folder tree on your system.