Mobiiliohjelmointi/Mobile programming

 

  1. Exercise 4 –Application architecture & GUI

In this exercise, you will elarn how to build a DLL and link it to your program. You will also see how to build and add a simple ui component to your application.


Part 1 - DLL

1.    Create a new symbian GUI-project. Use template: S60 3.x Hello world GUI application.  (or
2.x Hello world GUI application depending which SDK you want to use.)
2.    Create a new symbian DLL-project. Use template: Basic dynamically linked library (DLL)
3.    Add a new function to DLL interface ( e.g  TDes& GetText(); ). Remember to use IMPORT_C and EXPORT_C statements.

4.    Select DLL project's mmp-file and select options. From linker options choose Export Unfrozen. After this the project adds unfrozen functions to the dll interface, when building the DLL. 

       Project freezing should be done only when the DLL interface does not change anymore.        
5.    Add .lib-file to the GUI-project [Folder group ->*.mmp file -> Libraries->Add. You will see a text box, this is where you type your lib name.]
6.    Modify  ***AppUI.cpp and HandleCommandL function (GUI-project) so that the text shown in the dialog box is returned from DLL function GetText.


Part 2 Application architecture

1.
    Examine the GUI-project architecture. It is based on the MVC Design pattern where

            Model = CDocument

            Controller = MyAppui

            View = myView.

The class MyApp is called first at setup. It instantiates the class CDocument. CDocument creates the class MYAppUi. MyAppUI creates the class MyVIew. MyAppUi can support multiple views.

 

2.                   Add a ‘Query Dialog GUI’. The query box should hold some basic text. E.g. hello.***

    1. Basic steps  are to create the resource description in the *.rss file
    2. Create a new command code to activate the dialog box in *.hrh
    3. Change the menu bar in *.rss to include an extra menu item for the dialog box. Asign it to the new command code.
    4. In Myappui, add an extra case statement in HandelCommandL to catch the command code. Here is where you should create and call the queryDialog box.

 

*** hint. The students can look at the structure of the ‘about’ query dialog box for guidance.