Testing Geo Location in iOS and Android apps using Google Maps

Testing Geo Location in iOS and Android apps using Google Maps

When building location aware applications testing a single GPS location is trivial. However testing an entire route is a bit more tricky.

Both iOS and Android development environments offer a GPS location simulation based on GPX file data. The biggest problem is how do you actually collect the GPS data to produce this file?

Using Google Maps

In August 2015 I wrote on my blog about a simple web tool I built to convert Google Maps Directions to GPX.

Try the original web-app

A recent article written by the people at the Uppercut technology agency showed how to leverage my tool to be able to plot out the GPS paths in Google Maps and generate the necessary replay GPX file. However due to limitations in Xcode some non-trivial manual modifications were needed (their article goes into details).

Supporting both Android and iOS development

The Uppercut article gave me the idea and I updated my converter tool to be able to produce GPX files directly from Google Maps Directions that are fully compatible with both iOS and Android development environments.

I added a new section called "Developer Settings" available in the tool that enables some specific configuration options to enable this kind of GPX replaying. Note these settings have no effect if JSON output is selected.
Update 2 Nov: I have now created a dedicated user interface for this which has settings specific to each of the major development platforms. It's blue!

Try the new web-app interface now!

There is now a dedicated website just for producing gpx files for location aware replay.

The procedure described below still works in the original tool.

Old procedure

Below I describe the necessary configuration for each platform. Both methods assume that you already have a valid Google Maps Directions link as described on the conversion tool's website.

iOS How to

Configuration for Xcode

  1. Ensure that GPX output is selected. 
  2. Expand the Developer Settings section near the bottom of the page.
  3. Tick both the Force route as waypoints and Simulate Travel Duration options.
  4. Pick a simulated travel duration from the drop down boxes (hours and minutes).
  5. Click the Let's go button.

Follow the Uppercut tutorial or any number of others on the Internet on how to load the resulting GPX file into Xcode.

Android How to

Configuring for Eclipse or Android Studio

  1. Ensure that GPX output is selected.
  2. Tick the Track Points option.
  3. Expand the Developer Settings section near the bottom of the page.
  4. Tick the Simulate Travel Duration option only.
  5. Pick a simulated travel duration from the drop down boxes (hours and minutes).
  6. Click the Let's go button.

 

Happy developing :)

This article is also available on my blog at:
http://hardkjarni.blogspot.co.uk/2015/11/testing-geo-location-in-ios-and-android.html

To view or add a comment, sign in

More articles by Sverrir Sigmundarson

Others also viewed

Explore content categories