Social Sensing Application for Smartphone Thesis to Obtain The
Total Page:16
File Type:pdf, Size:1020Kb
SocialSensing - Social sensing application for Smartphone Roberto José Gomes Silva Thesis to obtain the Master of Science Degree in Communications Networks Engineering Examination Committee Chairperson: Prof. Paulo Jorge Pires Ferreira Supervisor: Prof. Rui Manuel Rodrigues Rocha Member of the Committee: Prof. Ricardo Jorge Feliciano Lopes Pereira November 2013 ii Acknowledgments First and foremost, I would like to thank my family for the constant support they gave to me even though I could not spend much time with them because of my academic life. I enjoy the brief moments of their company. I would also like to show my gratitude to my supervisor Prof. Rui Rocha, a respectable, knowledgeable and strict scholar, who has provided me with valuable guidance in every stage of the writing of this thesis. I shall extend my thanks to my wise and patient friend, Joao˜ Fernandes. He has been acting like an older brother since I first arrived in Lisbon. Also, I would like to thank my friend Vitor Mansur for offering me valuable advice. And to my girlfriend, Yao Yien who has been supporting me with her understanding and love throughout all this work. Last but not least, I’ d like to thank my friends Joao˜ Prioste, Joao˜ Rosa, Joao˜ Cardoso, Gonc¸alo Pereira, Nadia Gonc¸alves and Michael Martins for their encouragement and support. To each and every one of you - thank you. iii iv Resumo Os telemoveis´ e as redes sociais tornaram-se parte do quotidiano das pessoas. Estes telemoveis´ contemˆ um conjunto de sensores que fornecem informac¸oes˜ uteis´ ( localizac¸ao,˜ inclinac¸ao,˜ etc) , per- mitindo o surgimento de aplicac¸oes˜ de monitorizac¸ao˜ pessoais e de grupo. No entanto, as aplicac¸oes˜ existentes nao˜ tem em conta que ciclistas andam em grupo. Estas actividades em grupo introduzem uma oportunidade para partilha de recursos entre os elementos do grupo. Esta dissertac¸ao˜ tem por objectivo desenvolver uma plataforma que fornec¸a varios´ benef´ıcios para os ciclistas. Usando uma aplicac¸ao˜ movel´ os ciclistas conseguiram medir dados do seu desempenho e o ambiente do seu per- curso. Quando o ciclista anda em grupo, a aplicac¸ao˜ partilhara´ recursos com o resto da equipa. Esta tambem´ fornece informac¸ao˜ da posic¸ao˜ relativa do utilizador em relac¸ao˜ ao resto da equipa. Caso al- gum membro do grupo tenha posic¸ao˜ absoluta, sera´ usado como ancora para transladar a posic¸ao˜ do resto da equipa para absoluta. Caso algum dos ciclistas perca o rasto da equipa, a aplicac¸ao˜ e´ capaz de fornecer em tempo real a localizac¸ao˜ dos elementos da equipa. O utilizador tambem´ pode usar uma aplicac¸ao˜ web para analisar o seu historico,´ ou planear em avanc¸o um percurso. A avaliac¸ao˜ do sistema foi baseada na veracidade dos dados medidos, no consumo de energia e opiniao˜ dos utilizadores. Palavras-chave: Sensorizac¸ao˜ social, PhoneSensing, Ciclismo, Aplicac¸ao˜ Movel,´ Aplicac¸ao˜ Web, Android, Servic¸os Web, P2P. v vi Abstract The smartphones and the social networks become part of everyday life. Modern smartphones having a set of embedded sensors inside, are able to provide useful information such as location, slope, etc, which are enabling the emergence of personal and group sensing applications. However, most of the existing sensing platforms for cyclists only gather data in a personal level. Quiet often do cyclist perform their activities in group. These groups activities present an opportunity to explore resources sharing among the group elements. This dissertation aims to develop a platform that provides several benefits to the cyclist users on a personal, social and public level. Using a mobile phone application, cyclists will be able to gather fitness and environmental data about their rides. When they cycle in group, the application will share resources with the rest of the group. It will also provide position estimation providing the localization of every cyclist relatively to others in the team. In case absolute location is available in the group, they are used as anchors to translate the relative location to absolute. In addition, if one of the cyclists loses track of the rest of the team, the mobile application provides information about the location of his team mates in real time. Furthermore the user can use a web-based application to analyse his previous rides, or plan in advance his rides. We evaluated the system based on the device sensors/algorithm accuracy, power consume and feedback from cyclists. Keywords: Social Sensing, PhoneSensing, Bicycling, Mobile application, Web application, An- droid, Web Services, P2P. vii viii Contents Acknowledgments........................................... iii Resumo.................................................v Abstract................................................. vii List of Tables.............................................. xiii List of Figures............................................. xvi Nomenclature.............................................. xvii Glossary................................................1 1 Introduction 1 1.1 Motivation and Goals.......................................2 1.2 Challenges............................................2 1.3 Contributions...........................................3 1.4 Organization...........................................3 2 User requirements and typical solutions5 2.1 Type of Service..........................................5 2.2 Architecture............................................6 2.3 Mobile Sensing Networks....................................7 2.4 Social Networks APIs......................................9 2.5 Mobile Application Interaction.................................. 11 2.5.1 User interface....................................... 11 2.5.2 User profile........................................ 11 2.6 Privacy and Security....................................... 11 2.7 Functionality........................................... 12 2.8 Related work........................................... 14 2.8.1 Bikely........................................... 14 2.8.2 Cyclopath......................................... 14 2.8.3 Bikemap.......................................... 14 2.8.4 Nike + sportwatch GPS................................. 15 2.8.5 Endomondo........................................ 15 2.8.6 Biketastic......................................... 16 ix 2.8.7 BikeNet.......................................... 17 2.9 Summary............................................. 18 2.10 Discussion............................................ 19 3 Architecture 21 3.1 Requirements Analysis..................................... 21 3.1.1 Functional Requirements................................ 21 3.1.2 Non-Functional Requirements............................. 22 3.2 Use Cases............................................ 23 3.3 Architecture Design....................................... 24 3.3.1 Back-end......................................... 24 3.3.2 Web Application..................................... 25 3.3.3 Mobile Application.................................... 27 3.3.4 Important Algorithms................................... 32 4 Social Sensing Implementation 36 4.1 Hardware............................................. 36 4.2 Development Environment.................................... 37 4.3 Back-end............................................. 37 4.3.1 Database connector................................... 38 4.3.2 Web Service APIs.................................... 38 4.4 Web Application......................................... 40 4.5 Extending PhoneSensing Framework............................. 42 4.5.1 Audio Client........................................ 44 4.5.2 Inclination Client..................................... 46 4.6 Mobile Application........................................ 48 4.6.1 Application Core..................................... 49 4.6.2 Local Storage....................................... 49 4.6.3 Internet Manager..................................... 50 4.6.4 Location Provider..................................... 51 4.6.5 Social Client....................................... 57 4.6.6 User Interface...................................... 58 5 Evaluation and Results Analysis 61 5.1 Cyclist Experience Mapping................................... 61 5.1.1 Route environment mapping.............................. 61 5.1.2 Social cycling....................................... 63 5.1.3 Comparison with other Application........................... 64 5.2 Comparing distributed and centralized approaches...................... 65 5.3 Evaluating Relative location algorithm............................. 67 x 5.4 User feedback.......................................... 69 5.4.1 Web application..................................... 69 5.4.2 Mobile Application.................................... 70 6 Conclusions 73 6.1 Future Work............................................ 75 A Annexes 77 A.1 Cyclist survey - Functionalities................................. 77 A.2 Web application tasks...................................... 88 A.3 Web application survey..................................... 91 A.4 Mobile application tasks..................................... 96 A.5 Mobile application survey.................................... 99 A.6 Mobile Application Screenshots................................. 103 A.7 Adapter.............................................. 105 Bibliography 109 xi xii List of Tables 2.1 Comparison between the general approaches employed by each cycling application.... 18 4.1 Average values measured during the accuracy tests....................