+

Search Tips   |   Advanced Search

Location scenarios

Location scenarios are intended for developers who want to develop and test location-dependent behavior of mobile apps, as part of the MobileFirst mobile tools suite. Location scenarios represent a multi-sensor simulation environment for mobile apps.

The scenario widget only runs on the following web browsers:

MobileFirst Mobile Browser Simulator allows developers to quickly test, debug, and experiment with their hybrid applications from the convenience of the web browser. Although Mobile Browser Simulator provides sensor simulation it requires manual updates each time a new sensor data update is required, which is slow and not repeatable. With the new location scenario widget, testing location-aware apps becomes much easier.

The process for working with a location scenario widget is as follows:

  1. User defines a scenario on a map, which comprises the following items:

    • A route, with the time for each point

    • WiFi hot spots

    • No-GPS zones

  2. As the user plays back the scenario, the sensor inputs are simulated:

    • Location updates arrive according to the route and no-GPS zone definitions. These include the generation of timeout errors based on the acquisition policy, when the scenario moves through no-GPS zones.

    • WiFi hot spots become visible according to the current location. These hot spots include the calculated signal strength on each update.

The testing scenarios listed here demonstrate the versatility of the scenario widget.

Background: We have implemented an application for improved hotel check-in. This application defines a geo-fence with a five-kilometer radius around a hotel, within which a guest is invited to check in. In addition, the application defines a WiFi trigger when the hotel WiFi is visible, to welcome the hotel guest and alert the hotel manager that the guest has arrived.

Testing a scenario for entering a geofence: You would like to test the geofence defined in this application. Complete the following steps:

  1. Right-click the environment to test (hybrid Android, iOS, or Windows Phone 8) and click Preview to start the Mobile Browser Simulator and open the scenario widget.

  2. Create a new scenario and move to the correct location on the map. Create the path to the hotel by clicking the map to indicate the points on the path. For each path point we can specify the time. When completed, we can save the scenario to a local file.

  3. Click Play . The current location on the route is clearly visualized for the application, as it is simulated. When the current location is five kilometers from the hotel (the defined trigger), you see a message appear on the mobile application indicating that the correct event was triggered and handled by the application, prompting the guest to check in remotely.

Test a scenario for entering a WiFi zone: You would like to test the application when the guest enters the hotel. Complete the following steps:

  1. Edit the scenario widget and add a visible network with the hotel SSID and MAC address in the hotel location.

  2. Click Play . We can clearly see the current location that is simulated for the application. When the first geo-fence is entered, you work with the application to confirm the remote check-in. While you are operating the application the current location is still changing, as planned. As the current location enters the hotel WiFi zone, we can see that the correct event was triggered and handled by the application, welcoming the guest to the hotel.

Loading and editing a location scenario: You would like to test a scenario you created in the past. Complete the following steps:

  1. Open the scenario widget and click Import to select a scenario.

  2. Edit the scenario by moving some of the points in the route, by deleting some of the points in the route, and by adding more points to the route. When we have finished editing, click Apply. Then play the scenario to test the application. To save the scenario to a file we can play in the future, click Export.

Manually editing a location scenario: Complete the following steps:

  1. Open a scenario file we have tested in a text editor. The format is readable and we can clearly understand how the path, WiFi zones, and no-GPS zones are represented.

  2. Manually edit the no-GPS polygon to a different polygon. You save the file and load it in the Mobile Browser Simulator. We can see the new polygon on the scenario map.


Parent topic: Test hybrid location service applications