views:

1743

answers:

3

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

A: 

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

QuickRecipesOnSymbianOS
+1  A: 

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.
David Jacobson
+1  A: 

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"
JOM
What configuration files I need to change or API to call to do that?
wheleph
No config files, the normal APIs. It's just the way emulator works out-of-box: using "normal" IMEI request function call, you get real IMEI in real device, but zeros in emulator.I favour PyS60 nowadays for practical reasons, there you'd do: import sysinfosysinfo.imei()...but original question mentions C++:#include<plpvariant.h>TPlpVariantMachineId imei;PlpVariant::GetMachineIdL(imei);In your code running in emulator just replace the received IMEI with whatever and continue. Got to do it by yourself for each and every app. No generic once-for-all solution.
JOM
As far as I understand you suggest the following code:TPlpVariantMachineId imei;PlpVariant::GetMachineIdL(imei);imei.Copy(_L("123456789012345"));Please, add it to your answer to be formatted properly.
wheleph