Simulating SensorsMobile devices contain built-in sensors, such as an accelerometer, a compass, and ambient light or proximity sensors. The availability of sensors depends on the device model. The following types of interaction can be enabled by using the sensors on the device:
You can test applications that use the Qt Mobility Sensors API in the Qt Simulator. The Sensors section contains controls to set the values the sensors currently return. Specify the ambient light state in the Ambient light field. The accelerometer sensor channel detects movement gestures, such as moving a mobile device up or down. The three-dimensional Cartesian coordinate system is used to illustrate direction of the acceleration, as shown in the figure below. The x and y axes define a plane where z-axis direction is perpendicular to the xy plane. When a device moves along an axis in the positive direction, the acceleration is positive. When the device moves in the negative direction, the acceleration is negative. For example, when a device moves along the x-axis to the direction of -x, the acceleration is negative. A mobile device placed screen up on a desk experiences a force of approximately 9.8 on the z axis (that is, upwards). This is the proper acceleration the device experiences relative to freefall. To simulate movement of the device, use the sliders to specify values for the x, y, and z axis in the Accelerometer x, Accelerometer y, and Accelerometer z fields. The attitude sensor detects the rotation of the device around the x, y, or z axis: Pitch and roll are zero (0) when the phone lies flat, screen up. Yaw is 0 when the top of the device points towards the reference point. Yaw requires a fixed, external reference point that the device can detect. For example, devices with a compass may use magnetic north as a reference point. Devices that cannot detect a fixed, external reference point always return 0 for yaw. Use the sliders to set the Attitude pitch, Attitude roll, and Attitude yaw values to test how the application handles the interaction related to rotating the device. The compass returns the azimuth of the device as degrees from magnetic north in a clockwise direction based on the top of the device. Note: The top of the device is a fixed point and may not represent the orientation that the user is holding the device in. The calibration status of the device must be accurate for the azimuth to be accurate. It takes some time to calibrate the magnetic north sensor and, even after being calibrated, it can become uncalibrated. So, for an application to be sure the data coming from the magnetic north sensor channel is accurate, it must monitor changes in the calibration property and inform the user if something needs to be done to recalibrate the sensor. Use sliders to set the Compass calibration level and Compass azimuth values. Proximity indicates how far away from the device the user is. Use the button to toggle between Near and Far distance. Many sensors update frequently, and therefore sensor readings done by the client application contain a fresh timestamp by default. To disable that and provide a fixed timestamp manually, select the Override radio button in the Timestamp group and specify a date and time. [Previous: Simulating Messaging] [Next: Testing Applications Using the Qt Mobility Service Framework] X
|