This is going to be short post on BlackBerry mobile development, specifically SalesLogix Mobile BlackBerry development. A current customer requirement called for the need of a multi-select pick list control. This control would allow the selection of 0,1 or many values from a pre-determined list. The stock pick list control provided in the platform does not support very rich scenarios like this so I was forced to create my own control. Its not that big of a deal, create a derived field control add a layout manager and host the controls you want to display. I have made good headway this weekend on the control with it generally working the way I expected until I decided to add the initial setting  of the selected items code. For this code we take the comma separated list of values and split it into each of the selected items, when finding a match, check that item as selected. So happily I wrote the code in eclipse and then moved it over to Sage Mobile Application Architect.  (I like and use eclipse for heavy java code development tasks). So when I compiled and deployed the client system I was quite surprised that I could not start the mobile application at all. There was no error, no visible indication that I had royally messed up, or that the customizations did not take. Nothing. So I went back to the code that I wrote and started to systematically comment/uncomment until i could find why the client was not starting up. Finally I hit pay-dirt and to my surprise the following line was causing the application to not start;

String[] values = selectedValues.Split(“,”);

What? I mean string splitting, it has to be there. Its such a basic function and eclipse tell me it exists through the dot prompt functionality. Digging into the BlackBerry API documentation it seems that this method really does not exist. Bah. So of course I roll my own custom split method and it works as expected.

Lesson: If the application will not start at all look at your customized code and ensure that you are not using some java API that is not supported on the mobile platform

Leave a Reply