Lesson 2: Building a simple mobile application

To illustrate portal functionality, this lesson teaches you how to build a simple mobile application that displays content from the warehouse_inventory table in the SybStore database.

  1. To work with a table in the SybStore database, you must start the database and establish a connection to it from WorkSpace.

    1. In the WorkSpace Navigator, expand MySybStore_Tutorials/Setup/Database and double-click startMySybStore.bat to start the SybStore database.

    2. In the Enterprise Explorer view, right-click the MySybStore connection profile and select Connect from the context menu.

  2. In the WorkSpace main window, s elect File|New|Mobile Application from the main menu bar.

  3. When the New Mobile Application wizard opens, complete these options:

  4. Click Finish. The New Mobile Application Element dialog box opens.

  5. Add a SELECT statement to the mobile application. Select the Connection Profiles option and select MySybStore as the value.

  6. Below the SQL Query pane, verify that Select is the value in the Visual SQL field, then click the Visual SQL button. The Visual SQL Select wizard opens.

  7. In the Select Tables window, select warehouse_inventory and click Open. The wizard displays three main views:

  8. In the Table Layout pane, select (highlight) the item_desc column, then select the curr_qty column. These columns are added to Selection List bar and display in the Preview.

  9. Select Design|Execute from the menu bar to run the query. Look at the Results tab to view the output from the SELECT query.

  10. Click OK to save the statement. When you return to the New Mobile Application Element wizard, the SQL Query field is now populated.

    Because the data will be displayed on a mobile device, verify that the columns are short and named appropriately.

  11. In the SQL Query pane, change the SQL statement to the following text so that the description is a maximum of 30 characters and the column names are more appropriate.

    SELECT substring(warehouse_inventory.item_desc,1,30) "Item Description", warehouse_inventory.curr_qty "Curr Qty" FROM warehouse_inventory

  12. Click Validate. When you see a message that the SQL query validated successfully, click OK.

    NoteIf the SQL query does not validate successfully, repeat steps 11and 12, and verify that the information is entered correctly.

  13. Click Preview.

  14. Click Next.

  15. When the Rules dialog box of the wizard opens, select the Records Contain Labels option and click Finish. You return to the mobile application editor.

  16. Select File|Save from the WorkSpace main menu to save the mobile application.

  17. Select the Preview tab to see a preview of the new mobile application.

  18. Close the mobile application by clicking the “X” on the application’s title tab.