Mobiiliohjelmointi/Mobile
programming
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.***
*** hint. The students can look at the structure of the ‘about’
query dialog box for guidance.