/**************************************************************************** ** ** This file is part of the documentation of the Qt Toolkit. ** ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Nokia Corporation (info@qt.nokia.com) ** ** ** GNU Free Documentation License ** ** Alternatively, this file may be used under the terms of the GNU Free ** Documentation License version 1.3 as published by the Free Software ** Foundation and appearing in the file included in the packaging of this ** file. ** ** If you have questions regarding the use of this file, please contact ** Nokia at info@qt.nokia.com. ** ****************************************************************************/ // ********************************************************************** // NOTE: the sections are not ordered by their logical order to avoid // reshuffling the file each time the index order changes (i.e., often). // Run the fixnavi.pl script to adjust the links to the index order. // ********************************************************************** // VERSION UPDATE /*! \contentspage{index.html}{Simulator} \page index.html \nextpage simulator-description.html \title Qt Simulator Manual \section1 Version 1.2.0 With Qt Simulator, you can test Qt applications that are intended for mobile devices in an environment similar to that of the device. You can change the information that the device has about its configuration and environment. Qt Simulator does not support any device specific APIs by design. Therefore, applications that run well on Qt Simulator also run on any device that hosts the Qt and Qt Mobility libraries. However, this means that you cannot use Qt Simulator to test applications that use device specific libraries, such as Symbian C++ APIs. \image qt-simulator.png "Qt Simulator" \note Please report bugs and suggestions to the \l{http://bugreports.qt.nokia.com}{JIRA task tracker}. \list \o \l{Introducing Qt Simulator} \o \l{Starting Qt Simulator} \o \l{Quick Tour} \o \l{Checking Application Layout} \o \l{Interacting with Applications} \o \l{Simulating Device Use} \o \l{Simulating Storage Devices} \o \l{Simulating Networking} \o \l{Simulating Location} \o \l{Importing Contacts} \o \l{Simulating Messaging} \o \l{Simulating Sensors} \o \l{Importing Calendar Events} \o \l{Simulating Feedback} \o \l{Accessing Document Gallery} \o \l{Simulating Camera} \o \l{Simulating Near Field Communication} \o \l{Simulating Touch} \o \l{Scripting} \o \l{Adding New Device Models} \o \l{Declaring Qt Mobility APIs} \o \l{Using Bearer Management} \o \l{Testing Applications Using the Qt Mobility Service Framework} \o \l{Known Issues} \endlist */ /*! \contentspage index.html \previouspage simulator-starting.html \page simulator-quick-tour.html \nextpage simulator-views.html \title Quick Tour This section describes the Qt Simulator interface. \image qt-simulator-quick-tour.png "Qt Simulator Control dialog" Qt Simulator displays a device with the application open on the screen. To interact with the application, use the mouse and keyboard. To move the device window, drag the device frame. The \gui{Qt Simulator Control} dialog provides the following controls: \list \o \gui {Menu} - Open Qt Simulator views. \o \gui{Quick access buttons} - Check how the application handles changes in device state, such as battery level, network mode, signal strength, and power state. Run your favorite scripts. \o \gui{Views} - Adjust the properties of the simulated device, manage applications running on Qt Simulator, and see how the application looks on different devices. \endlist To filter views, enter a setting name into the search field. \image qt-simulator-search-advanced.png "Search field and Advanced settings button" Click the \inlineimage qt-simulator-advanced-button.png "Advanced button" button on the title bar of a view to show advanced and rarely used settings. */ /*! \contentspage index.html \previouspage simulator-description.html \page simulator-starting.html \nextpage simulator-quick-tour.html \title Starting Qt Simulator You can start Qt Simulator directly from Qt Creator to quickly test and debug applications: \list 1 \o In Qt Creator, select \gui {File > Open File or Project} to open a project. \o Click the \gui{Project} button and select the project: \image qt-creator-project-button.png "Project button" The button shows the name of your project and the currently active build configuration. \note If \gui Simulator is not listed as a target, select \gui Projects to and add it as a build target for the project. \o Click \inlineimage qtcreator-run.png to build and run the application. \endlist */ /*! \contentspage index.html \previouspage simulator-application.html \page simulator-generic.html \nextpage simulator-drives.html \title Simulating Device Use \image qt-simulator-generic-settings.png "Generic settings" You can use Qt Simulator to test applications that use the \l{http://doc.qt.nokia.com/qtmobility/systeminfo.html}{System Info API} to access general information from the mobile device. Mobile devices have been designed for use when mobile. Keep the characteristics of mobile devices in mind when you create applications for them. Use Qt Simulator to simulate the behavior of applications on different device models in different conditions: \list \o \l{Running Out of Battery Power} \o \l{Using Silent and Offline Profiles} \o \l{Changing Device Language} \o \l{Supporting Device Features} \o \l{Accessing Services} \o \l{Handling User Input} \o \l{Identifying Devices} \o \l{Using Colors} \omit \o \l{Turning off Screen Saver} \endomit \endlist \section1 Running Out of Battery Power Mobile devices are not constantly connected to a power outlet, but run on battery power. Optimize power consumption to keep the total consumption at an acceptable level and to prevent users from running out of battery power. In addition, make sure that applications run successfully in low-memory condition or display a clear and informative error message. You can write a script that decreases the battery level setting, to check how applications behave when the device runs out of power. You can load an example script that decreases the value for battery level, \tt{scripts/examples/runOutOfBattery.qs}. For more information on loading scripts, see \l{Scripting}. You can also check how applications behave, when the mobile device is connected to a power outlet or it is charging. Change the \gui{Battery level} and \gui{Power state} settings in the \gui{Generic} view. \section1 Using Silent and Offline Profiles Profiles allow users to adjust and customize ringing tones, alert tones, and other mobile device tones for different events, environments, or caller groups. Users can change the active profile on their devices. The \gui{Offiline} profile (flight mode) prevents mobile devices from accidentally switching on, sending, or receiving messages, or using WLAN, Bluetooth, GPS, or FM radio. In addition, it closes any Internet connection that may be in operation when users select the profile. Test applications with different profiles to make sure that: \list \o Application sounds do not override the currently selected profile. Sounds should not play in the \gui{Silent} profile, unless the application is intended for audio playback. \o Applications work correctly in the \gui{Offline} profile, with the phone capabilities and network connections disabled. \endlist In the \gui {Generic} view, \gui{Profile} field, select profiles to test the application with a particular profile. \section1 Changing Device Language Implement predefined texts in the application UI using logical names instead of hard-coding them to the application. This enables localization by changing the language packet (LOC file) that is used. After translation, UI texts in different languages may take up more space than the original text. To prepare for text expansion, avoid using long and difficult UI text. Do not truncate the predefined UI texts even if the components may do it automatically. This makes it difficult to understand the texts and creates a feeling of unfinished software. You can fine-tune UI text strings to different display sizes by producing separate text strings for the small and large displays (orientation, aspect ratio, physical size). This avoids the problem of having abbreviated text strings when there is plenty of display space available. When users change the language settings on the mobile device, the localized version should be started automatically. Click the \gui{Advanced Settings} button to display the language settings in the \gui{Generic} view: \list \o \gui{Language} displays the current system language as a two-letter ISO 639-1 language code. For example, EN. \o \gui{Country code} displays the current system country code as a two-letter ISO 3166-1 country code. \o \gui{Available languages} displays available Qt language translations as two-letter ISO 639-1 language codes. If translations cannot be found, it displays the current system language. \endlist Change the \gui{Language} and \gui{Country code} settings to test that the localized versions of your application start correctly and look and function as they should. Click \gui{Show} next to \gui{Available languages}, and then click \gui Add to add new language codes. Use the ISO 639-1 language codes. \omit ### Is a link to the country code list needed here? \endomit \section1 Supporting Device Features Mobile devices support different sets of device features, depending on their configuration and the underlying hardware. When you develop applications for multiple devices, you can programmatically determine which platform, software version, languages, features, and accessories a particular device supports. This allows you to programmatically enable and disable application functions for a particular device. Change the \gui{Features} in the \gui{Generic} view to check how your application behaves when a particular device feature is supported or not supported. For example, devices can support several physical connection methods, such as \gui{Bluetooth}, \gui{Infrared}, and \gui{USB} (universal serial bus) for downloading data. Devices can also have a \gui{Memory Card} available for storing the data. Change the \gui{Operating System}, \gui{Qt}, and \gui{Firmware} \gui{Versions} to check how your application behaves on a specific version. Click \gui{Change} to specify the version. Specify firmware versions as follows: \bold major.minor.build. If a particular version does not include the build part, set it to 0. If a particular element is not available at all, the API returns the error \bold {Not Installed}. \section1 Accessing Services The basis for access security is the effective identification of the users and the equipment they are using. The device can be protected with a lock code, while the SIM card, memory card, and applications can have their own PIN codes and passwords. For enterprise applications, this can mean that only a specific user with a specific application, device, memory card, and SIM card can access the corporate data. Devices are identified by international mobile equipment identity (IMEI) and international mobile subscriber identity (IMSI) numbers. Change the \gui{IMEI} and \gui{IMSI} numbers in the \gui{Generic} view to test access security for applications. \section1 Handling User Input In order to support as many target devices as possible, applications must support different input control configurations: \list \o Hardware keypad and touch \o Touch-only \o Hardware keypad only \endlist For devices that support both hardware keypad and touch interactions, consider which is the best mode of interaction for the application. For touch-only devices, all interactions should naturally be touch-optimised. For devices that support only the hardware keypad, touch-only components can be flagged out of the application. This way it is possible to create applications that will function with different device configurations. Change the \gui{Input methods} in the \gui{Generic} view to test how the application handles different input methods. \section1 Identifying Devices You can specify the \gui{Manufacturer}, \gui{Model}, and \gui{Product name} to allow applications to identify the device. You can write any values in the fields. For example, you could set \gui{Manufacturer} to \bold {Nokia} and \gui{Model} to \bold {N97}. \section1 Using Colors Like computer monitors, mobile devices use an additive color process. Unlike print media, which begin with a white surface, the computer screen begins as a black surface to which colored light red, green, and blue (RGB) is added. Although early mobile devices supported very few colors, color support is now quite robust, with a large proportion of devices providing 12-bit (4,096 colors), 16-bit (65,536 colors), or 24-bit (16 million colors) color support. However, similar to the variety in screen size, many devices in use support varying color depths, with newer, low-cost models typically supporting 12- or 16-bit color depths. Applications can query the color scheme of the mobile device and adapt to it. For example, applications can switch to a night color scheme when brightness falls below a certain value. Change the \gui{Color depth} and \gui{Brightness} values in the \gui{Generic} view to change the way the application perceives them. \omit \section1 Turning off Screen Saver Applications can turn off the screen saver on the mobile device. However, if the screen saver is secure by policy, the policy is be honored and screen saver cannot be turned off. As a rule, do not override screen saver settings because they work automatically according to user-set preferences. The application can monitor the screen saver status to detect whether the device is in active use. You can override the settings in special cases, such as in a navigation application. However, the application should monitor the device status to check whether the prerequisites are still valid. For example: \list \o Is the device connected to a power supply (charger or car kit)? \o Does the application require lights on the foreground? \o Is the battery level sufficient? \endlist Select the \gui {Screen saver inhibited} check box in the \gui {Generic} view to turn off the screen saver. \endomit */ /*! \contentspage index.html \previouspage simulator-drives.html \page simulator-networking.html \nextpage simulator-location.html \title Simulating Networking Mobile applications can be divided into stand-alone and client-server applications. However, the difference is not always clear. Stand-alone applications may offer the possibility to refresh or update information from a server, and client-server applications may store recent information on the device, thus enabling use of the application without server connection. Additionally, connection to a server can be established through a variety of services, such as Bluetooth, WLAN, or the mobile network. If possible, the application should use the most sensible connection method, such as a WLAN for internet connection, when available. Hide the complexity of network connectivity in your applications. Short network coverage problems should not cause loss of users' work or stop them from working. Connection status should be displayed clearly. Synchronization should be automatic but under user control. When users move around with their mobile device, the device connects to available cells with sufficient signal strength. You can change the network settings to test how the application handles roaming from one cell or network to another. You can use Qt Simulator to test applications that use the \l{http://doc.qt.nokia.com/qtmobility/bearer-management.html} {Bearer Management API} to manage the connectivity state to the network. Change the \gui{Network mode properties}, such as \gui{Status} and \gui{Signal strength} in the \gui{Network} view. \image qt-simulator-network.png "Network settings" You can also load the \c sysinfonetwork.qs example script to test how your application behaves when the device moves between cells with varying signal strength in a GSM network. For more information on loading scripts, see \l{Scripting}. */ /*! \contentspage index.html \previouspage simulator-networking.html \page simulator-location.html \nextpage simulator-contacts.html \title Simulating Location Applications can use the \l{http://doc.qt.nokia.com/qtmobility/location-overview.html} {Location API} to access basic geographical information obtained from satellite or other sources about the user, including latitude and longitude, bearing, speed and altitude. This allows you to develop a range of geographical applications, for example, maps. The Location API provides a library for location positioning, landmark management, and mapping and navigation. You can simulate position and speed. \note You can also use Qt Simulator to test applications that use landmark management, mapping, and navigation in Qt Simulator, but there are no specific controls for simulating these features. Global positioning system (GPS) connections can consume the battery power rapidly, so you should take this into account when designing applications that access this functionality. \section1 Location Positioning Location-based services (LBS) use coordinates from the world geodetic system (WGS 84), which is also used as a reference system by the GPS. The coordinates are based on values for latitude, longitude, and altitude (elevation above sea level). The North Pole is 90 degrees North (+90 degrees) and the South Pole is 90 degrees South (-90 degrees). The Equator is defined as 0 degrees; locations above it have positive latitudes (0 to +90 degrees); those below (0 to -90 degrees) negative ones. There are two definitions of North Pole; Magnetic North Pole and True (Geographical) North Pole. Any application with a compass must check how the API defines North Pole. The Magnetic North Pole is the point to which compasses point. The True North Pole defines latitude as +90 degrees. Meridians are constant longitudinal (north-south) values. The Prime (Greenwich) Meridian's value is 0 degrees. WGS84, which LBS use, defines its zero meridian some 100 meters east of the Prime one. Locations east of the Prime Meridian have positive longitudinal values (0 to +180 degrees), those west (0 to -180 degrees) have negative ones. Latitude lines are smaller near the poles. At the equator, one degree of longitude is roughly 111.3 km, whereas at 60 degrees of latitude one degree of longitude is only 55.8 km. \image location-info.png To test an application that uses LBS, specify the following values in the \gui{Location} view: \image qt-simulator-location.png "Location" \list \o In the \gui Latitude and \gui Longitude fields, specify the reported position (in decimal degrees). To adjust the position, you can specify the accuracy of the provided latitude-longitude value (in meters) in the \gui {Horizontal Accuracy} field. \o In the \gui Altitude field, specify the elevation from sea level of the reported position (in meters). To adjust the altitude, you can specify the accuracy of the reported value (in meters) in the \gui {Vertical Accuracy} field. \o in the \gui Direction field, specify the bearing of the device (in degrees), relative to true north. \o In the \gui {Ground speed} or \gui {Vertical speed} field, specify the velocity of the device (in meters per second) that reported the position. \o In the \gui {Magnetic variation} field, specify the angle between the horizontal component of the magnetic field and true north (in degrees). A positive value indicates a clockwise direction from true north and a negative value indicates a counter-clockwise direction. \o In the \gui Timestamp field, specify the date and time at which the position was reported. \endlist \section1 Simulating GPS Satellites To test satellite-monitoring applications, you can simulate GPS satellites. Open advanced settings to change satellite properties in the \gui{Satellites} view: \image qt-simulator-location-satellite.png "Satellites" \list \o In the \gui PRN field, select the pseudo-random noise (PRN) code that identifies the satellite. To use other than the pre-defined values, click \gui {Change PRN} and specify the PRN of a satellite. \o In the \gui Azimuth field, specify the direction of the satellite from the current position (in degrees), as an offset to true north. \o In the \gui Elevation field, specify the angle (in degrees) to see the satellite from the current position. \o In the \gui {Signal strength} field, specify the satellite signal strength in decibels. \o Select the \gui {In use} check box to specify that the satellite is used to determine the current position. \endlist */ /*! \contentspage index.html \previouspage simulator-generic.html \page simulator-drives.html \nextpage simulator-networking.html \title Simulating Storage Devices One or several storage devices, such as memory cards, can be added to mobile devices to increase the available storage space. Devices may also have internal non-removable memory cards or internal mass storage. That is, multiple drives are supported. Applications can use the \l{http://doc.qt.nokia.com/qtmobility/systeminfo.html} {System Info API} to check how much space is available in a particular storage. To test the applications, specify the space available on the device in the \gui{Available space} field in \gui{Storage Properties} in the \gui{Storage} view. \image qt-simulator-drives.png "Storage settings" */ /*! \contentspage index.html \previouspage simulator-location.html \page simulator-contacts.html \nextpage simulator-messaging.html \title Importing Contacts You can use Qt Simulator to test applications that use the \l{http://doc.qt.nokia.com/qtmobility/contacts.html}{Contacts API} to access address book information. The applications can create, edit, list, delete, and look up contact information whether it is stored locally or remotely. You can use the predefined contacts in the \gui{Contacts} view to test applications. Click \gui{Import} to import new contact information from vCard files (\c {.vcf}). \image qt-simulator-contacts.png "Contacts" The initial contact list is created from the data in \tt{stubdata/standardcontacts.vcf} during Qt Simulator startup. The \e {Self Simulator} contact is read from \tt{stubdata/standardselfcontact.vcf}. To export contact information to a vCard file, select \gui Export. */ /*! \contentspage index.html \previouspage simulator-quick-tour.html \page simulator-views.html \nextpage simulator-application.html \title Checking Application Layout Unlike PC displays, which have standardised to two or three common sizes, mobile phone displays still come in many shapes and sizes. The screens have grown larger, while smaller screens still exist at the lower end of the market. Displays typically support both portrait and landscape modes. The screen size of mobile devices is significantly smaller than that available on desktop devices. Carefully consider what is the most relevant content to present on the application UI, as it might not be reasonable to try and fit as much content into the screen as you might have in a desktop application. Relate the position and size of widgets to the dimensions of the display. This enables the same set of information to be presented on the screen in all resolutions; higher resolution devices just display finer graphics. Change the settings in the \gui{Model} view to check application layout. \image qt-simulator-view-settings.png "Model settings" \section1 Changing Device Models Each unique mobile device targets a different market niche, a combination of form, functionality, and price, which expands the total addressable market for mobile applications. The characteristics of your target devices, such as screen size and orientation, touch support, and the availability of a keyboard or home screen, affect application design. In the \gui{Device} field, select different device models to test the application on them. \section1 Rotating Devices Rotation changes the orientation of the primary display between portrait and landscape. Rotation is effected by a sensor. By default, all applications can present in portrait or landscape orientation. Based on the product ID, one orientation is considered dominant. Because most application software must deploy to multiple devices, ensure that your application layout is properly usable in all orientations. Applications can auto-rotate the screen according to the current device orientation or lock the screen into a particular orientation. Click the rotation buttons to change the orientation of the device. When the \gui {Rotate screen} check box is selected, the screen is auto-rotated to match the orientation of the device. However, some devices do not support screen rotation for all possible orientations. Deselect the check box to rotate the device without changing the orientation of the screen. \image qt-simulator-view-rotation.png "Rotation buttons" \section1 Changing Screen Resolution In addition to the display size in pixels, physical screen dimensions have an impact on designs. Devices with the same size display can vary in physical dimensions and, consequently, in screen resolution. The implications are most obvious on images, particularly on those that contain graphic text or fine details. For example, on devices that share a 240-pixel screen width, a logo that is legible at 154 pixels per inch may be somewhat less so at 199 pixels per inch. You can use Qt Simulator to ensure that screens designed on a large computer monitor are suitable once transferred to a mobile device and that critical visual elements remain legible at all supported screen sizes. Move the \gui{Zoom} slider to the left to scale the device to its real size and to the right to make each device pixel correspond to a pixel on the screen. However, Windows always reports the DPI of the screen as 96 pixels per inch, and therefore, Qt Simulator cannot reliably detect the DPI of the screen. The same problem might arise on some Linux systems that use a fixed value for the DPI. Click the \gui {Configure DPI Correction} button to make the \gui {Native size} setting match the real size of the device. In the \gui Configuration dialog, you can use the following approaches to scale the screen to the correct size: \list \o In the \gui {Diagonal in inches} field, enter the diagonal of the display in inches. \o In the \gui {Manual Correction} group, place a ruler next to the line, and then move the slider to the 10 inch or 4 centimeter mark on the ruler. \o In the \gui {Correction Factor} field, enter a value to scale the screen. This value is adjusted automatically when you edit the other fields. \endlist Qt Simulator scales fonts according to the screen DPI. Always specify font size in points, not pixels, to have them scaled correctly on different screen sizes. \omit ### Add an image of a screen in both ends of the scale\endomit */ /*! \contentspage index.html \previouspage index.html \page simulator-description.html \nextpage simulator-starting.html \title Introducing Qt Simulator Qt Simulator allows you to quickly test and debug applications that target mobile devices, without the overhead of emulating the device at hardware level. It provides special versions of the Qt and Qt Mobility libraries that forward the display and settings to it. You can link applications that use the Qt and Qt Mobility APIs to these libraries to run them inside Qt Simulator. This allows you to see how applications look and function on different devices in different situations. For example, you can view the application layout on Symbian and Maemo devices, in both landscape and portrait orientation. Or you can check how your application behaves when device battery power decreases to low or critical level. \image qt-simulator-devices.png "Symbian non-touch and Maemo devices" Qt Simulator does not support any device specific APIs by design. Therefore, applications that run well on Qt Simulator also run on any device that hosts the Qt and Qt Mobility libraries. The following Qt Mobility components are supported: \list \o \l{http://doc.qt.nokia.com/qtmobility/bearer-management.html}{Bearer Management} \o \l{http://doc.qt.nokia.com/qtmobility/multimedia.html#camera-support}{Camera} \o \l{http://doc.qt.nokia.com/qtmobility-1.2/connectivity-api.html}{Connectivity} \o \l{http://doc.qt.nokia.com/qtmobility/contacts.html}{Contacts} \o \l{http://doc.qt.nokia.com/qtmobility/gallery.html}{Document Gallery} \o \l{http://doc.qt.nokia.com/qtmobility/feedback.html}{Feedback} \o \l{http://doc.qt.nokia.com/qtmobility/location-overview.html}{Location} \o \l{http://doc.qt.nokia.com/qtmobility/messaging.html}{Messaging} \o \l{http://doc.trolltech.com/qtmobility/organizer.html}{Organizer} \o \l{http://doc.qt.nokia.com/qtmobility/publ-subs.html}{Publish and Subscribe} \o \l{http://doc.qt.nokia.com/qtmobility/service-frameworks.html}{Qt Service Framework} \o \l{http://doc.qt.nokia.com/qtmobility/sensors-api.html}{Sensors} \o \l{http://doc.qt.nokia.com/qtmobility/systeminfo.html}{System Information} \o \l{http://doc.qt.nokia.com/qtmobility/versit.html}{Versit} \endlist \note Qt Simulator does not have support for catching memory leaks in applications. Memory leaks occur when memory that has been allocated is not freed. To catch memory leaks, use the dynamic analysis tools available for the platform. For example, you can use Valgrind on Maemo and Symbian Emulator and Carbide tools on Symbian. */ /*! \contentspage index.html \previouspage simulator-touch.html \page simulator-scripting.html \nextpage simulator-adding-models.html \title Scripting The Qt Simulator JavaScript interface enables you to automate recurring sets of changes or to simulate a continuously changing environment. \image qt-simulator-scripting.png "Scripting" \section1 Locating Scripts Create a script (.js or .qs) that sets the device to its desired state when you open an application in Qt Simulator. Place the script in the \tt{scripts/autostart/} folder to run it automatically when Qt Simulator starts. You can then use the \gui{Device Control} dialog to change the default settings according to your test cases. To run the same tests repeatedly or to test complicated sequences of events, create scripts and place them in the \tt{scripts} folder. Place you favorite scripts in the \tt{scripts/favorites/} folder. Example scripts are located in \tt{scripts/examples/}. To open the folder that contains the scripts in a file browser, select \gui {Open Folder}. \section1 Running Scripts To run a script: \list 1 \o Click the \gui{JS} quick access button to bring up a list of scripts in the \tt{scripts/favorites/} folder. \o Double-click a script in the \gui{Scripting} tab that shows the scripts in the \tt{scripts/} folder. \o Place a script in the \tt{scripts/autostart} folder to run it when Qt Simulator starts. \o Add the \c {-runscript