The Mobile Experiment – Blackberry GUI Prototype – Part I

What!? Prototype!? Really!? That’s you after reading the title of this post. Yes, you’re right, I’m pretty slow, but don’t blame me, I’ve told you I was newbe on this.

Well, I’ve started writing the prototype, which is basically the GUI with minimal user interaction. This is actually very useful, since we can feel how it works, or if any change is needed. That was exactly what happened. First, I thought to use the Search Field for the project, but after some attempts I found the AutoCompleteField much better for my needs. It is used associated with BasicFilteredList class which provides the data set to fill in the list.

This BasicFielterdList class seems powerful. It has two methods, one to add a dataset based on a string array, or to add a data source (data from the phone Contact List, for example). In my prototype, I have a hard-coded array of strings, but I’m thinking to read the list from a file in the final application.

The prototype code is like this:

filterList = new BasicFilteredList();
String[] projects = { "Paint the house", "Paint the kitchen",
"Paint the bedroom","Fix the tap","Wash the car"};

filterList.addDataSet(1, projects, "projects", BasicFilteredList.COMPARISON_IGNORE_CASE);
projectListField = new AutoCompleteField(filterList, AutoCompleteField.LIST_DROPDOWN);

The lines 1-3 creates the BasicFilteredList instance and the array of strings (remember, this array is only for this GUI prototype). At line 5 you can see where the array of strings is added to the BasicFilteredList as dataset. The last line in this code snapshot is where I’ve created the UI element AutoCompleteField, receiving the filterList object as parameter.

Visually, the result is pretty cool. The first screenshot shows the AutoCompleteField in “idle” state, waiting for the user input.

Here, as you can see, it starts showing a list with only the items that match with what the user is typing.

And here, the final look, when the text in completed, based on something from the list, or a completely different project title in case it is a new one.

The final objective is that, if the user types something not from the list, that new string will be available in the list on a next time.

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: