Advanced Internet Application Development (CS8803) Project Report LOCATION AWARE SOCIAL NETWORK Team 2 诲瞔착瞘 瞚 瞚 Ankur Aggarwal Shobith Alva Prasun AK Johari Gurlal Kahlon 1 Location Aware Social Network Table of Contents 1. High Level Description ............page 3 2. Business Plan ............page 5 3. Use Cases including screen shots ............page 6 3. 1. Use Case #1: Locating a visitor parking area near a certain building. 3. 2. Use Case #2: Pay per potential sale in action. 3. 3. Use Case #3: Route density assessment (Spatial usage statistics) 4. Call flows for the use cases ............page 10 5. Implementation details ............page 13 5. 1. Implementation Details Overview 5. 2. Client Application Architecture 5. 3. Simplified System Architecture 5. 4. Devices / Platforms / Environments 5. 5. Graphical User Interface 6. Source Code Documentation 7. References 2 .............page 21 …………..page 22 Location Aware Social Network 1. HIGH LEVEL DESCRIPTION In our daily lives we face many scenarios where we are surrounded by strangers, and are in need of information and new social connections; but because of social inhibitions we are unable to readily approach those around us. A new student to the campus may not be able to mix with others due to the social and cultural differences. We believe that if we can give this student a simple and convenient platform for exchanging information, we can make his entry into the campus community less overwhelming. In our proposed application we primarily aim to achieve this by facilitating communications between users in vicinity. Once a user is a part of our location aware social network he/she can communicate with other users around him, generate location aware searches etc. His presence at a certain location triggers the creation of a dynamic group. When this new student attends his first lecture, a group consisting of people around him would be created. For him to exchange views and information with those around him now becomes a simple task. He can use this group to find project partners, discuss problems and solutions etc. What makes this dynamic group special is that every member of this group shares a common interest due to the fact that he / she is at the same place at the same time. Knowledge of a user's location, while respecting his privacy, can be exploited by local mobile vendors / business to advertise their services. This knowledge can also be used for providing feedback to service providers. Our proprietary Pay-per-Potential Sale Solution is the first of its kind and provides a tangible way of measuring the effectiveness of location aware advertisements. Our proposed application enables a dynamic, real-time, location aware social network as opposed to the social network models that are prevalent on the Internet -- as a result of which the users can request/gain information about the area in which they are present in real-time. 3 Location Aware Social Network People who are at the same place at the same time usually happen to have some common interests and the goal of our application is to provide an easy way for them to share ideas, thoughts and experiences. The IMS Infrastructure provides a convenient way to introduce this service on a mobile phone. The knowledge of a user's location is obtained from the WhereAmI Service of Georgia Tech. A simple and intuitive graphical user interface makes it easy for the user to navigate through the various services. Creation of dynamic groups based on location and interests, creation of static groups based on interests, ability to share reachability / presence information, instant messaging, a map based GUI, location relevant business search / advertisement, the idea of Pay-per-Potential Sale, ability to provide feedback to advertisers etc. together make our application unique, commercially viable and extremely useful to the campus community. 4 Location Aware Social Network 2. BUSINESS PLAN The success of any business depends on a lot of factors. Whether the idea has potential ? How much are people willing to pay ? What is the market that we are looking at ? All these and many other factors need to be taken into account. We conducted a survey among the Georgia Tech Community about our service and the findings from the survey are as follows: 1. Total number of people surveyed: 25 2. Surprisingly, 60% of the users were not aware of any location aware services being provided for mobile phones. 3. Only about 28% of the users used their phones for browsing the Internet. 4. Only about 28% of the users had any custom applications deployed on their phone. 5. However, 92 % of the users said that they were keen to deploy an application that allowed them to map their own and other people's location. 6. 96 % of the users said that they were keen to look up places within their vicinity while on the move. 5. 72% of the users said that they were keen to chat with users around them 6. Over 50% of the users said that they were keen to form interest groups. Based on this survey, our judgment is that the awareness about location based services is low. But there seems to be a lot of potential given the high percentage of users who desire location based services. 5 Location Aware Social Network 3. USE CASES 3. 1. Use Case #1: Locating a visitor parking area near a certain building. Description: This use-case would demonstrate how our system could function as a dynamic "spatialforum" for requesting guidance. 1) User logs into our service using his username and password. The service matches the username password in the central database. 2) The service receives the user’s location periodically using the location tracking capabilities of the phone / WhereAmI and this enables it to find the neighboring users and relevant ads. 6 Location Aware Social Network 3) The service interface makes available to the user a list of users online in his vicinity and includes him into the local social network 4) The user can now select a set of “service-groups” (like: clothing, food-vendors etc.) and our system will only push information pertaining to those groups. 5) The user, who is interested in finding a possibly free visitor parking area near a certain building would send out a "blast" message asking all the users in the vicinity to guide him/her to a parking lot -which is preferably an unpaid parking area. 6) Some of the users in the vicinity who received this message could have some familiarity with the area and might be in a position to guide the post of the initial message. 3. 2. Use Case #2: Pay per potential sale in action. Description: This use case demonstrates how the "pay-per-potential-sale" system would function in our system. Part 1: Advertisement setup. 1) An active user of our network who is also a mobile vendor and wishes to advertise his/her service on our network on a pay-per-potential-sale basis, registers on our system for advertisement privileges. 2) The vendor is requested to put up a brief informational snippet about his/her business along with its location. 3) At this point, the vendor’s advertisement is said to be active. Part 2: User browsing and potential sale. 1) Any user who moves into the reachable range of the vendor can see an advertisement of the establishment. The indication of this establishment is displayed in a non-intrusive way (e.g. a symbolic icon on a map, depending on the type of service offered). 7 Location Aware Social Network 2) A potential interested customer can interact with the icon to obtain more information about the establishment and a potential sale can be tracked by the system if the customer/user moves closer to it. If the user now spends more than a certain threshold amount of time at that particular establishment's location, our system would consider it to be a sale. 3) The vendor is charged if the above two events happen in unison, thus the vendor doesn't have to pay for advertisements that don't drive value to his establishment. 8 Location Aware Social Network 3. 3. Use Case #3: Route density assessment (Spatial usage statistics) Description: The GT campus transport department wants to assess the density of users of certain routes so that they can better manage their fleet of buses. Our system could provide them with valuable user density information by tapping into our database. 1) Users update the server with information regarding their location periodically. This happens automatically. 2) The server stores a short trail of previous user locations in a database. 3) The server could then use this information to compute density of users in particular areas and at particular times. 4) This information thus derived could be sold to the vendors. 9 Location Aware Social Network 4. CALL FLOWS FOR THE USE CASES 1. The first action performed by the client is Registration with the IMS Network SIP Protocol is used to perform the registration. 2. The client now contacts the WhereAmI Service to obtain its location information 10 Location Aware Social Network The user equipment connects to the host www.rnoc.gatech.edu/whereami/ on port 80 (HTTP) to obtain the XML file containing its location. 3. The location information is now submitted to the Location Server and a list of neighboring users is obtained from the Location Server. 4. The client adds these users to its dynamic group and subscribes to the presence server to learn about their availability / mood. 11 Location Aware Social Network (Image Courtesy: http://www.eventhelix.com/ims/presence/) 5. The user can now monitor the location of the other neighboring users on the map and also monitor their reachability. 12 Location Aware Social Network 5. IMPLEMENTATION DETAILS 5. 1. Implementation Details Overview Our application prototype is developed around on the IMS network. The current implementation exploits many of the services offered by the IMS infrastructure. These include: 1. The Proxy Servers to register new users and the HSS to store / check their credentials. 2. The OMAP Presence Server to monitor each user's status 3. The Group List Management Server to create and maintain groups based on a user's location Our application also makes use of the WhereAmI service of GT to obtain a user's location. Google Map APIs are used to present the location of other users in an easily readable format. 5. 2. Client Application Architecture WhereAmI + Google Maps Main Form Application Instant Message Control IMS Common Presence Control Instant Message Provider Presence Provider Location Provider Win .NET API 13 Location Aware Social Network 5. 3. Simplified System Architecture Group List Management Server Presence Server Location Server User Equipment Mobile / Laptop WhereAmI Google Maps The User Equipment (a mobile phone / laptop) can communicate with each of these servers over WiFi / GPRS. The interactions between the UE and each of these servers / services can be described as follows: 1. UE and the Presence Server • The Presence Server stores each user's current availability status. Information about the user's reachability and his current mood is stored here and is accordingly made available to other users. 2. UE and the Group List Management Server • Our application splits the use of GLM Server into two broad categories: 1. Dynamic Groups • Once a user logs into the IMS system, his location is obtained from the WhereAmI service and forwarded to the Location Server. The Location Server responds to this user by forwarding to him a list of his nearby users' URIs and their exact location. The user (client) application then dynamically creates a group with these users. This facilitates communication and experience / interest exchange between users in a neighborhood. As this is a dynamic group created on the basis of a user's location, the group members would not be permanent and would keep changing as the user's location changes. 14 Location Aware Social Network 2. Static Groups • Static Groups are used by a client or user to become a permanent member of some group. An example of a static group would be a particular course group. Thus a user could become a member of, say the IMS group, and this would allow him to communicate with other members of his class. Creation of a Static Group is not dependent on a user's location, only his interests. 3. UE and the Location Server • The Location Server stores users URIs and their corresponding location information. This information is stored for every user or client who is currently logged on to the system. Additionally, this server also stores Advertisement and Advertiser details. • When a user logs in to the IMS Network, he reports his position to the Location Server through a XML file. <uri>user01@ims.nsn.com</uri> <latitude>19.524</latitude> <longitude>30.541></longitude> <buildingname>TSRB</buildingname> <roomno>104</roomno> • The Location Server responds to this by forwarding another XML file to the client that contains a list of nearby users, advertisers and their details. <Users> <uri>user02@ims.nsn.com</uri> <latitude>19.124</latitude> <longitude>30.441></longitude> <buildingname>Centergy</buildingname> <roomno>5032</roomno> <uri>user03@ims.nsn.com</uri> <latitude>19.124</latitude> <longitude>30.441></longitude> <buildingname>Centergy</buildingname> <roomno>5012</roomno> </Users> <Advertisers> <uri>food@ims.nsn.com</uri> <latitude>19.110</latitude> <longitude>30.121></longitude> <buildingname>Management Building</buildingname> <roomno>None</roomno> <message>Special Happy Hours. Visit between 11 am & 12 pm for free food</message> 15 Location Aware Social Network </Advertisers> • Once such an XML file is obtained by the client, it processes it to plot the locations of other users and advertisers. 4. UE and the WhereAmIService • URL: http://www.rnoc.gatech.edu/whereami/locationService.php • The WhereAmI Service of Gatech allows those users logged on LAWN over WiFi to precisely obtain their location on the campus. This service returns a XML file containing all the details of a user's location. • Issues: 1. The client running on the laptop obtains the XML file and parses the information to obtain the latitude, longitude etc. 2. However, clients running on Windows Mobile Handsets are unable to call the php script and do not obtain the XML file. In this case, we parse the latitude and longitude that is made available by WhereAmI on their main page. • The location information obtained is then forwarded to the Location Server 5. UE and Google Maps Service • Our client uses the Google Maps Service to represent the location of users in a convenient and graphically appealing form. 1. Windows Vista / Laptop UE • Strong support for Java Script is available on Windows Vista based machines. Thus, we make use of the richer java script based APIs of Google Maps for laptops / Vista based clients. • A web browser has been integrated within our client application. A html file with javascript to plot the location of other users is then directed to this web browser. <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>Google Maps IMS</title> <script src="http://maps.google.com/maps?file=api&amp;v=2" type="text/javascript"></script> <script type="text/javascript"> function initialize() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map_canvas")); map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); map.setCenter(new GLatLng(-25.00,135.00), 4); map.setMapType(G_HYBRID_MAP); var tinyIcon = new GIcon(); tinyIcon.image = "http://labs.google.com/ridefinder/images/ 16 Location Aware Social Network mm_20_red.png"; tinyIcon.iconSize = new GSize(8, 16); tinyIcon.iconAnchor = new GPoint(8, 16); markerOptions = { icon:tinyIcon }; var tinyIcon2 = new GIcon(); tinyIcon2.image = "http://labs.google.com/ridefinder/ images/mm_20_blue.png"; tinyIcon2.iconSize = new GSize(8, 16); tinyIcon2.iconAnchor = new GPoint(8, 16); markerOptions2 = { icon:tinyIcon2 }; var polyline = new GlatLng(-23.5,136.6); map.addOverlay(new GMarker(polyline, markerOptions)); var polyline = new GlatLng(-23.7,136.4); map.addOverlay(new GMarker(polyline, markerOptions2)); var polyline = new GlatLng(-24.5,135.6); map.addOverlay(new GMarker(polyline, markerOptions)); } } </script> </head> <body onload="initialize()" onunload="GUnload()"> <div id="map_canvas" style="width: 697px; height: 397px"></div> </body> </html> The above javascript, when executed, returns the following map. 17 Location Aware Social Network 2. Windows Mobile 5 / 6 UE • The support for javascript in these portable devices is weak due to which we cannot make use of the existing APIs. A way around this problem is to use the Static API made available by Google Maps. The Static API returns an image file based on the URL provided to the server. • For example, the following URL returns the following image: http://maps.google.com/staticmap?center=37.423111,122.081783&markers=37.423111,122.081783,red&zoom=13&size=500x300&key=ABQIAAAAUcYc7k3hIcwMdRQ3ftcehQa98Y86SqVzqEAeFyCqrd2MUd8HBQMmHqtxtxxGs9dMRYEI x_PF8wbig 6. UE and Instant Messaging • Instant messaging is possible between the users based on their URIs. The APIs for this are made available in the NSN .NET SDK. 5. 4. Devices / Platforms / Environments Our application has been deployed and tested over three devices. These include: 1. Windows Mobile 6 based mobile phone 2. Windows Mobile 5 based mobile phone 3. Windows Vista based laptop. The following packages had to be installed on the first two devices: 1. Dot Net Compact Framework 2. The NSN .Net IMS SDK 18 Location Aware Social Network The application that has been deployed on the Vista machine makes use of the Dot Net Framework. The applications are written in C# and have built upon the Sample Demo Client Application. 5. 5. Graphical User Interface Different versions of the GUI are developed for the different platforms. A common feature of all the GUIs is that it is easy to navigate and intuitive in its use. Screen shots: The following screen shots are taken from the application running on the Windows Vista laptop. A similar application also runs on the Windows Mobile 5 / 6 based cell phones. 1. User Registered 19 Location Aware Social Network 2. Instant Messaging among users 3. Using the map to see where others are and find local businesses . 20 Location Aware Social Network 6. SOURCE CODE DOCUMENTATION Our Application has been primarily developed over the existing Demo Client Application. The main additions that we've made to the Demo Client application are: 1. Inclusion of the WhereAmI Service 2. Google Maps 3. Partial addition of a Location Server to collect the users' and advertisers location and data. The language used for development is C#. The source code is split into two main sections. 1. Windows 32 application that runs on a laptop or desktop • Laptop or desktop based users can run this application on their machines. Functionality wise, this application is similar to the one that runs on the phone. • Requirements: Dot Net Framework, IMS NSN SDK 2. Windows Mobile application that on a cell phone • This application can be deployed on any Windows Mobile 5 or Windows Mobile 6 based phone. • Requirements: Dot Net Compact Framework, IMS NSN Mobile Setup All the required References are included in the 'References' folder of each project. Please refer to the Readme.txt file within the “Source Code – Group 2” Folder. 21 Location Aware Social Network REFERENCES 1. 2. 3. 4. 5. 6. 7. 22 SIP Event Package for Presence RFC 3856, http://www.ietf.org/rfc/rfc3856.txt Session Initiation Protocol (SIP) RFC 3261, http://www.ietf.org/rfc/rfc3261.txt SIP Basic Call Flow Examples RFC 3665, http://www.ietf.org/rfc/rfc3665.txt Indicating user Agent Capabilities in SIP RFC 3840, http://www.ietf.org/rfc/rfc3840.txt Session Description Protocol (SDP) RFC 2327, http://www.ietf.org/rfc/rfc2327.txt 3G IP Multimedia Subsystem (IMS) by Gonzalo Camarillo and Miguel-Angel García-Martín SIP: Understanding the Session Initiation Protocol by Alan B. Johnston Location Aware Social Network