Emulator Control

With these controls, you can simulate special device states and activities. Features include:

• Telephony Status - change the state of the phone's Voice and Data plans (home, roaming, searching, etc.), and simulate different kinds of network Speed and Latency (GPRS, EDGE, UTMS, etc.).

• Telephony Actions - perform simulated phone calls and SMS messages to the emulator.

• Location Controls - send mock location data to the emulator so that you can perform location-aware operations like GPS mapping.

To use the Location Controls, launch your application in the Android emulator and open DDMS. Click the Emulator Controls tab and scroll down to Location Controls. From here, you can:

o Manually send individual longitude/latitude coordinates to the device.

Click Manual, select the coordinate format, fill in the fields and click Send.

o Use a GPX file describing a route for playback to the device.

Click GPX and load the file. Once loaded, click the play button to playback the route for your location-aware application.

When performing playback from GPX, you can adjust the speed of playback from the DDMS panel and control playback with the pause and skip buttons. DDMS will parse both the waypoints (<wpt>, in the first table), and the tracks (<trk>, in the second table, with support for multiple segments, <trkseg>, although they are simply concatenated). Only the tracks can be played. Clicking a waypoint in the first list simply sends its coordinate to the device, while selecting a track lets you play it.

o Use a KML file describing individual placemarks for sequenced playback to the device.

Click KML and load the file. Once loaded, click the play button to send the coordinates to your location-aware application.

When using a KML file, it is parsed for a <coordinates> element. The value of which should be a single set of longitude, latitude and altitude figures. For example:


In your file, you may include multiple <Placemark> elements, each containing a <coordinates> element. When you do so, the collection of placemarks will be added as tracks. DDMS will send one placemark per second to the device.

One way to generate a suitable KML file is to find a location in Google Earth. Right-click the location entry that appears on the left and select "Save place as..." with the save format set to Kml.

Note: DDMS does not support routes created with the <MultiGeometry><LineString>lat1, long1, lat2, long2, </LineString></MultiGeometry> methods. There is also currently no support for the <TimeStamp> node inside the <Placemark>. Future releases may support timed placement and routes within a single coordinate element.

For additional methods of setting up mocks of location-based data, see the Location topic.

0 0

Post a comment