Symbian
Symbian OS Library

FAQ-1122 How can my app selectively install or execute different code depending which phone it is running on?

[Index][spacer] [Previous] [Next]



 

Classification: General Category: Installation
Created: 09/01/2004 Modified: 11/01/2004
Number: FAQ-1122
Platform: Not Applicable

Question:
My app is capable of installing onto several different Symbian OS phones but uses phone-specific functionality. How can I get my sis file to install different file versions onto different phones? Alternatively how can my app find out at run time which kind of phone it is running on?

Answer:
You need to get the phone's Machine ID. Note that this is not to be confused with the Product ID which is used to determine whether the app should be installed at all.

    In C++ code you can obtain the Machine ID easily at run time then test against known options with a switch statement, as follows:

    #include
    TInt uid;
    HAL::Get(HAL::EMachineUid, uid);
    switch(uid)

      {case 0x101F466A: // Nokia 3650
        ...
        break;
        ...
        }
        It is also possible to distinguish phones by comparing the HAL::EModel number, but this is less reliable so not recommended.

        An article by Eric Giguere shows how you can modify your pkg file selectively to install different file versions on different phones, depending on the Machine ID.

        Note that FAQ-1114 illustrates a similar approach using instead a combination of Product IDs and DeviceFamilyRev numbers.

        The following is a list of some of the Machine IDs you might want to test against:

        Nokia 3650/3660 0x101F466A
        Nokia 7650 0x101F4FC3
        Nokia N-Gage™ 0x101F8C19
        Nokia N-Gage™ QD 0x101FB2B1
        Nokia 6260 0x101FB3F4
        Nokia 6600 0x101FB3DD
        Nokia 6620 0x101F3EE3
        Nokia 6630 0x101FBB55
        Nokia 7610 0x101FB3F3
        Nokia 9210/9290 0x10005E33
        Sendo-X 0x10005F60
        Siemens SX1 0x101F9071
        Sony Ericsson P800 0x101F408B
        Sony Ericsson P900 0x101FB2AE
        Sony Ericsson P910 0x10200AC6
        PC-based emulator 0x10005F62
        Forum Nokia also maintain a list of Machine IDs for phones based on Nokia UIs on their web site under the title "Series 60 Platform Identification Code".