Question

I'm also interested in other Symbian SDKs that allow to set their emulator's IMEI.

Was it helpful?

Solution

Emulator has hardcoded IMEI of '000000000000000'. Replace what with whatever you want to use and continue running your code.

Symbian C++:

    TPlpVariantMachineId imei;
    PlpVariant::GetMachineIdL(imei); 
    imei.Copy(_L("123456789012345"));

Python for S60 (PyS60):

    import sysinfo
    my_imei = sysinfo.imei()
    my_imei = u"123456789012345"

OTHER TIPS

My general approach to these kinds of things is do it in software.

  1. Put the IMEI fetching code into one globally-accessible function, and only use this function for IMEI fetching.
  2. #ifdef __WINS__ can be used in C++ code to selectively compile in the hard-coded IMEI you want to return in the emulator. In Java, you can probably tell you are in the emulator by other means (eg if the IMEI returned is a fixed weird value in the emulator), and act accordingly.
  3. You can go one step further and have a dynamic IMEI. Once you do that, you will find that testing your code with different IMEIs becomes much easier.

I have never actually tried that but here's my best guess:

The emulator doesn't have a proper telephony implementation unless:

  • you link it to an actual phone over infrared/usb/serial. In which case the emulator telephony component will need configuration to use AT commands to pilot the phone (even if the phone isn't a Symbian phone). This allows you to make phone calls, send and receive SMS/MMS but certainly not change the IMEI.

  • you use the SIMTSY module. This is a component that uses configuration files to simulate telephony events. It can pretend to send SMS/MMS, pretend you are receiving a phone call...none of that actually creates any kind of network traffic, you understand. I assume the IMEI is in the configuration file but I don't expect you can properly change it without restarting the emulator. I have never seen SIMTSY used outside of Symbian itself so I don't know whether it is available to third-party developer. It should be open-sourced with the rest of the operating system within the next 2 years, though.

There is also the possibility that the way the SDK itself was built disabled most of the telephony framework for the emulator, using build-time macro. You should check http://forum.nokia.com

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top