DEPARTMENT OF TELEMATICS ENGINEERING Design and development of a dynamic mobile guide using recommendations from affine users Author: Mario Víktorov Mechoulam Nikolaeva Advisor: Juan Vera del Campo May - 2013 2 | P a ge Acknowledgments My most sincere gratitude to everyone who made this possible and believed in me. To my family, whose support has always been there. To the lecturers and friends at UPC, especially those from the Telematics Engineering department. To the Pirate Party, flagship of knowledge freedom. To Jeff Atwood and Joel Spolsky, for creating StackExchange and, particularly, StackOverflow. 3 | P a ge 4 | P a ge Homo homini lupus 5 | P a ge 6 | P a ge Abstract En este proyecto se desarrolla LiveGuide, una guía turística para dispositivos móviles que hace especial énfasis en el dinamismo y personalización de las localizaciones recomendadas a los usuarios. Con LiveGuide, las personas tendrán el contenido de la guía en sus teléfonos móviles o tablets y deberán interactuar con él, mediante comentarios, puntuaciones y posicionamiento real GPS para avanzar y desbloquear nuevos contenidos. La información de la guía es almacenada en un servidor central y puede ser expandida y modificada fácilmente, posibilitando a los clientes sincronizar sus versiones locales. Los usuarios participan con un sistema de puntuación y opiniones que determina en todo momento la valoración de cada localización individual. Además, la información enviada por usuarios afines es analizada y, a través de un sistema de recomendaciones, a los clientes se les proponen nuevos sitios que podrían ser de su interés. El software móvil se ha desarrollado con un framework de alto nivel que abstrae la capa nativa (PhoneGap), permitiendo la portabilidad a cualquier plataforma, y mediante un servicio nativo que se ejecuta en segundo plano y controla la posición GPS del cliente. This project describes the development of LiveGuide, a touristic guide for mobile devices focused on dynamic information and personalized recommendations of new locations. With LiveGuide, people will carry the guide content within their mobile phones or tablets and will have to interact with it, by means of comments, ratings and real GPS position in order to progress and unlock new content. The guide information is stored in a central server and can be easily expanded and modified, allowing clients to synchronize their local databases against it. In addition, the information from affine users is analyzed and, using a recommendation system, users will get a proposal of new places that may find interesting. This feature, linked to a self-categorization of the users, provides a personalized experience for every client. The mobile software is developed with a higher layer framework that abstracts the native layer (PhoneGap), allowing portability to any platform, and includes a native background service for controlling the GPS position of the client. 7 | P a ge 8 | P a ge Table of Contents Acknowledgments ..................................................................................................................................... 3 Abstract ..................................................................................................................................................... 7 Table of Contents ....................................................................................................................................... 9 1 Introduction ..................................................................................................................................... 13 1.1 Purpose of this work ................................................................................................................. 13 1.2 Document structure .................................................................................................................. 14 2 Project insight ................................................................................................................................. 17 2.1 Use cases .................................................................................................................................. 17 2.1.1 Substitution of printed guides ........................................................................................... 17 2.1.2 The game of tourism ......................................................................................................... 17 2.1.3 How can be useful? ........................................................................................................... 18 2.2 Requeriments ............................................................................................................................ 19 2.3 Technologies ............................................................................................................................. 19 2.3.1 JavaEE ............................................................................................................................... 19 2.3.2 Phonegap ........................................................................................................................... 20 2.3.3 jQuery Mobile ................................................................................................................... 21 2.3.4 HTML5SQL ...................................................................................................................... 22 2.3.5 Databases .......................................................................................................................... 23 2.3.6 Communication ................................................................................................................. 24 2.4 Functional analysis ................................................................................................................... 25 2.4.1 Download .......................................................................................................................... 25 2.4.2 Installation and database setup .......................................................................................... 26 2.4.3 Account and profile setup ................................................................................................. 26 2.4.4 Navigating the app ............................................................................................................ 27 2.4.5 Visiting a location ............................................................................................................. 28 2.4.6 The rate and review system ............................................................................................... 29 2.4.7 Upload ............................................................................................................................... 30 2.4.8 Update ............................................................................................................................... 30 2.4.9 Additional features ............................................................................................................ 31 9 | P a ge 2.5 Architecture .............................................................................................................................. 31 2.5.1 Modules ............................................................................................................................. 32 2.5.2 Conclusions ....................................................................................................................... 33 3 Database .......................................................................................................................................... 35 3.1 MySQL ..................................................................................................................................... 35 3.2 SQLite ...................................................................................................................................... 41 4 Server .............................................................................................................................................. 45 4.1 Server structure......................................................................................................................... 45 4.2 Server MVC ............................................................................................................................. 46 4.3 Model........................................................................................................................................ 48 4.3.1 Database set up.................................................................................................................. 48 4.3.2 Object-Relational Mapping ............................................................................................... 50 4.4 Controller.................................................................................................................................. 51 4.4.1 Actions .............................................................................................................................. 55 4.5 Recommendation system .......................................................................................................... 58 4.5.1 Cosine similarity ............................................................................................................... 59 4.5.2 Normalization.................................................................................................................... 60 4.5.3 Implementation ................................................................................................................. 62 4.6 Security ..................................................................................................................................... 65 4.6.1 Database ............................................................................................................................ 65 4.6.2 Queries .............................................................................................................................. 65 4.6.3 Authentication ................................................................................................................... 66 5 Client ............................................................................................................................................... 71 5.1 Client structure ......................................................................................................................... 71 5.2 Application ............................................................................................................................... 73 5.2.1 Lifecycle............................................................................................................................ 74 5.2.2 Background service ........................................................................................................... 82 5.2.3 Geolocation ....................................................................................................................... 88 5.3 Client interaction ...................................................................................................................... 90 5.3.1 Actions .............................................................................................................................. 91 6 Results and future work .................................................................................................................. 93 6.1 Achieved goals ......................................................................................................................... 93 6.1.1 Replacement and enhancement of traditional guides ........................................................ 95 6.1.2 Usability ............................................................................................................................ 95 6.1.3 Performance ...................................................................................................................... 96 6.2 Future work .............................................................................................................................. 97 10 | P a ge
Description: