Location is an important attribute in mobile apps today. Business people and developers are talking about it. Have you ever thought as to how a testing of apps based on location can be done?
http://blogs.innovationm.com/location-testing-in-mobile-apps/
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
InnovationM Webinar_Location Testing in Mobile
1. October 31, 2013
Time: 7:00 AM to 8:00 AM PDT
Presented By - Nishant Luthra
(Mobile Test Engineer)
http://www.innovationm.com/
mailto:info@innovationm.com
2. About InnovationM
Overview
InnovationM provides specialized design &
development services in the mobility space focusing on native and HTML5-based mobile
solutions, with a deep focus on UX/UI Design.
Services
Design & Development for:
- Native: Android & iOS
- Mobile Web App (HTML5): PhoneGap, Sencha
Touch 2 and jQuery Mobile
- User Experience (UX) & UI Design
Location
Head-quartered in Noida, India with presence in US.
3. Table of Contents
1. What is Location?
2. Concept of Location Provider
3. A small case study
4. Mock Location using KML and GPX file
5. Tool for testing location based application
4. What is Location?
Location is place or point that something is at on this earth.
Each point on this earth is identified by two data points
Latitude
Longitude
6. Where Am I
If you look at map, it consist of horizontal and vertical lines.
Horizontal line - Latitude
Vertical line - Longitude
Earth surface divided into degree,minute and sec.
Suppose I am located at
38°53'23"N , 77°00'27"W (38 degrees, 53 minutes, and 23
seconds north of the equator and 77 degrees, no minutes and
27 seconds west of the meridian).
7. Concept of Location Provider
A location provider provides current location
of the device to the applications running in the
device.
8. Types of Location Provider
GPS – This provider determines location using satellites.
Depending on conditions, this provider may take a while to
return a location fix.
Network – This provider determines location based on
availability of cell tower and Wi-Fi access points. Results are
retrieved by means of a network lookup.
Passive – A special location provider for receiving locations
without actually initiating a location fix. This provider will return
locations generated by other providers.
9. Case Study
Situation – Let us study with an example on how
to track delivery of goods.
Suppose a truck having goods moving along a road has to
deliver goods to retail shops in the city.
Truck driver is carrying a mobile device and an application. A
Route is provided that carries address and location of retailers
on that route and this data is provided to the application.
Application gets the current location from Location Provider
and compares the proximity of location of retailers with current
location. If distance between current location and retailer
location is within range then that retailer is marked as visited.
10. How to test this application?
Is application getting correct
location?
11. Two ways to Test
1. Physically go on that route and test
2. Emulate that user is moving on that route
while physically elsewhere.
12. Mock Location Testing
Physically going and testing on the road is
very time consuming then how to mock/test
location using android Emulator?
13. By simply uploading KML and GPX
file to Android Emulator
What is KML and GPX files?
14. KML
- KML is a file format used to display geographic data in Google
Earth, Google Maps, and Google Maps for mobile.
- KML uses a tag-based structure with nested elements and
attributes and is based on the XML standard
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Document>
<name>GE2ADT</name>
<Placemark><name>0</name><description>GE2ADT
Route</description><Point><coordinates>77.313931,28.581661</coordinates></Point><
/Placemark>
<Placemark><name>1</name><description>GE2ADT
Route</description><Point><coordinates>77.313842,28.581918</coordinates></Point><
/Placemark>
</Document>
</kml>
15. GPX
GPX (the GPS Exchange Format) is a light-weight XML data
format
<?xml version="1.0" encoding="UTF-8"?>
<gpx
version="1.1"
creator="Created by Google My Tracks on Android."
xmlns="http://www.topografix.com/GPX/1/1"
<trkseg>
<trkpt lat="28.581475" lon="77.314435">
<ele>137.5</ele>
<time>2013-04-03T14:37:10.000Z</time>
</trkpt>
</trkseg>
</trk>
</gpx>
16. Load, Play and Test
- Run your application as android emulator.
- In DDMS, select Emulator Control(Location Control).
- For loading GPX file, select your application and then
click on ‘Load GPX’
18. - GPX file start mocking your location as you are moving along
that road in real.
19. Question
- But how to generate this files
- Are there any tool for kml and gpx generator
Answer
- Yes
20. Tools for testing Location based application
My Tracks - It is an Android application useful for creating KML,
GPX file. My Tracks records your path, speed, distance, and
elevation while you walk, run, bike, or do anything else
outdoors. You can download My Tracks from Google Play.
URL - https://play.google.com/store/apps/details?id=com.google.android.maps.mytracks)
Usage - Somebody can physically record the path by actually
moving on that Good Delivery Route and generate the file for
testing team.
21. KML Generator
KML Generator
It is website that generate KML file using GPS coordinate. We just
have to put latitude and longitude under GPS coordinate column
and output as KML (download). You can go to this website through
this url – http://kmltools.nobletech.com/
Usage - If you know the Coordinates (Latitude and Longitude) of the points on the
Path then you can generate KML file.
22. Google Earth to ADT plugin
Google Earth to ADT plugin - This application helps in converting
KML file to another format of KML that Android development
tools (Suitable for Eclipse Android ADT plugin) can understand.
Here a link to the url – (http://ge2adt.appspot.com/)
This application help in generating kml file for make path or placemark in google earth
or convert Google Earth routes to a format suitable for Eclipse Android ADT plugin 0.8.0
23. Google Earth
Google Earth - You can visually see the path / route on
Google Earth.
Ex. You can have a Delivery Route KML file, the Actual
KML file that was played and see the points on Google
Earth.