Chapter 4. Building Search Functionality

It is important to understand that most mobile device users are busy people—they are likely to be talking to a customer or conversing on the phone while they use your application. The last thing they want is to spend too much time interfacing with the application rather than getting at the information they need. A well-designed search feature attempts to reduce, as much as possible, the number of keystrokes (or stylus taps) required to get to the desired data.

In this chapter, we take a look at the two most common types of searches—parameterized search and full-text search. Parameterized search is specific—it allows you to perform a search on a combination of specific data fields (such as the account name or account ID) and is usually quite precise. Full-text search is more general—it searches for a phrase or keyword within a body of text, such as file content.

It is relatively easy to build parameterized search functionality on the mobile platform. However, full-text search on the mobile device has remained a largely neglected area. On the desktop, developers had the convenience of relying on the database for full-text search support. In the mobile environment, both the SQL Server CE and Oracle Lite databases do not support this functionality, leaving the developer little choice but to resort to workarounds. As a result, most mobile developers choose to either omit full-text search functionality entirely, use a third-party search engine, or simply fall back to the thin-client model (and leave full-text search support to the full SQL Server database on the server).

In this chapter, you will attempt to build your own full-text search functionality with what is readily available in SQL Server CE and Oracle Lite. Before that, let's take a look at an overview of what you are going to build.

A brief walk-through of parameterized search

You will be adding two new forms to the main menu in this chapter—one for full-text search and another for parameterized search.

A brief walk-through of parameterized search

Double-clicking the Parameter Search icon produces the following screen. The parameterized search form you are going to build will support the following features:

  • The user will be able to search for an account using a combination of any of the fields in this form.
  • The search form will also allow the user to search across leads, opportunities, and customers.
  • The search form will allow the user to perform partial searches on the First name and Last name fields.
A brief walk-through of parameterized search

After clicking Search, the application will build a search query from the parameters specified in this window and use it to search against the database. The search results returned are then displayed in the following window:

A brief walk-through of parameterized search

You will reuse the paging control you've created in the previous chapter to provide paging functionality for the search results listing. Take note that this listing also has an additional column (Type) on the right to denote the type of the account. The end user can choose to sort the search results by name, date created, or type of the account.

The user can also choose to launch into the details screen for a selected account from this window using the Accounts | Edit selected item menu item on the menu bar. The Accounts menu will also provide an option for users to delete a selected item.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.229.113