RIM has often made their BlackBerry sample code too complicated, and their Unified Search Demo is another such case. Implementing universal search on BlackBerry is complicated enough, and having a demo that doesn’t bring out the basics doesn’t help as much as it should. Furthermore in this case the demo is actually wrong, with two distinct issues causing the demo application to not work.
The default demo includes unnecessary GUI components, a few classes for importing data from files, and optimization tricks that obfuscate the fundamentals of the code. In response I have simplified the demo to an extreme. In the simplified demo the full GUI is removed, and even good ideas like checking for nulls, and catching exceptions is done away with. Fundamentally it highlights the process of adding Universal Search to your BlackBerry application, and does absolutely nothing else. Download the simplified source code from the link below.