iPhone Lost Client

Webster Ross
Columbia University
New York, NY 10027
USA
wdr2103@columbia.edu

Henning Schulzrinne
Columbia University
New York, NY 10027
USA
hgs@cs.columbia.edu

Andrea Forte
Columbia University
New York, NY 10027
USA
andreaf@cs.columbia.edu

Abstract

For this project I have developed a Location-to-Service Translation (LoST) client on the iPhone 3G that takes advantage of real-time position data. Using the LoST protocol and its extensions, the application provides users with information on services near their current location. The iPhone LoST client can quickly retrieve data for an array of services and includes real-time information for each service located. Additional enhancements were also added to the client to improve its usability and functionality.

Introduction

The iPhone LoST client is a mobile application that implements location-based services utilizing the Location-to-Service Translation (LoST) protocol [1] and its extensions [2]. Using this application, a user can find available services in their immediate vicinity and receive additional real-time information on a particular service of interest. There are various service types which can be queried by the application including food, medical, and many others. Additional service types are detailed in [3], which provides the classifications for location-based services used within this project.

Since the client has been implemented on a mobile device, the location of the user must be known at all times in order to provide the most relevant results. This is achieved through the use of the iPhone's GPS capabilities that are directly accessible through its Core Location API. Every query made by the LoST client uses the current location of the device to perform location-to-service translations. This ensures results are not given for services that are no longer within the parameters of a given query.

An example of how the LoST client might be used is detailed in the following scenario. A user may need to search for gas stations while riding in a car and will query for this service type using the application. The query is sent to a LoST server which will return a list of the nearest gas stations based on the user's current location in its response. An address and phone number are included for each of the results returned and they can be used to either map or call a particular service using the appropriate iPhone application. Real-time service information is also displayed and can include useful information such as the price of a gallon or the number of cars currently in line at the station.

Other features include the ability to search for services in a user's direction of movement, result caching, and allowing users to specify their search location instead of using GPS. The iPhone LoST client is a robust and fully integrated application that fully utilizes the iPhone's capabilities to enhance the basic implementation of a LoST client.

The rest of this report is organized as follows. The related work section discusses the previously developed web-based LoST client and highlights its features. The background section gives an overview of the LoST protocol and the extensions used. The overall architecture of the iPhone LoST client application is presented in the architecture section, and the details of its implementation are provided in the program documentation section.

Related Work

The web-based LoST client was developed to demonstrate a basic LoST client application implementing location-based services. It is currently available at http://lost.cs.columbia.edu:8080/Lost and can be run on browsers that support JavaScript.

The application allows users to input a search location and select from a list of services they would like to query. The service list is available through a drop-down menu and includes sub-categories that are also defined in [3]. The query type, determined by the parameters X and N, also needs to be defined before a query can be sent to a LoST server. The N query type finds the N nearest services for a requested service type. The X query type finds all requested services within a radius X. Lastly, the XN query type finds the N nearest services within a radius X. Further information on each query type can be found in [2].

After the parameters have been selected, the client sends an HTTP post request to the LoST server with the format defined in the LoST extension draft [2]. The server returns all results matching the query and the client displays these results back to the user. Each result listed includes a hyperlink to map the result using Google Maps, the phone number to contact the service, and the distance the service is from the user's search location. When the web application is run on an iPhone, the native map application is used to map the results and phone numbers can be dialed directly with the phone application.

The iPhone LoST client presented in this report is an extension of the web-based client. The same basic functionality can be found in both applications, however the iPhone LoST client takes advantage of real-time position information and provides additional features to enhance its functionality.

Background

LoST is a protocol used to map a service identifier and location information to one or more service URI. Location information can be either civic or geospatial information compatible with PIDF-LO [4]. The protocol was designed to determine the location appropriate public safety answering point (PSAP) for emergency services but is general enough to support other location mapping services.

The original LoST protocol only supported the mapping of locations to a single service based on service regions. This may not be suitable for service types that do not have defined boundaries like emergency services do. The LoST extension draft [2] addresses this issue by extending the protocol to support the mapping of a location to multiple instances of a service using additional queries defined in the draft. These queries enable location mapping of the N nearest instances of a service within a given radius X.

Architecture

The iPhone LoST client uses a model-view-controller (MVC) architecture to separate the user interface design from the logic that implements the LoST protocol. This architectural style is best suited for iPhone application development and is directly integrated into the iPhone SDK. The SDK provides an UIView class that all views inherit and includes objects such as toolbars, buttons, tables, and other user interface objects. There is also an UIViewController class which can be used to control the views or a composition of views, thereby making MVC a natural choice for the design.

Each screen displayed to the user is represented by a view that is contained in an NIB file. NIB files provide a loadable set of objects used to create interface-related items. This is as an alternative to building interfaces programmatically since the files are created graphically using the Interface Builder application included in Xcode IDE. The views contained in this project include a service view to display available services to be queried, an options view that allows users to select different query parameters, a location input view where users specify their search location, a results view to display results returned from the LoST query, and a results detail view that displays the details of a selected result such as phone number and address.

For each view in the application, there is an associated view controller that maintains the view and handles communication between the view and the appropriate modules of the LoST client. The view controllers contain handler methods that are called whenever an specific action is taken on the view. Actions include a view being loaded, a button contained in the view being pressed, and any other view-related actions that require handling. The handler methods are where the view controllers create, display, and update their views as well a make use of modules that implement the LoST protocol.

The model is composed of different modules responsible for sending and receiving LoST messages using real-time position information. There is a location finder module that is responsible for gathering the current location of the device by accessing the iPhone's CoreLocation API. The service finder module uses the location data provided by the location finder and sends a findService request message to obtain the list of available services from the LoST server. When the user selects the desired service type to be queried, the results finder module generates and sends a LoST query message to the LoST server. Once a response is received, the data is parsed and the results are returned back to the results view to be displayed. The modules mentioned are the main modules of the application, however there are other modules that are used to help delegate work and encapsulate data. Examples include modules that perform geocoding, xml parsing, and request building. Further details of the LoST client's internal operation can be found in the program documentation.

The source for this project contains approximately 3227 lines of code and is written in objective-c with Xcode 3.0 IDE.

Program Documentation

The program documentation can be found here.

References

1
T. Hardie, A. Newton, H. Schulzrinne, and H. Tschofenig, LoST: A Location-to-Service Translation Protocol, RFC 5222, August 2008.
2
A. Forte and H. Schulzrinne, Location-to-Service Translation Protocol (LoST) Extensions, IETF Internet Draft (Work in Progress), March 2009.
3
A. Forte and H. Schulzrinne, Classification of Location-based Services, IETF Internet Draft (Work in Progress), March 2009.
4
J. Peterson, A Presence-based GEOPRIV Location Object Format, RFC 4119, December 2005.

Last updated: 2009-09-05 by Webster Ross