Mobile SDK Testing Guideline for Developers¶
The aim of this document is to provide tips and guidelines for easier testing of the mobile sdk. Pointr QA team has some practices for testing and these practices will be described in detail to make client developers benefit from it.
Simulating Position with Joystick Function¶
Joystick is a custom UI element that Pointr provides if you are using our map widget, to allow testing wayfinding and other position related aspects without physically being on site. To enable the joystick you need to set the isJoystickEnabled field of PTRMapFragment/PTRMapWidgetViewController to true.
Android:
mapWidgetFragment.mapFragment!!.isJoystickEnabled = true
iOS:
let configuration = PTRMapWidgetConfiguration()
configuration.isJoystickEnabled = true
let mapWidget = PTRMapWidgetViewController(configuration: configuration)
1. Using Joystick with Android:¶
Below is the appearance of the joystick UI in Android.
To simulate indoor (beacon) position, select site, building and level by using the corresponding S, B and L buttons. The indoor blue dot will display as soon as selection is made. Once you start simulating indoor position, you can move the indoor blue dot by pulling the joystick in any direction.
To simulate outdoor (GPS) position, simply click on the GPS button. The outdoor blue dot will appear in the center of the mapwidget, as soon as the GPS button is clicked. In order to change the GPS position, simply drag the map and click on the button again.
You can easily switch between indoor and outdoor positions by using the joystick function. This is very useful especially when testing scenarios like building enter/exit, site-wide wayfinding etc.
2. Using Joystick with iOS:¶
Below is the appearance of the joystick UI in iOS.
It has more buttons compared to Android but works the same way. Below are short descriptions of what each button does.
- UP: Moves the indoor position to the upper floor. If you have an indoor position at Level-3, clicking on the button will move it to Level-4. It is useful when testing inter-building navigation.
- DW (Down): Moves the indoor position to the lower floor. If you have an indoor position at Level-3, clicking on the button will move it to Level-2. It is useful when testing inter-building navigation.
- RL (Rotate Left): Clicking on the button will move the heading of the blue dot to the left.
- RR (Rotate Right): Clicking on the button will move the heading of the blue dot to the right.
- CB (Change Building): It opens a dialog to select a building to move the blue dot. The IND button also serves the same purpose. In order to change the indoor position, you can either use the CB button or drag the map manually and click on the IND button.
- RE (Reset): Resets the heading.
- GPS: To simulate outdoor (GPS) position, simply click on the GPS button. The outdoor blue dot will appear in the center of the mapwidget. In order to change the GPS position, simply drag the map and click on the button again.
- IND (Indoor): To simulate indoor (beacon) position, simply click on the IND button. The indoor blue dot will appear in the center of the mapwidget. In order to change the indoor position, simply drag the map or switch level and click on the button again.
Simulating Position without Joystick Function¶
1. Getting Indoor Position with Beacon Apps¶
SDK calculates indoor position depending on the acquired beacon signals. It is possible to get indoor position by simulating on-site beacon signals via some third party apps. A simple beacon info is stored in Pointr Cloud like below:
{
"type": "Feature",
"properties": {
"typeCode": "ibeacon",
"minor": 3205,
"major": 1,
"uuid": "AAAAAAA0-BBB0-CCC0-DDD0-431E50385F1D",
"fid": "455eab5c-3d22-413a-8341-664434e8f433",
"lvl": 3,
"bid": 14,
"sid": 4
},
"geometry": {
"type": "Point",
"coordinates": [
-71.02221889,
42.37000783
]
}
},
We need “minor”, “major” and “uuid” data to simulate an on-site beacon. You can get the list of beacons of the client by making a request to the corresponding endpoint (please refer to Pointr Cloud API V8 Documentation for available endpoints). Most of the third party beacon apps work the same way and require “minor”, “major” and “uuid” data. Please check How to simulate user position document to see how to set up and use a sample third party beacon app. After installing the app and defining a couple of beacons, follow these instructions to get indoor position:
- Launch mapwidget. Be sure that the joystick is not enabled.
- Start a beacon, observe sdk switches to track mode and displays indoor blue dot
- Switch to another beacon, observe the blue dot relocates close to the broadcasting beacon.
- Broadcast multiple beacons, observe the blue dot relocates in the middle (approximately) of the broadcasting beacons.
- Stop broadcasting beacons, observe sdk loses indoor position and switches to outdoor (GPS) blue dot.
Tips:
- It is easy to simulate an indoor-to-indoor wayfinding experience by broadcasting beacons that are close to the start and destination POIs.
- If you have multiple mobile devices that can be used for beacon broadcasting, set the devices to broadcast different beacons and place them at the beginning and end of a corridor. Walk the corridor back and forth. You’ll see that blue dot relocates as per your movements.
2. Getting Outdoor Position with Fake GPS Apps¶
It is possible to fake GPS position as if on the site with some third party apps. This is useful when testing features like mark my car, like building enter/exit, site-wide wayfinding etc.
Faking GPS Position in Android¶
There are a few apps in the market for that purpose and most of them work the same way. We’ll describe the “Fake GPS” app as a sample.
- Enable developer mode of the Android device
- Go to Play Store and install “Fake GPS”
- Launch the app and grant for required permissions
- Open Developer Options from the settings and click on the “Select mock location app” option. Select “Fake GPS” from the options
- Switch back to the app, drag the map and locate the smell dot to where you need to fake your GPS position. Click on the play icon to bottom right. Skip following dialog if displayed. That is it. Click on the red stop button to stop faking your GPS position.
Faking GPS Position in iOS¶
Faking GPS position is not straight as it is in Android but still there are working third party apps. We’ll describe the “3U Tools” app as a sample.
- Navigate to https://www.3u.com/ and install the app on PC
- Launch the app, connect your iOS to the PC via cable
- Select Toolbox / Virtual Location
- Search for the location you need to fake your GPS position and select a result. You can also drag the map to the desired location.
- Put the marker on the exact position and click on the “Modify virtual location” button. That’s it. You need to restart the iOS in order to reset GPS position.