Installing an MTM

This section explains how to install MTMs during build time to include them in ROM and how to install MTMs at run time on to a target phone (not in ROM).

Build time

To install an MTM during build time, complete the following steps:

  1. Build the MTM DLLs to a \sys\bin directory on any drive. For example, c:\sys\bin.

  2. Build the MTM resource file to resource\messaging\mtm.

    Note: You can do this manually or use the mmp file syntax to export it to the

    \resource\messaging\mtm directory automatically at build time.

Example

// mtm.mmp

/**
@file

@SYMPurpose mtm.dll
*/

TARGET        mtm.dll
TARGETTYPE    dll
TARGETPATH    sys/bin

CAPABILITY    ReadDeviceData WriteDevicedata 
UID        0x1000008d 0x10204286
VENDORID    0x70000001

SOURCEPATH    ../src

USERINCLUDE     ../inc
SYSTEMINCLUDE    /epoc32/include 

LIBRARY        euser.lib 
LIBRARY        msgs.lib 
LIBRARY        bafl.lib 
LIBRARY        efsrv.lib 

SOURCEPATH    .
start resource mtm.rss
TARGET        mtm.rsc
TARGETPATH  resource/messaging/mtm
end

Run time

After creating a group of MTMs, you have to write an MTM installation application to install and register the MTMs with the Message Server using the MTM resource file. A program to do this would typically be run at the end of installation.

Procedure

To install an MTM at run time on to a target phone, complete the following steps:

  1. Create a session with the Message Server using the CMsvSession class.

  2. Call CMsvSession::InstallMtmGroup() to install a new group of MTMs.

    Result: The CMsvSession::InstallMtmGroup() function notifies the Message Server about the availability of a new MTM. When this is done, all running client processes are also notified about the availability of a new MTM.

    // Creating a Message Server session
    CDummyObserver ob;
    iSession=CMsvSession::OpenSyncL(ob);
    CleanupStack::PushL(iSession);
    //Install an MTM using a resource file
    iSession->InstallMtmGroup(ResourceFileName);

To remove an MTM, call the CMsvSession::DeInstallMtmGroup() function.

Result: The CMsvSession::DeInstallMtmGroup() function dynamically notifies the running client processes about the non-availability of the MTM.

Note: The

InstallMtmGroup() and DeInstallMtmGroup() functions must be used only by an MTM installation application.