Emulator vs Device Functionality
The emulator behaves very similarly to a real device. The entire Symbian OS code is compiled for both the target device and emulator build targets using the same source code – with some required deviations (e.g. if you have any assembly language functions, you must obviously provide both x86 and ARM versions). So, not only can the emulator be used for GUI applications, but you can use it to develop system-level code. Will everything that works on the smartphone, also work on the emulator? Not everything – no emulator is that good. But for the most part it is equivalent.
Main differences between the Emulator and the Device
The most obvious difference is that the underlying hardware of the emulator is different from that of the device. The PC processor instruction sets are different – the PC uses x86 and the device uses ARM – but this is easily hidden via the C/C++ language. More importantly, however, the peripheral hardware is different, so you cannot use the same device driver and hardware abstraction layer code on both. On the emulator, hardware accesses are mapped to appropriate Windows API calls.
• Pixels and fonts
Although in most cases, the display of a GUI application will be very similar on the emulator and on the device, there are likely to be slight differences in pixel sizing between the two. For instance, it is possible for text to be truncated on the emulator and not on the real device, or vice versa. This can be an issue, if you rely on the emulator alone to perform language translation testing, for example.
• Static variables in DLLs
Static variables are allowed in the emulator, but not in the real device. Be careful of this if you are doing most of your development on the emulator – you’ll want to avoid having massive global variable search and destroy missions late in the project.
• Single process versus multiple processes
The emulator runs as a single process, while the device supports the multiprocessing capabilities of Symbian OS. In Symbian OS v8 and above, this difference is hidden and the APIs that start and control processes are emulated. However, in Symbian OS versions before that, you need to have special logic (enclosed by #ifdef __WINS__) that uses threads to emulate the processes. Thankfully, there is not much code needed to implement this.