Java Reference
In-Depth Information
Figure 17-1. Simulating the device location
As you can see from the figure, you can choose to simulate not just the device posi-
tion, but also its orientation, altitude, speed, and course. You can also simulate location
failures by changing the Location Provider combo box, letting you test your application
in a predictable and repeatable way.
While specifying your position manually is a good way to test simple applications
that use one-shot positioning, you'll want to vary the simulated position over time when
testing more complex applications (especially those that use multiple location requests
or proximity detection). You can do this using a simple script in XML that includes the
following two XML tags:
waypoints : This top-level tag contains a list of individual waypoint items, each a
separate position.
waypoint : This tag contains a specific position and timestamp using the time (in
milliseconds), latitude, longitude, and altitude (in meters) attributes.
Listing 17-3 shows a simple example.
 
Search WWH ::




Custom Search