0% found this document useful (0 votes)
10 views79 pages

Mobile Application Development Usability and Security 1st Edition Sougata Mukherjea Download

The document is a promotional listing for the book 'Mobile Application Development, Usability, and Security' edited by Sougata Mukherjea, published by IGI Global. It includes links to download the book and other related titles in the field of mobile application development. The book covers various aspects of mobile application development, including usability, security, and testing, and is part of the Advances in Multimedia and Interactive Technologies series.

Uploaded by

oazjcoxhz0518
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views79 pages

Mobile Application Development Usability and Security 1st Edition Sougata Mukherjea Download

The document is a promotional listing for the book 'Mobile Application Development, Usability, and Security' edited by Sougata Mukherjea, published by IGI Global. It includes links to download the book and other related titles in the field of mobile application development. The book covers various aspects of mobile application development, including usability, security, and testing, and is part of the Advances in Multimedia and Interactive Technologies series.

Uploaded by

oazjcoxhz0518
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 79

Mobile Application Development Usability And

Security 1st Edition Sougata Mukherjea download

https://ebookbell.com/product/mobile-application-development-
usability-and-security-1st-edition-sougata-mukherjea-6770004

Explore and download more ebooks at ebookbell.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Mobile Application Development Practice And Experience 12th Industry


Symposium In Conjunction With 18th Icdcit 2022 Jagannath Singh

https://ebookbell.com/product/mobile-application-development-practice-
and-experience-12th-industry-symposium-in-conjunction-with-18th-
icdcit-2022-jagannath-singh-48908836

Mobile Application Development With Sms And The Sim Toolkit 1st
Edition Scott Guthery

https://ebookbell.com/product/mobile-application-development-with-sms-
and-the-sim-toolkit-1st-edition-scott-guthery-976766

Mobile Application Development Building Menus And Storing Data


Creating Interactive Menus And Actionbars Using Databases Bhangale

https://ebookbell.com/product/mobile-application-development-building-
menus-and-storing-data-creating-interactive-menus-and-actionbars-
using-databases-bhangale-33696274

Beginning Mobile Application Development In The Cloud 1st Edition


Richard Rodger

https://ebookbell.com/product/beginning-mobile-application-
development-in-the-cloud-1st-edition-richard-rodger-2407156
Professional Mobile Application Development 1st Edition Jeff Mcwherter

https://ebookbell.com/product/professional-mobile-application-
development-1st-edition-jeff-mcwherter-2612164

Phonegap Mobile Application Development Cookbook Gifford Matt

https://ebookbell.com/product/phonegap-mobile-application-development-
cookbook-gifford-matt-2619002

Xamarin Mobile Application Development Crossplatform C And


Xamarinforms Fundamentals Daniel Hermes

https://ebookbell.com/product/xamarin-mobile-application-development-
crossplatform-c-and-xamarinforms-fundamentals-daniel-hermes-43272796

Xamarin Mobile Application Development For Android Mark Reynolds

https://ebookbell.com/product/xamarin-mobile-application-development-
for-android-mark-reynolds-4649012

Javascript Mobile Application Development Hazem Saleh

https://ebookbell.com/product/javascript-mobile-application-
development-hazem-saleh-6673234
Mobile Application
Development, Usability,
and Security

Sougata Mukherjea
IBM, India

A volume in the Advances in Multimedia and


Interactive Technologies (AMIT) Book Series
Published in the United States of America by
IGI Global
Information Science Reference (an imprint of IGI Global)
701 E. Chocolate Avenue
Hershey PA, USA 17033
Tel: 717-533-8845
Fax: 717-533-8661
E-mail: [email protected]
Web site: http://www.igi-global.com

Copyright © 2017 by IGI Global. All rights reserved. No part of this publication may be reproduced, stored or distributed in
any form or by any means, electronic or mechanical, including photocopying, without written permission from the publisher.
Product or company names used in this set are for identification purposes only. Inclusion of the names of the products or
companies does not indicate a claim of ownership by IGI Global of the trademark or registered trademark.
Library of Congress Cataloging-in-Publication Data
Names: Mukherjea, Sougata, 1965- editor.
Title: Mobile application development, usability, and security / Sougata
Mukherjea, editor.
Description: Hershey PA : Information Science Reference, [2017] | Series:
Advances in multimedia and interactive technologies | Includes
bibliographical references and index.
Identifiers: LCCN 2016033134| ISBN 9781522509455 (h/c) | ISBN 9781522509462
(eISBN)
Subjects: LCSH: Mobile apps. | Application software--Development--Management.
| Application program interfaces (Computer software)
Classification: LCC QA76.76.A65 M596 2017 | DDC 005.35--dc23 LC record available at https://lccn.loc.gov/2016033134

This book is published in the IGI Global book series Advances in Multimedia and Interactive Technologies (AMIT) (ISSN:
2327-929X; eISSN: 2327-9303)

British Cataloguing in Publication Data


A Cataloguing in Publication record for this book is available from the British Library.

All work contributed to this book is new, previously-unpublished material. The views expressed in this book are those of the
authors, but not necessarily of the publisher.

For electronic access to this publication, please contact: [email protected].


Advances in Multimedia and
Interactive Technologies
(AMIT) Book Series
Joel J.P.C. Rodrigues
Instituto de Telecomunicações, University of Beira Interior,
Portugal
ISSN: 2327-929X
EISSN: 2327-9303
Mission
Traditional forms of media communications are continuously being challenged. The emergence of user-
friendly web-based applications such as social media and Web 2.0 has expanded into everyday society,
providing an interactive structure to media content such as images, audio, video, and text.
The Advances in Multimedia and Interactive Technologies (AMIT) Book Series investigates the
relationship between multimedia technology and the usability of web applications. This series aims to
highlight evolving research on interactive communication systems, tools, applications, and techniques
to provide researchers, practitioners, and students of information technology, communication science,
media studies, and many more with a comprehensive examination of these multimedia technology trends.

Coverage
• Multimedia Services IGI Global is currently accepting manuscripts
• Multimedia technology for publication within this series. To submit a pro-
• Digital Watermarking posal for a volume in this series, please contact our
• Digital Technology Acquisition Editors at [email protected]
or visit: http://www.igi-global.com/publish/.
• Audio Signals
• Digital Images
• Mobile Learning
• Digital Games
• Gaming Media
• Digital Communications

The Advances in Multimedia and Interactive Technologies (AMIT) Book Series (ISSN 2327-929X) is published by IGI Global, 701 E.
Chocolate Avenue, Hershey, PA 17033-1240, USA, www.igi-global.com. This series is composed of titles available for purchase individually;
each title is edited to be contextually exclusive from any other title within the series. For pricing and ordering information please visit http://
www.igi-global.com/book-series/advances-multimedia-interactive-technologies/73683. Postmaster: Send all address changes to above address.
Copyright © 2017 IGI Global. All rights, including translation in other languages reserved by the publisher. No part of this series may be
reproduced or used in any form or by any means – graphics, electronic, or mechanical, including photocopying, recording, taping, or informa-
tion and retrieval systems – without written permission from the publisher, except for non commercial, educational use, including classroom
teaching purposes. The views expressed in this series are those of the authors, but not necessarily of IGI Global.
Titles in this Series
For a list of additional titles in this series, please visit: www.igi-global.com

Intelligent Analysis of Multimedia Information


Siddhartha Bhattacharyya (RCC Institute of Information Technology, India) Hrishikesh Bhaumik (RCC Institute
of Information Technology, India) Sourav De (The University of Burdwan, India) and Goran Klepac (University
College for Applied Computer Engineering Algebra, Croatia & Raiffeisenbank Austria, Croatia)
Information Science Reference • copyright 2017 • 520pp • H/C (ISBN: 9781522504986) • US $220.00 (our price)

Emerging Technologies and Applications for Cloud-Based Gaming


P. Venkata Krishna (VIT University, India)
Information Science Reference • copyright 2017 • 314pp • H/C (ISBN: 9781522505464) • US $195.00 (our price)

Digital Tools for Computer Music Production and Distribution


Dionysios Politis (Aristotle University of Thessaloniki, Greece) Miltiadis Tsalighopoulos (Aristotle University of
Thessaloniki, Greece) and Ioannis Iglezakis (Aristotle University of Thessaloniki, Greece)
Information Science Reference • copyright 2016 • 291pp • H/C (ISBN: 9781522502647) • US $180.00 (our price)

Contemporary Research on Intertextuality in Video Games


Christophe Duret (Université de Sherbrooke, Canada) and Christian-Marie Pons (Université de Sherbrooke, Canada)
Information Science Reference • copyright 2016 • 363pp • H/C (ISBN: 9781522504771) • US $185.00 (our price)

Trends in Music Information Seeking, Behavior, and Retrieval for Creativity


Petros Kostagiolas (Ionian University, Greece) Konstantina Martzoukou (Robert Gordon University, UK) and
Charilaos Lavranos (Ionian University, Greece)
Information Science Reference • copyright 2016 • 388pp • H/C (ISBN: 9781522502708) • US $195.00 (our price)

Emerging Perspectives on the Mobile Content Evolution


Juan Miguel Aguado (University of Murcia, Spain) Claudio Feijóo (Technical University of Madrid, Spain &
Tongji University, China) and Inmaculada J. Martínez (University of Murcia, Spain)
Information Science Reference • copyright 2016 • 438pp • H/C (ISBN: 9781466688384) • US $210.00 (our price)

Emerging Research on Networked Multimedia Communication Systems


Dimitris Kanellopoulos (University of Patras, Greece)
Information Science Reference • copyright 2016 • 448pp • H/C (ISBN: 9781466688506) • US $200.00 (our price)

Emerging Research and Trends in Gamification


Harsha Gangadharbatla (University of Colorado Boulder, USA) and Donna Z. Davis (University of Oregon, USA)
Information Science Reference • copyright 2016 • 455pp • H/C (ISBN: 9781466686519) • US $215.00 (our price)

701 E. Chocolate Ave., Hershey, PA 17033


Order online at www.igi-global.com or call 717-533-8845 x100
To place a standing order for titles released in this series, contact: [email protected]
Mon-Fri 8:00 am - 5:00 pm (est) or fax 24 hours a day 717-533-8661
Editorial Advisory Board
Karl Aberer, EPFL, Switzerland
Takahiro Hara, Osaka University, Japan
Pushpendra Singh, Indraprastha Institute of Information Technology, India
Gabi Zodik, IBM Haifa Research Lab, Israel


Table of Contents

Preface.................................................................................................................................................. xiv

Chapter 1
MEmoIt: From Lifelogging Application to Research Platform............................................................... 1
Jean-Eudes Ranvier, Ecole Polytechnique Fédérale de Lausanne, Switzerland
Michele Catasta, Ecole Polytechnique Fédérale de Lausanne, Switzerland
Ivan Gavrilovic, Ecole Polytechnique Fédérale de Lausanne, Switzerland
George Christodoulou, Cisco Systems, Inc., Switzerland
Horia Radu, Ecole Polytechnique Fédérale de Lausanne, Switzerland
Tiziano Signo’, Ecole Polytechnique Fédérale de Lausanne, Switzerland
Karl Aberer, Ecole Polytechnique Fédérale de Lausanne, Switzerland

Chapter 2
Mobile Application Testing................................................................................................................... 25
Vijay Ekambaram, IBM Research, India
Vivek Sharma, IBM Research, India
Nitendra Rajput, IBM Research, India

Chapter 3
Accessible and Inclusive Content and Applications.............................................................................. 54
Tom Brunet, IBM, USA
P. G. Ramachandran, IBM, USA

Chapter 4
Combining Static Code Analysis and Machine Learning for Automatic Detection of Security
Vulnerabilities in Mobile Apps.............................................................................................................. 68
Marco Pistoia, IBM Corporation, USA
Omer Tripp, IBM T. J. Watson Research Center, USA
David Lubensky, IBM T. J. Watson Research Center, USA





Chapter 5
Trust Profiling to Enable Adaptive Trust Negotiation in Mobile Devices............................................. 95
Eugene Sanzi, University of Connecticut, USA
Steven A. Demurjian, University of Connecticut, USA
Thomas P. Agresta, University of Connecticut Health Center, USA
Amanda Murphy, Canisius College, USA

Chapter 6
Role-Based Access Control for Mobile Computing and Applications................................................ 117
Yaira K. Rivera Sánchez, University of Connecticut, USA
Steven A. Demurjian, University of Connecticut, USA
Joanne Conover, University of Connecticut, USA
Thomas P. Agresta, University of Connecticut Healthcare Center, USA
Xian Shao, University of Connecticut, USA
Michael Diamond, Pomona College, USA

Chapter 7
A Spatio-Situation-Based Access Control Model for Dynamic Permission on Mobile 
Applications......................................................................................................................................... 142
Xian Shao, University of Connecticut, USA
Steven A Demurjian, University of Connecticut, USA
Thomas P Agresta, University of Connecticut Health Center, USA

Chapter 8
Preserving User Privacy and Security in Context-Aware Mobile Platforms....................................... 166
Prajit Kumar Das, University of Maryland – Baltimore County, USA
Dibyajyoti Ghosh, University of Maryland – Baltimore County, USA
Pramod Jagtap, University of Maryland – Baltimore County, USA
Anupam Joshi, University of Maryland – Baltimore County, USA
Tim Finin, University of Maryland – Baltimore County, USA

Chapter 9
Mobile Location Tracking: Indoor and Outdoor Location Tracking................................................... 194
Sima Nadler, IBM Haifa Research Lab, Israel

Chapter 10
Participatory Sensing for City-Scale Applications.............................................................................. 210
Tridib Mukherjee, Xerox Research Center, India
Deepthi Chander, Xerox Research Center, India
Sharanya Eswaran, Xerox Research Center, India
Koustuv Dasgupta, Xerox Research Center, India


Chapter 11
Mobile Application and User Analytics.............................................................................................. 231
Venkatraman Ramakrishna, IBM Research, India
Kuntal Dey, IBM Research, India

Chapter 12
Mobile + Cloud: Opportunities and Challenges.................................................................................. 260
Pushpendra Singh, Indraprastha Institute of Information Technology, India

Compilation of References................................................................................................................ 280

About the Contributors..................................................................................................................... 308

Index.................................................................................................................................................... 317
Detailed Table of Contents

Preface.................................................................................................................................................. xiv

Chapter 1
MEmoIt: From Lifelogging Application to Research Platform............................................................... 1
Jean-Eudes Ranvier, Ecole Polytechnique Fédérale de Lausanne, Switzerland
Michele Catasta, Ecole Polytechnique Fédérale de Lausanne, Switzerland
Ivan Gavrilovic, Ecole Polytechnique Fédérale de Lausanne, Switzerland
George Christodoulou, Cisco Systems, Inc., Switzerland
Horia Radu, Ecole Polytechnique Fédérale de Lausanne, Switzerland
Tiziano Signo’, Ecole Polytechnique Fédérale de Lausanne, Switzerland
Karl Aberer, Ecole Polytechnique Fédérale de Lausanne, Switzerland

In the recent years, smartphones became part of everyday life for most people. Their computational
power and their sensing capabilities unlocked a new universe of possibilities for mobile developers.
However, mobile development is still a young field and various pitfalls need to be avoided. In this chapter,
the authors present several aspects of mobile development that need to be considered carefully. More
specifically, this chapter covers topics like energy efficient sensing, smart computing, trade-off between
accuracy and simplicity, data storage and cloud integration. These aspects are illustrated based on the
authors’ experience building a lifelogging application for the past two years.

Chapter 2
Mobile Application Testing................................................................................................................... 25
Vijay Ekambaram, IBM Research, India
Vivek Sharma, IBM Research, India
Nitendra Rajput, IBM Research, India

Statistics hold that 80% of the mobile applications are deleted after just one-time use. A significant reason
for this can be attributed to the quality of the mobile application, thus impressing on the need for testing a
mobile application before it is made available on the app stores. At the same time, the mobile application
lifecycle time is shrinking. So while operating systems used to get release about once in a couple of years,
mobile operating systems get updated within months. And talking of apps, new apps are expected to be
built and released in a matter of weeks. This impresses the need for automated mechanisms to do mobile
testing. The space of mobile application testing is challenging owing to the variety of phone devices,
the operating systems and the conditions under which an app can be used by the user in the wild. This
chapter is focused on tools and techniques that are used for automated testing of mobile applications.




Chapter 3
Accessible and Inclusive Content and Applications.............................................................................. 54
Tom Brunet, IBM, USA
P. G. Ramachandran, IBM, USA

As devices have become smaller and more pervasive, usage scenarios that have historically been common
for people with disabilities are finding more general application for all users. Overall, the consideration
of accessibility improves the usability of applications for all users. This chapter will discuss standards
for accessibility, inclusive design, and topics related to the development of accessible mobile content and
applications. The discussion will apply to mobile content, such as EPUB documents, and topics related
to Web, native, and hybrid applications.

Chapter 4
Combining Static Code Analysis and Machine Learning for Automatic Detection of Security
Vulnerabilities in Mobile Apps.............................................................................................................. 68
Marco Pistoia, IBM Corporation, USA
Omer Tripp, IBM T. J. Watson Research Center, USA
David Lubensky, IBM T. J. Watson Research Center, USA

Mobile devices have revolutionized many aspects of our lives. Without realizing it, we often run on them
programs that access and transmit private information over the network. Integrity concerns arise when
mobile applications use untrusted data as input to security-sensitive computations. Program-analysis
tools for integrity and confidentiality enforcement have become a necessity. Static-analysis tools are
particularly attractive because they do not require installing and executing the program, and have the
potential of never missing any vulnerability. Nevertheless, such tools often have high false-positive
rates. In order to reduce the number of false positives, static analysis has to be very precise, but this is in
conflict with the analysis’ performance and scalability, requiring a more refined model of the application.
This chapter proposes Phoenix, a novel solution that combines static analysis with machine learning to
identify programs exhibiting suspicious operations. This approach has been widely applied to mobile
applications obtaining impressive results.

Chapter 5
Trust Profiling to Enable Adaptive Trust Negotiation in Mobile Devices............................................. 95
Eugene Sanzi, University of Connecticut, USA
Steven A. Demurjian, University of Connecticut, USA
Thomas P. Agresta, University of Connecticut Health Center, USA
Amanda Murphy, Canisius College, USA

In order to secure mobile devices, there has been movement to trust negotiation where two entities are
able to establish a measure of mutual trust, even if no prior contact between either entity has existed in the
past. This chapter explores adaptive trust negotiation in a mobile environment as a means to dynamically
adjust security parameters based on the level of trust established during the negotiation process thereby
enhancing mobile security. To accomplish this, the chapter proposes a trust profile that contains a proof
of history of successful access to sensitive data to facilitate identification and authentication for adaptive
trust negotiation. The trust profile consists of a set of X.509 identity and attribute certificates, where


a certificate is added whenever a user via a mobile application makes a successful attempt to request
data from a server where no relationship between the user and server has previously existed as a result
of trust negotiation. Our approach allows the user to collect an ever-growing amount of profile data for
future adaptive trust negotiation.

Chapter 6
Role-Based Access Control for Mobile Computing and Applications................................................ 117
Yaira K. Rivera Sánchez, University of Connecticut, USA
Steven A. Demurjian, University of Connecticut, USA
Joanne Conover, University of Connecticut, USA
Thomas P. Agresta, University of Connecticut Healthcare Center, USA
Xian Shao, University of Connecticut, USA
Michael Diamond, Pomona College, USA

The proliferation of mobile devices has changed the way that individuals access digital information with
desktop applications now performed seamlessly in mobile applications. Mobile applications related to
healthcare, finance/banking, etc., have highly sensitive data where unsecure access could have serious
consequences. This chapter demonstrates an approach to Role-Based Access Control (RBAC) for mobile
applications that allows an information owner to define who can do what by role, which is then enforced
within a mobile application’s infrastructure (UI, API, server/database). Towards this objective, the chapter:
motivates the usage of RBAC for mobile applications; generalizes the structure and components of a
mobile application so that it can be customized by role; defines a configurable framework of locations
where RBAC can be realized in a mobile application’s infrastructure; and, proposes an approach that
realizes RBAC for mobile security. To demonstrate, the proposed RBAC approach is incorporated into
the Connecticut Concussion Tracker mobile application.

Chapter 7
A Spatio-Situation-Based Access Control Model for Dynamic Permission on Mobile 
Applications......................................................................................................................................... 142
Xian Shao, University of Connecticut, USA
Steven A Demurjian, University of Connecticut, USA
Thomas P Agresta, University of Connecticut Health Center, USA

As users are now able to take their mobile devices from location to location, there has been a transition
from a static program running on a PC/laptop to a dynamic application that can adapt based on a variety
of conditions and criteria. This highlights an emerging need to support dynamic permissions of mobile
applications as a user moves from location to location based and perform different actions in particular
situation. This chapter presents a Spatio-Situation-Based Access Control model that extends role-
based access control to secure sensitive data for mobile applications with the ability to make dynamic
authorization decisions according to the time/location and the particular situation being encountered by
a user. To demonstrate the feasibility of the work, a realistic healthcare scenario examines the complex
workflow of treating a patient by a physician utilizing a mobile health (mHealth) app to access patient
data, as she/he moves among multiple locations at different times throughout the day/week requiring
access to different patient data repositories at different times.


Chapter 8
Preserving User Privacy and Security in Context-Aware Mobile Platforms....................................... 166
Prajit Kumar Das, University of Maryland – Baltimore County, USA
Dibyajyoti Ghosh, University of Maryland – Baltimore County, USA
Pramod Jagtap, University of Maryland – Baltimore County, USA
Anupam Joshi, University of Maryland – Baltimore County, USA
Tim Finin, University of Maryland – Baltimore County, USA

Contemporary smartphones are capable of generating and transmitting large amounts of data about their
users. Recent advances in collaborative context modeling combined with a lack of adequate permission
model for handling dynamic context sharing on mobile platforms have led to the emergence of a new
class of mobile applications that can access and share embedded sensor and context data. Most of the
time such data is used for providing tailored services to the user but it can lead to serious breaches of
privacy. We use Semantic Web technologies to create a rich notion of context. We also discuss challenges
for context aware mobile platforms and present approaches to manage data flow on these devices using
semantically rich fine-grained context-based policies that allow users to define their privacy and security
need using tools we provide.

Chapter 9
Mobile Location Tracking: Indoor and Outdoor Location Tracking................................................... 194
Sima Nadler, IBM Haifa Research Lab, Israel

One of the key things that differentiate mobile devices from static computing platforms is the ability
to provide information about the device user’s location. While the raw location is often useful, it is the
ability to understand the user’s context that makes this capability so powerful. This chapter will review
the technologies used today to provide location tracking of mobile devices and which are best for different
types of use cases. It will also address challenges associated with location tracking, such as accuracy,
performance and privacy.

Chapter 10
Participatory Sensing for City-Scale Applications.............................................................................. 210
Tridib Mukherjee, Xerox Research Center, India
Deepthi Chander, Xerox Research Center, India
Sharanya Eswaran, Xerox Research Center, India
Koustuv Dasgupta, Xerox Research Center, India

The rapid advancements in sensing, computation and communications have led to the proliferation of
smart phones. People-centric sensing is a scientific paradigm which empowers citizens with sensor-
embedded smartphones, to contribute to micro and macro-scale urban sensing applications – either
implicitly (in an opportunistic manner) or explicitly (in a participatory manner). Community-based urban
sensing applications, are typically participatory in nature. For instance, commuters reporting on a transit
overload may explicitly need to provide an input through an app to report on the overload. This chapter
will focus on the trends, challenges and applications of participatory sensing systems. Additionally, they
will understand the solution requirements for effective deployments of such systems in real scenarios.


Chapter 11
Mobile Application and User Analytics.............................................................................................. 231
Venkatraman Ramakrishna, IBM Research, India
Kuntal Dey, IBM Research, India

Mobile analytics is the systematic study of mobile device and application usage, and application
performance, for the purpose of improving service quality. This chapter motivates the need for mobile
analytics as an essential cog in the emerging economy built around devices, applications, and communication.
A taxonomy of mobile analytics problems is presented, and technical details of a typical mobile analytics
solution are discussed. Scale, heterogeneity, dynamically changing environments, and diverse privacy
requirements pose challenges to collecting and processing data for such analysis. This chapter examines
how analytics solutions handle these challenges. The core of the chapter consists of a technical section
describing the general architecture of a mobile analytics solution, procedures to collect and process data,
event monitoring infrastructure, system administration processes, and privacy management policies. Case
studies of a number of analytics solutions available as commercial products or prototypes are presented.

Chapter 12
Mobile + Cloud: Opportunities and Challenges.................................................................................. 260
Pushpendra Singh, Indraprastha Institute of Information Technology, India

A mobile phones provides portability and personalized computing with ubiquitous connectivity. This
combination makes them an ideal choice to use for various applications of personal use. The portability
of mobile devices is the most important and useful feature of mobile devices. However, portability is
achieved at the high cost of limited power and computation ability of the mobile device. Cloud computing
fulfills the need of providing more computation power to complete the tasks that cannot be done on a
mobile platform. The cloud provides an always available platform and do not have typical limitations,
e.g. limited battery and computation power, of mobile platforms. Therefore combining cloud computing
with mobile provides us best of both worlds i.e. we have a computing platform available for us all the time
which we move, and yet we can access services and perform tasks that require high-power computation.

Compilation of References................................................................................................................ 280

About the Contributors..................................................................................................................... 308

Index.................................................................................................................................................... 317
xiv

Preface

INTRODUCTION

It’s no secret that the smart phone has become one of the most important devices in our lives. We use
it for interacting with each other, entertainment as well as for performing various day to day activities.
There are now more mobile devices than people in the world. Mobility is also impacting business sig-
nificantly and most enterprises are providing services to facilitate their mobile workforce. More of us
are using mobile technologies at work. In fact, use of mobile in the enterprise is growing at about 25%
per year (Markets and Markets, 2014).

THE DIFFERENT ASPECTS OF MOBILITY

Most mobile devices use one of the two dominant operating systems: Google-developed Android and
the Apple-developed iOS. Market shares of other mobile platforms like Windows and Blackberry are
diminishing. Users interact with the smart phones using various mobile applications. As expected in
recent days mobile applications have become extremely popular - among consumers as well as in the
enterprise. There are three types of mobile application:

• Native apps live on the device and are accessed through icons on the device home screen. They
are developed specifically for one Operating System and can take full advantage of all the device
features. Native apps are installed through an application store (such as Google Play or Apple’s
App Store).
• Web apps are not real applications; they are really websites that, in many ways, look and feel like
native applications, but are not implemented as such. They are run by a browser and typically
written in HTML5.
• Hybrid apps are part native apps, part web apps. Like native apps, they live in an app store and can
take advantage of the many device features available. Like web apps, they rely on HTML being
rendered in a browser, with the caveat that the browser is embedded within the app.

The Mobile Application Lifecycle contains different stages from development of the application, to
its testing and deployment. Creating mobile applications has some unique challenges. The developer
first needs to decide whether to create native, web or hybrid app (Badiu, 2013). Research shows that out
of the two dozen apps each of us have on our phones, we spend 80% of our time on just five of them



Preface

(Husson, 2015). Therefore the application has to provide a superior customer experience to be attractive
to the end users. Some of the requirements are being user firendly, having superior performance and
not draining the battery. Testing all aspects of the app before it is released is also essential. Moreover
accessibility of the application - ensuring that every person is able to access information and perform
tasks regardless of that person’s physical or cognitive capabilities - is another important requirement.
In these days we utilize the mobile phone to handle sensitive data; for example financial data from a
banking app, corporate data from an enterprise app as well as medical data from a healthcare app. Moreover
for most of us, our mobile device is within arm’s reach 90% of the time; therefore we sometimes use the
applications even using an insecure connection. This makes the sensitive data on our phone extremely
vulnerable. Thus mobile security is an extremely important topic. In the race for mobile mind share, it
is tempting to prioritize speed over security. In fact, about 65% of companies admit that the security of
mobile applications is sometimes put at risk to meet customer demand. But at any given moment, mali-
cious code is infecting 11.6 million of our mobile devices (Ponemon Institute, 2015).
One of the advantages of the smartphone is that it enables the determination of the context of the user
using sensors on the smart phones. For example the GPS can give us the location of the user while the
accelerometer can give the state of the user (whether she is static or in motion). This enables the creation
of various very innovative context-aware apps (Chen & Kotz, 2000). However consumer concerns about
the privacy of their personal sensitive information are at an all-time high. Therefore ensuring the privacy
of the user’s data is absolutely essential. In recent years regulators have increasingly turned a watchful
eye to ensure the privacy of the mobile user (Bohorquez & Felz, 2016).
Once the application has been developed one needs to analyze the applications to determine how it
is being utilized by the end user. Mobile Analytics can help determine the impact a mobile application
has on a company’s business. Such analysis can discover any deficiencies in the application so that the
problems can be quickly rectified. The analysis can also give insights on how to make the application
more useful for the consumers. Predictive analytics can discover problems even before they occur. On
the other hand Prescriptive analytics provide actionable insights that will move businesses forward by
not only indicating exactly what the issues are, but also suggesting which measures need to be taken to
correct them. A recent report by the Aberdeen Group found companies using mobile analytics saw an
11.6 percent increase in brand awareness while those without a mobile-specific analytics strategy had a
12.9 percent decrease (Minkara, 2014).
Most mobile applications need to interact with various backend services. For example Push notifica-
tions let an application notify a user of new messages or events even when the user is not actively using
the application. In many cases these backend services are hosted in the cloud. Cloud services are a good
match for supporting mobile devices. Mobile applications tend to have time variable usage patterns that
are well handled by the scalability and elasticity of cloud computing - increasing and decreasing the
backend resources to match the level of requests from the mobile devices. It is also characteristic of mobile
applications to make use of server-side data. Thus the interaction of mobility and cloud is an important
topic. The Cloud Standards Customer Council (CSCC) has developed Mobile Cloud Architecture (Cloud
Standard Customer Council, 2015) to showcase the interaction of mobile devices and cloud services.

OBJECTIVE OF THE BOOK

This book covers important topics from the major areas of Mobility:

xv
Preface

• Mobile Application Development: We focus on the challenges of mobile application develop-


ment, Mobile Testing and Accessibility.
• Mobile Security: Since Mobile Security is an extremely important topic several chapters are
dedicated to the different aspects of Mobile Security. We look at how security can be ensured by
program analysis as well as various ways to control access to sensitive data.
• Context-Aware Applications: We explain different techniques to track the location of the user.
Some challenges of context-aware applications, specially ensuring privacy of the data, are also
discussed. We also introduce an innovative participatory sensing application which makes use of
mobile sensors.
• Mobile Analytics: A comprehensive survey of Mobile Application and User Analytics is
presented.
• Mobile and Cloud: We discuss the synergy between Mobile and Cloud and explain the chal-
lenges and opportunities of Mobile Cloud Computing.

Some chapters survey important areas of Mobility while other chapters describe some key research
challenges and present their solutions. This comprehensive publication aims to be an essential reference
source and builds on the available literature in this field. Academicians, researchers, advanced-level stu-
dents and mobile application developers will find this text extremely useful in furthering their research
exposure to pertinent topics in this area that is becoming more and more popular and important.

ORGANIZATION OF THE BOOK

The book is organized into twelve chapters. A brief description of each of the chapters follows:
Chapter 1 discusses three key aspects Mobile application development:

1. Smart and incremental computation to improve battery consumption,


2. The trade-offs that can be made between accuracy and simplicity of the data-processing algorithms,
and
3. Data storage and privacy aspects, i.e., which information should effectively leave the user’s
smartphone.

The authors showcase the development of an efficient life-logging Android1 application, MEmoIt
based on these three aspects.
Chapter 2 surveys a key aspect of Mobile Application development – the testing of the applications.
It discusses three key forms of mobile testing. Functional testing is performed to ensure functionality,
i.e. to test whether the application is performing the functions that it was designed for. Performance
testing is conducted to determine how optimal the application is, in terms of its compute resource usage,
battery usage and latency related issues. And finally, Usability and Accessibility testing aims to capture
how easy it is for users to be able to work with the applications to execute the functions for which the
application is designed.
Chapter 3 digs deeper into the important area of accessibility of the mobile applications. The mobile
evolution has brought two areas of Accessibility closer together. People who rely on assistive technolo-
gies are able to participate in ways that have been historically unavailable to them. On the other hand,

xvi
Preface

as people are performing more tasks on devices that are smaller and using them in situations where they
may not be able to look at or hear the device, these individuals require assistive technologies that have
traditionally focused on people with severe disabilities.
Chapter 4 introduces Phoenix, a novel solution that combines static program analysis with machine
learning to ensure that no private information is exposed to unauthorized observers in a mobile applica-
tion. Phoenix uses relatively scalable static analysis to approximate possible program behaviors, and
then applies machine learning in order to identify programs exhibiting suspicious sequences of opera-
tions. This solution has been widely applied to mobile applications obtaining impressive results, with
low false-positive and false-negative rates.
To secure mobile devices, there has been increasing focus on Trust negotiation, a procedure whereby
two entities are able to establish a measure of mutual trust, even if no prior contact between either entity
has existed in the past. Adaptive trust negotiation refers to the ability to dynamically adjust security
parameters based on the level of trust established during the negotiation process. Chapter 5 explores the
feasibility and utility of adaptive trust negotiation and its suitability for a mobile healthcare application.
Chapter 6 also looks into the security aspects of mobile healthcare application. It presents the ben-
efit of utilizing role-based access control (RBAC) which allows the information owner to specify how
much access other users have on the information based on their roles. For example this enables patients
to grant access of their electronic health and fitness information to different individuals (e.g., primary
physicians, spouse, family, emergency medical providers, etc.) at varying levels of granularity. RBAC is
used by the mobile application to determine the ability of a user to view or modify medical information.
Chapter 7 proposes and discusses the Spatio-Situation-Based Access Control (SSBAC) model that
combines features from existing access control models (like Role-Based Access Control, Spatio-temporal
Access Control, Situation-Based Access Control, Workflow-Based Access Control, etc.) with new ca-
pabilities for the dynamic enforcement of security as a user moves among various locations with his/her
mobile device and associated applications over time and distance. This concept is applied to a mHealth
application, to constrain access to different health IT systems as a medical provider moves in both space/
time and by the situation so that the application can dynamically adapt to the environments and allow
or deny the access to specific data.
Chapter 8 focuses on the work done in the Platys project for the privacy and security aspects of
context-aware mobile applications. It presents a fine-grained context driven access control mechanism
for the apps. Context in Platys is generated by leveraging capabilities of smartphones. This allows an
app on the phone to capture key elements of context: like the user’s location and, through localization,
characteristics of the user’s environment, etc. The context is represented using Semantic Web technologies
which allow handling of various data flow scenarios from and through users’ mobile devices. Access
control policies are then defined to reduce security and privacy risks.
Location-based services have become very popular both in the general public and enterprises, with
the advent of smartphones and other sophisticated mobile devices. While many people are accustomed
to using such services, knowledge of how they work, and which underlying technologies are most ap-
propriate for different types of use cases, remains limited even to experienced developers. Chapter 9
describes the different types of location tracking technologies, their advantages and disadvantages as
they relate to different use cases, as well as the challenges associated with the technologies and location
tracking in general.
Participatory sensing empowers citizens with sensor-embedded hand-held devices to contribute to
micro and macro-scale urban sensing applications. Chapter 10 focus on a novel Urban Sensing Platform

xvii
Preface

(USP) that aggregates data from an eco-system of data sources (e.g., mobile sensing data, social me-
dia, web-based public forums, as well as the civic agencies’ internal data) to derive valuable insights.
Challenges in terms of architecting the platform to gather and aggregate data in a scalable manner are
discussed. The aggregated data is then categorized to create meaningful summaries of reports gathered
by the platform. This chapter also describes a data veracity framework that determines data veracity in
participatory sensing systems. Finally, a case study of a participatory sensing deployment for develop-
ing regions is presented.
Chapter 11 is a comprehensive survey of Mobile Analytics. The chapter begins with a taxonomy of
mobile analytics problems and then discusses the technical details of a typical mobile analytics solution.
Scale, heterogeneity, dynamically changing environments, and diverse privacy requirements, pose chal-
lenges to collecting and processing data for such analysis. This chapter examines how analytics solutions
handle these challenges. The core of the chapter consists of a technical section describing the general
architecture of a mobile analytics solution, procedures to collect and process data, event monitoring
infrastructure, system administration processes, and privacy management policies. Case studies of a
number of analytics solutions available as commercial products or prototypes are introduced.
Chapter 12 focuses on Mobile Cloud Computing which can be defined as a combination of ubiqui-
tous connectivity of mobile device and elastic resources of the cloud to enable a computing and storage
platform for providing unrestricted mobility, personalization, storage, and computing on the go. The
chapter discusses the core techniques and novel applications of mobile cloud computing as well as the
challenges faced by mobile cloud systems. The chapter concludes by highlighting opportunities and
future research areas in the field of mobile cloud computing.

Sougata Mukherjea
IBM, India

REFERENCES

Badiu, R. (2013). Mobile: Native apps, web apps, and hybrid apps. Retrieved from https://www.nngroup.
com/articles/mobile-native-apps/
Bohorquez, F. A., Jr., & Felz, J. N. (2016). 2016 mobile data privacy and security update and 2015
review. Retrieved from http://www.dataprivacymonitor.com/mobile-privacy/2016-mobile-data-privacy-
and-security-update-and-2015-review/
Chen, G., & Kotz, D. (2000). A survey of context-aware mobile computing research. Technical Report
TR2000-381. Dept. of Computer Science, Dartmouth College.
Cloud Standard Customer Council. (2015). Customer cloud architecture for mobile. Retrieved from
http://www.cloud-council.org/CSCC-Webinar-Customer-Cloud-Architecture-for-Mobile-6-16-15.pdf
Husson, T. (2015). Five myths about mobile apps. Retrieved from http://blogs.forrester.com/thomas_
husson/15-01-30-five_myths_about_mobile_apps

xviii
Preface

Markets and Markets. (2014). Bring your own device (BYOD) & enterprise mobility market global ad-
vancements, market forecast and analysis (2014 – 2019). Retrieved from http://www.marketsandmarkets.
com/PressReleases/byod.asp
Minkara, O. (2014). Mobile analytics: Precision marketing across mobile touch-points. Retrieved from
http://aberdeen.com/research/9364/RR-mobileanalytics.aspx/content.aspx
Ponemon Institute. (2015). The state of mobile application insecurity. Retrieved from http://www.work-
placeprivacyreport.com/wp-content/uploads/sites/162/2015/03/WGL03074USEN.pdf1

xix
1

Chapter 1
MEmoIt:
From Lifelogging Application
to Research Platform

Jean-Eudes Ranvier George Christodoulou


Ecole Polytechnique Fédérale de Lausanne, Cisco Systems, Inc., Switzerland
Switzerland
Horia Radu
Michele Catasta Ecole Polytechnique Fédérale de Lausanne,
Ecole Polytechnique Fédérale de Lausanne, Switzerland
Switzerland
Tiziano Signo’
Ivan Gavrilovic Ecole Polytechnique Fédérale de Lausanne,
Ecole Polytechnique Fédérale de Lausanne, Switzerland
Switzerland
Karl Aberer
Ecole Polytechnique Fédérale de Lausanne, Switzerland

ABSTRACT
In the recent years, smartphones became part of everyday life for most people. Their computational
power and their sensing capabilities unlocked a new universe of possibilities for mobile developers.
However, mobile development is still a young field and various pitfalls need to be avoided. In this chapter,
the authors present several aspects of mobile development that need to be considered carefully. More
specifically, this chapter covers topics like energy efficient sensing, smart computing, trade-off between
accuracy and simplicity, data storage and cloud integration. These aspects are illustrated based on the
authors’ experience building a lifelogging application for the past two years.

INTRODUCTION

With the advent of smartphones and the evolution of mobile OSs offering ever more capabilities, the
development of mobile applications became a leading activity in information technology. From mobile
games to productivity-oriented applications, the market of mobile applications is blossoming. However,
as a relatively novel field, it took inspiration from its computer counterpart, which led to many challenges,

DOI: 10.4018/978-1-5225-0945-5.ch001

Copyright © 2017, IGI Global. Copying or distributing in print or electronic forms without written permission of IGI Global is prohibited.

MEmoIt

as the computer specifications do not match those of a mobile device. In recent years for example, due
to the increase of mobile web browsing, the web industry has had to depart from the classic interfaces
based on wide screens and mouse interactions, in order to support vertical screens and touch-screen
capabilities as well; This leads to the creation of new frameworks and new methodology.
This chapter will present three aspects of the development of mobile applications; These aspects need
to be readapted in order to comply with the limitations of mobile platforms and to be compatible with
fast-paced development cycles. These aspects are specifically:

1. Smart and incremental computation to improve battery consumption,


2. The trade-offs that can be made between accuracy and simplicity of the data-processing algorithms,
and
3. Data storage and privacy aspects, i.e., which information should effectively leave the user’s
smartphone.

The mobile environment is very restricted: Although its memory is reaching that of low-end laptops,
its processing power is still relatively low, and although the battery duration of a smartphone is longer
than the ones of laptops, the latter are not meant to last a full day on battery. In order to improve the
overall usability of the phone, mobile applications should be extremely battery efficient and smart in
their computation. Furthermore, the pace of the evolution of the SDKs and mobile frameworks forces
mobile development to become faster and incremental. Algorithm complexity is often the synonym of
computational cost -- for this reason, it is important for application components to be simple. Finally,
privacy is a rising concern. In order not to disclose the overwhelming amount of user related data that
can be acquired by mobile devices, it is necessary to select which piece of data should effectively leave
the user’s device.
These optimizations are illustrated based on the life-logging Android application, MEmoIt, that the
authors have developed in the last two years. It shows the challenges met, and explains the choices made
in this project.

BACKGROUND

Local Processing and Resource-Hungry Operations

The computing capabilities of smartphones remains very limited compared to single servers or cloud
infrastructures. Furthermore, digital economy analysts agree that data is the new oil. These two facts
combined, led most companies to rely on the cloud to store data and/or perform heavy computation.
However, recently, privacy issues have been brought to light (Chen & Zhao, 2012; Xiao & Xiao, 2013).
Hence, to address users concerns about what usage is made of their data, some companies departed from
this model to return to on-device computation. For instance, the health-related data collected by Apple
Healthkit (Apple, n.d.) are stored and encrypted locally, and a strict access control regulates the applica-
tions that want to read it. Another advantage of local processing is the ability to provide a service that
degrades gracefully when an Internet connection cannot be established. Google translate (n.d.) and Google
navigation systems (Google Play, n.d.) are examples of such services, which can now be queried offline.

2

MEmoIt

Location-Based Services

Smartphones gave to GPS, and localization mechanisms in general, a new purpose. However, when used,
GPS sensors drain the battery significantly. Despite technological improvements at the sensor level,
such as the Assisted “A-GPS”, continuously acquiring the precise localization information, is generally
costly. Several approaches have been taken to solve this problem, such as adapting the rate at which the
GPS sensor is activated (Paek, Kim & Govindan, 2010). The Android ecosystem abstracts this problem
by proposing a geofencing API that handles the calls to the GPS sensor.
In addition to being able to know her exact location, the user also gains access to additional location-
based services. One of them is the detection of places of interests (PoI) as described by Montoliu (Mon-
toliu, & Gatica-Perez, 2010). Places of interests are defined as geographical regions having a semantic
meaning (e.g. a cinema, a restaurant, a landmark), where the user stayed for a certain amount of time.
This definition is instrumental in the comprehension of users’ behaviors at a semantic level. An applica-
tion of this abstraction is the recommendation of PoI (Baltrunas, Ludwig, Peer, & Ricci, 2011) or the
well-known check-in service of Foursquare (n.d.).

Local-Data Management

Data persistence is a key component of mobile applications, and choosing the right data management
system is often not straightforward. Mobile operating systems propose out-of-the-box multiple persistence
options, each serving a different purpose. Android, for instance, proposes a key-value system, a public
and private storage on disk and an SQLite database (Developers, n.d.). In the recent years, a number of
databases emerged offering alternatives to the original android implementation (Ostrovsky, & Rodenski,
2014). Couchbase lite (Couchbase, n.d.), for example, proposes an embeddable document-based database.
Realm (n.d.) is an Android library proposing a relational model accessible through object-relational
mapping (ORM) and is a strong contender against the SQLite system of Android.

Cloud Interaction

Despite the risks that represent sending data to the cloud, it is sometimes unavoidable: for example, to
synchronize an account with a desktop application (i.e., for synchronization purposes) or to aggregate
the data coming from multiple users. To facilitate the exchange of data between the cloud and the mo-
bile device, various alternatives exist, Parse Server (n.d.) proposes to seamlessly store data objects on
the cloud and access them from the mobile application, as if the storage was local. Another approach
is taken by Amazon Web Service14 (AWS) and Google Cloud plateform15 (GC), which provide librar-
ies to exchange data with the cloud. In addition to the storage service, they also provide powerful data
processing tools at low cost.

MEmoIt PERSPECTIVES

The goal of MEmoIt is to reconstruct the daily life of the user into a digital diary. In order to detect
significant activities, and to abstract these activities into routines and memorable events, the Android
application uses both hardware and software sensors data. MEmoit captures the phone activities that

3

MEmoIt

are related to the soft sensor of the phone, specifically calendar events, pictures taken, and applications
used. Also, the physical world activities are detected through the use of GPS readings in order to infer
the user activity. In a second phase, MEmoit is also meant to be a research platform where researcher
can conduct user experiments. For this purpose, MEmoit has the capability of running the code of the
user studies directly on the mobile, and sending to a research server the results of these experiments. For
privacy reasons, these results are anonymized before being presented to the researchers.

Local Processing and Resource-Hungry Operations

MEmoIt deals with very sensitive data about the user, and it would be critical to send these data to a remote
server in a raw format. Therefore, a fundamental requirement of the application is to process user-data
directly on device. However, in order to keep the battery consumption of MEmoIt within an acceptable
range, data processing should be done in a smart way. Two aspects will be described in this chapter.
The first one addresses the use of incremental and smart algorithms to only have marginal updates on
the models of the user, instead of rebuilding it from zero. Although, incremental algorithms are a neat
solution for reducing processing time, some operations will always be computationally expensive. The
second aspect will therefore cover recommendations as to when to perform computation. In MEmoIt,
the detection of memorable events is also done through software sensors (exceptional phone calls /
SMSs that the user receives, a day with more pictures taken than usual, etc.) The algorithms developed
to detect these events are relatively expensive and do not need to be run in real time. For these reasons,
the authors exploit the Android API to detect when the phone is charging in order to run heavy tasks at
that time. This implementation has the triple advantage of saving battery energy during the day while
keeping the phone responsive when the user needs it; and finally, due to the short battery duration of
smartphone, ensuring that the algorithms are run on average once per day.

Location-Based Services

Another aspect of the MEmoIt diary is the logging of a user’s activity in the physical world. This is
achieved by detecting the PoI of the user and, if no prior knowledge about this place is in the system,
asking the user to describe her activity. However, existing algorithms for the detection of PoI are es-
sentially non-incremental and require the full GPS trace to be available.
In order to keep the application battery-friendly and to be in line with the policy of incremental
algorithms of MEmoIt, the authors initially studied the incremental clustering algorithm, ESOINN
(Furao, Ogura, & Hasegawa, 2007). This algorithm was chosen for its capacity to cluster spatial points
in an incremental fashion and without the need to know a-priori the number of clusters. However, the
processing required by the algorithm and the need for continuous sensing made this approach still bat-
tery intensive. Furthermore the complexity of the algorithm made it impractical to maintain. To avoid
continuous GPS sensing and to focus on transition between points of interest exclusively, the authors
decided to leverage the geofencing API (Developers, n.d.) exposed by Android. Combined with a simpler
algorithm based on finite state machine, this approach enables MEmoIt to achieve similar performances
to ESOINN in the detection of points of interest for the user and to reduce battery consumption. Once
the places of interests are detected, a final abstraction enables MEmoIt to detect a user’s patterns of
activities and to group them into routines, according to the algorithms presented by Ranvier in (Ranvier,
Catasta, Vasirani, & Aberer, 2015).

4

MEmoIt

Local-Data Management

As stated previously, MEmoIt collects very sensitive information about the user’s life and in order to
protect the user’s privacy, the data remains on the phone and is processed locally. The initial imple-
mentation of MEmoIt used the built-in SQLite database provided by Android. It proposes a relational
model suitable for storing the structured data gather by the application. However, the Android standard
implementation involves many boilerplates and utility classes that decrease the readability and flex-
ibility of the code, while proposing mediocre performances. MEmoIt recently moved from this original
Android system to the Realm library. This library proposes an object-relational mapping that is based
on a specific serialization. The migration greatly reduced the size of the codebase, and improved the
overall performance of the app.

Cloud Interaction

MEmoIt also has a vocation to be a research platform. For this purpose, data needs to be exchanged be-
tween the research server and MEmoIt. Following the approach proposed by de Montjoye (de Montjoye
et al., 2014), the authors propose an architecture in which the code that runs a user-study is sent to the
device and executed; only the results, in the shape of aggregates, are sent back to the server, therefore
contributing to the anonymization of the users. Due to its quality and its coherent integration with the
Android ecosystem, MEmoit uses the Google Cloud platform to store and process the data sent by the
users.
This shift towards the cloud, however, raises concerns about the security and the privacy of the data
(Chen, & Zhao, 2012; Xiao, & Xiao, 2013; Lu et al., 2015). Without proper encryption, an attacker who
gains access to the back-end could obtain a vast amount of raw data about the users. It is very well known
in the literature that, given enough data points per user, datasets can be de-anonymized with a high suc-
cess rate. Therefore, the authors are currently exploring solutions such as homomorphic encryption and
differential privacy, which would enable the encrypted data to be stored, while being able to process the
aggregates in order to extract statistics, identify correlations, etc.
Furthermore, a notion of trust needs to be established between three entities: The user, the authors
and the researcher running the user studies. Indeed, users entrust the authors with sensitive information,
and the authors are liable for the information they provide to the researcher and therefore should be cau-
tious of malicious researchers. For this purpose, several tools can be applied. First, to ensure the trust
of the user, the authors should provide a valid privacy-policy accessible from the application. Second,
in view of transparency, the MEmoit source code should be released in open-source, in order for the
user to understand what is exactly is being done with her data. By corollary, user studies designed by
researchers should also be open-sourced. Furthermore, a manual approval of the studies will prevent
abuse of the system. These privacy elements represent the last missing building-blocks for the promotion
of MEmoIt as a privacy-aware research platform.

LOCAL PROCESSING AND RESOURCES-HUNGRY OPERATIONS

In order to be performed locally, data processing must be carefully implemented. Running an algorithm
with a complexity of O(n^3) on an increasing dataset would quickly reach unacceptable runtime. This

5

MEmoIt

section presents a selection of solutions for keeping the computation time within an acceptable range. It
focuses primarily on reducing the dataset used by the algorithm. Splitting the dataset or having a slid-
ing window can reduce the computation cost drastically. Another solution consists in using incremental
algorithms in order to compute only delta quantities that essentially take into account the most recent
data to update a model. The last option discussed in this chapter concerns the time of the day at which
the processing should be performed. Indeed, a heavy load on the CPU could result in slowing down ap-
plications that the users are currently using in the foreground. For this reason, and to save energy, it is
worth considering running heavy computation during the night or while the phone is charging and not
in use. These options are illustrated, in the case of MEmoit, in the remainder of this section.
As a digital diary, MEmoIt logs memorable events. Along with activities that the user performs,
phone calls at unusual hours or with unusual acquaintances, pictures that are taken in an unusual amount
qualify as being memorable. For this reason, a set of software sensors was added to the hardware sensors.
These software sensors are:

• Call logs,
• SMS logs,
• Browser logs,
• Picture gallery.

As opposed to hardware sensors, which require real-time processing, these sensors can be processed
offline. For this reason, the amount of data that needs to be processed can be quite large and requires
more time, both due to the quantity and the complexity of the algorithms used.

Algorithms

The authors define a software event as memorable if it does not follow the day-to-day patterns of the user.
Therefore an anomaly detection approach was taken to identify these memorable events. However, the
activity pattern of a user can change from one period to another. A period of calm and a normal lifestyle
often follow a period of stress and intense activity. MEmoIt should be sensitive to this kind of behavior.
In other words, the norm changes and MEmoIt’s interpretation of the norm must change along with it.
Figure 1 presents an overview of the detection algorithm. The software sensors’ logs are parsed and
each piece of information is sent to the appropriate detection component. The outputs of these compo-
nents are the detected memorable events, that are then stored in the database in order to present them
to the user at a later time.
Each component behaves similarly. An initial pass over the data builds a distribution of the events
at hand and detects a pattern in the user’s behavior. Subsequently, in order to detect unusual events, the
components compare the new data to the previously computed norm. Finally, the norm is updated to
take into account the new data.
The four components, however, differ in granularity. Phone calls and SMS are usually received
throughout the day, but are less frequent during nighttime. A call at 2am would be unusual. Conversely
pictures are taken on a regular basis, but an unusual event such as a visit to the zoo can increase the
number of pictures taken during this time. This number will most likely be significantly higher than
for the rest of the day. The same reasoning can be applied to web browsing. This is the main difference
between the two flavors of the detection algorithm: One keeps a per-day norm, and the other keeps a

6

MEmoIt

Figure 1. Memorable events detection

per-hour one. The similarity of the approach, however, led to a generic solution that provides flexibility
and factorization.
Without loss of generality, the detection algorithm for memorable calls is analyzed, but similar rea-
soning can be applied to the three other dimensions.
The goal of this algorithm is to detect if the number of calls received in a predefined time interval, on
a given day, is out of the ordinary. For simplicity, the time dimension is discretized by splitting days into
24 bins of one hour each. The adaptability of the algorithm, defined by how fast the norm can change,
is empirically set to one month. In other words, it is sufficient to keep track of the last 30 days in order
to detect abnormal behavior. The following features provide the information required to define the norm
and perform the detection:

• Number of Hours: Intervals for which the algorithm currently has data.
• Calls per time interval.
• The Last Checked Date: The time at which the algorithm last ran the algorithm. Only the data
that was generated since the last time the algorithm was run is necessary.
• The number of calls on the last checked time interval.

Upon retrieving the call logs, the algorithm averages the amount of calls, per hour and per day (in
order to distinguish between the two events: four calls from 10:00 to 10:59 on Monday and two calls in
the same time interval on Tuesday, for example).
An event occurring in a certain hour bucket h where the user has received n calls is defined as im-
portant if: n > average(h)±δ where δ corresponds to the standard deviation of the distribution.
After going through all the logs and detecting all the memorable events, the algorithm makes them
available to the application by storing them in the database. Finally, the algorithm updates the status
information to keep track of the last log entry that has been processed.

Moment of Analysis

For each software sensor, the corresponding detection component must retrieve a potentially large
number of records and analyze them. This operation can be time consuming and computationally in-
tensive. Moreover, mobile devices have considerably less resources than a computer, although, the user

7

MEmoIt

expects to do, more or less, the same things and to do them at the same quality of service: browsing
the internet, using applications, taking pictures, making phone calls; all these operations must be very
fast and responsive for a good user experience. The Android OS has this as one of its primary goal and
employs a lot of safety mechanisms to protect the user’s experience. For example, if a process blocks the
user interface for longer than a couple of seconds, it is automatically killed. Furthermore, the number
of threads that can be launched at the same time is limited and trying to exceed this limit will result in
tasks being rejected from execution.
Based on this observation, it is clear that the computation should be scheduled, as much as possible,
when the phone is idle. Furthermore, as opposed to a computer, the phone runs most of the time on battery
and battery lifetime is very important for the user. If an application is seen as a high-energy consumer,
then the risk of the user abandoning it is greater. Thus, launching these algorithms while the phone is
on battery would be a bad decision. The battery might run out while the algorithms are running and this
would increase the risk of corrupt data. Hence, extra effort should be invested in a more robust, fault
tolerant algorithm. For this reason, the detection algorithms run only when the phone is plugged and
charging. This is not a disadvantage because these sensors do not need to be processed in real time. Also,
the user charges his phone on a regular basis, usually once a day, and this will guarantee the detection of
the memorable events at regular intervals and can present to the user, each day, the memorable events
which she has performed on that particular day. It could even become a daily routine: in the evening,
they plug their phones and will be notified with the memorable calls or text messages of that day. They
are offered an overview, in terms of important events, of the past day.
The technical solution presented in Figure 2 fulfills these requirements. It is a task queue implemen-
tation. This way, the tasks can be submitted to the queue, and later on, a service pulls the tasks and ac-
complishes them step-by-step. The tasks can also be serialized in order for them to be stored on a disk,
and later retrieved, when the service is launched again.

LOCATION BASED SERVICES

Location-based services are at the core of most mobile applications on the market. It can be to simply
understand the user’s location, for example with the Facebook check-in option, or to infer more com-

Figure 2. Overview of the task submission and execution mechanism

8

MEmoIt

plex concepts about the user, for example with the Google now (n.d.) personal assistant that infers the
information to be displayed to the user, based on her habits, time and location. The activities performed
by a user are tightly bound to the places where she performs them. The intensity of this connection var-
ies, but it is always there. For example, a person can eat at a wide variety of places, ranging from her
own dining room, to the most fancy restaurant in town. However, she can only attend a football game
at football stadium.
Taking advantage of the fact that most people have their mobile phones with them at all times, it is
possible to define an initial building block: a tracking system. This system is responsible for detecting
whenever the user is in a certain location, because this usually means that she is performing some activ-
ity there. Disregarding her movements, the tracking system focuses essentially on her idling periods.

About Location

Today’s smartphones have several built-in features that allow applications to access the current location
of the phone:

1. Simple location detection via network triangulation.


2. 3G based location detection.
3. GPS (global positioning system).

Triangulation-based detection is very inexpensive in terms of network traffic and battery usage, but
it is the least accurate of the three. Also, it is always available for a mobile phone that is connected to a
cell-phone network. Using the 3G data network service is better in terms of accuracy, but more expensive
in terms of battery usage. Also, not all the users have this feature enabled at all times. The last location
provider available, GPS, is the most accurate of them all, but the most expensive in terms of battery energy.
The recent developments in modern mobile OSs (Android, IOS) make this decision seem much
easier than it actually is. An application can specify what provider it wants, but it will receive location
information from the best currently enabled one. Because of this, the most accurate option, GPS, was
selected. If the GPS sensor is not enabled, the application receives information via network triangulation.
Nevertheless, the GPS coordinates provided by the location service (regardless of the option chosen)
are not enough to determine the places of interest (PoI), also known as staypoints, the user visited. The
next section describes how to abstract the raw GPS coordinates into PoI.

From Coordinates to Places of Interest

Once the GPS coordinates are acquired, they need to be clustered in order to define the user’s PoI. Two
incremental approaches are compared: A first one, based on the ESOINN algorithm (Furao, Ogura,
& Hasegawa, 2007; Aberer, Catasta, Radu, Ranvier, Vasirani, & Yan, 2014), provides an incremental
clustering algorithm to detect points of interests from GPS coordinates. The second approach uses the
Android location API’s geofences, as well as a finite state machine (FSM), to detect places where the
user spends a certain amount of time to perform an activity.

9

MEmoIt

ESOINN

ESOINN is a clustering algorithm with particularly interesting features for the purpose of mobile ap-
plications. It is incremental, which means that adding new data to the model will require only a marginal
update. It is online and therefore does not need the entire GPS trace of the user (i.e., the succession of
GPS coordinates she visited) to start detecting clusters. Furthermore, it is unsupervised and does not need
labeled data. Finally, it does not require knowing a priori the number of clusters, which is particularly
suitable as an application should be able to cluster GPS signals from new places as the user visits them.
The general idea behind the algorithm is to build a network of nodes corresponding to GPS coordinates
and to aggregate multiple signals to the same node if these signals are close to each other. The partition-
ing of the network defines the different clusters.
MEmoIt uses ESOINN in order to build, from the GPS trace of the user a list of clusters correspond-
ing to the PoI, whereas transition signals between PoI are considered as noise and discarded. To be more
suitable for mobile computation, the original version of the algorithm was slightly modified to simplify
the generated network.
The evaluation of this approach was based on the Nokia dataset (Laurila, Gatica-Perez, Aad, Bornet,
Do, Dousse, Miettinen, 2012; Kiukkonen, Blom, Dousse, Gatica-Perez, Laurila, 2010) containing GPS
traces of more than 100 users and collected over several months. ESOINN was compared to the non-
incremental clustering algorithm DBSCAN (Ester, Kriegel, Sander, & Xu, 1996). Although the preci-
sion and recall of both algorithms are quite similar (precision: 0.92, recall: 0.87), the ESOINN has the
advantage of being incremental. After gathering data for 10 months, retraining DBSCAN with an extra
day would take on average 36 minutes, whereas ESOINN would update its model within an average of
2.6 seconds. However, the ESOINN approach requires accurate GPS data in order to perform correctly,
leading to high battery consumption.

Finite State Machine

The alternative approach for the detection of PoI is based on finite-state machine (FSM), the geofenc-
ing API and different granularity of location tracking services. The gist of this approach is that coarse-
grained and energy-efficient location tracking should be used on a regular basis to detect if the user is
still within the boundaries of a geofence, and fine-grained and more expensive location tracking should
be only activated when necessary.
The decision about the granularity level to be used is managed by a state machine containing the
following states:

• IDLE: The user is still in the radius of the last know PoI location
• PRE_MOVE: The coarse-grained location-tracking service has triggered an updated because the
new location is displaced outside of the geofence that was centered on the last known PoI loca-
tion. At this point, the fine-grained location service is started in order to provide a more precise
location. This way, it is possible to confirm that the user actually moved (change state to MOVE),
or that it was just a location update noise (return to IDLE). After the fine-grained location service
returns a result, it stops, in order not to use too much battery energy.

10

MEmoIt

• MOVE: In this state, if the coarse-grained location service sends an update, it means the user is
moving. Once these updates stop for a period of IDLE_TIME, the fine-grained location service is
triggered for the update, and the machine current-state advances to the PRE_IDLE state.
• PRE_IDLE: After receiving the update from the location service, that location is compared to
the last known location received while in MOVE state. If the distance between the two is less than
the displacement threshold (i.e., the geofence radius), it is safe to assume the user stopped. A new
PoI is detected, and the machine state returns to IDLE. Otherwise, the machine’s state reverses to
MOVE.

The difference in sensor accuracy for some devices can lead the GPS coordinates to change, although
the device has not changed its location. This defect, which might occur for various reasons, was the cause
of false positive PoI generation. These corner cases are handled by keeping track of the time the last
PoI was entered. In a realistic situation, user will most likely not visit two different PoI in a very short
period of time, and this is something that can be exploited in order to solve this problem. The minimum
time difference between the two events is approximated as being twice the IDLE_TIME.
This solution was evaluated against the ESOINN approach and performed with similar accuracy.
As it is much simpler and more battery efficient, the finite-state machine approach was retained for the
implementation of MEmoIt.

Semantic Enhancement

Once the place of interest detected, a semantic tag can be associated with it to provide an extra abstrac-
tion level. For this, an external service being able to reconcile GPS coordinates with their respective
semantic location is required. Two main service providers exist: Google Places and Foursquare. Both
providers supply similar services through their own API. Although MEmoIt originally used the Four-
square API because of its richer dataset, the application recently switched to Google Places. The reason
for this change of provider is the improvement of the Google Places dataset, the seamless integration
of its visual components of and its ease of deployment on Android. Several components of the applica-
tion that were dedicated to the integration of the Foursquare API were discarded, which simplified the
location-related functionality significantly.

Routine Detection

In the context of user modeling, another important feature is the detection of daily routines in user’s
habits. A routine is defined as the repetition of a pattern in the list of activities performed by the user.
The pattern can be sequential, unordered, or a mixture of the two.
Several approaches exist, as for example the work of Ye (Ye, Zheng, Chen, Feng, & Xie, 2009).
However, due to the mobile computing constraints, the algorithm used to detect these routines needs to
be incremental. Two approaches are presented to solve this problem (Ranvier et al. 2015).

Finite-State Machine

The first approach is based on finite-state machines (FSM). It defines different states between the dif-
ferent activities performed by the user, and the transitions between these states represent the sequential

11

MEmoIt

order in which these activities are executed. Each routine is modeled by a different FSM and branching
in the models account for small variations of the same routine. (e.g., Once in a while a user goes to the
supermarket before going home in the evening.)
In order to have a uniform representation, each day of the user, represented as a succession of activi-
ties, is discretized in time. Then, the discretized day is tested against the existing FSMs in the system
as follows:

1. Each FSM is updated temporarily with the sequence of activities of the day.
2. The system compute a degree of match (DoM) between the day and the updated FSMs. DoM is
defined as the product of the transitions probabilities that build the path required to reconstruct the
day. (e.g., in the FSM presented in Figure 3: the day Home -> Office -> Office -> Shop -> Home
has a DoM = 1 * 1 * 1 * 2/5 * 2/5 = 0.16).
3. Existing FSMs are ordered based on their DoM. If the highest FSM has a DoM below a certain
threshold θ, it means that none of the existing FSMs represent correctly the day at hand; therefore
another FSM is generated based on the day.
4. If the highest FSM has a DoM above θ, it is updated with the sequence of activities of the day,
changing the transition probabilities between the states and potentially adding more states.

The threshold θ is defined as (1/NFSM)^λ where NFSM is the number of days that have been matched
with a given FSM, and λ is an indicator of how much diversity is tolerated in the definition of routines
and how much difference is tolerated between the day at hand and the given FSM.
This approach has the advantage of being computationally inexpensive and proposes a clean visual
representation of the routines. However, the time-discretization of the days, necessary for the definition
of the FSM, induces some loss of information and adds noise. Another problem is that the FSM ap-
proach does not handle unordered activities easily (e.g., going to the gym and then to the supermarket
can be part of the same routine as going to the supermarket and then to the gym). These flows triggered
a second approach based on frequent patterns mining.

Figure 3. Example of finite state machine

12

MEmoIt

Frequent Pattern Mining

This approach uses data mining techniques used for frequent-pattern mining on the list of activities of
the user. The term frequent pattern is used here to encompass

• Unordered sets of activities that are present in more than Si transactions. Si being the minimum
support required to be defined as frequent.
• Sequential lists of activities, that are present in more than Ss transaction. Ss being the minimum
support for a sequence to be defined as frequent.

In this way, the system accounts for the ordered nature of the routines, and enables activities to be
swapped but still remain coherent in the definition of a routine.
The main challenge of this method is that standard algorithms for computing frequent itemsets, such
as the Apriori algorithm, are usually non-incremental and not efficient. This challenge is addressed by
using the incremental algorithm FUP (Tsai, Lee, & Chen, 1999). Although more recent and efficient
algorithms have been devised, FUP has the advantage of being based on the Apriori algorithm, making
it useful for both sequences and itemset mining.
Even if FUP addresses directly the problem of frequent itemset mining, it does not support ordered
sequences mining. Frequent sequences can be mined in a non-incremental fashion by using the GSP
algorithm (Srikant, & Agrawal, 1996). However, as the GSP algorithm is itself based on the original
Apriori algorithm, the GSP algorithm can use the FUP algorithm to mine frequent sequences in an in-
cremental fashion. This enables the system to perform the update of frequent sets and sequences in one
pass, further improving the time complexity of the algorithm.
Once the frequent patterns of activities are detected, each day in the user’s history is assigned a boolean
feature vector for which the element at position i is 1 if the day matches pattern i, and 0 otherwise. This
vector provides a representation of the day in the frequent patterns space. This enables the clustering of
days, based on their features vector, therefore generating routines. Indeed, days having a high number
of patterns in common should belong to the same routine.

Evaluation

These two approaches were evaluated both in terms of accuracy, by comparing them to a state-of-the-art
algorithm, T-patterns (Giannotti, Nanni, Pinelli, Pedreschi, 2007), by using the Nokia dataset (Laurila et
al., 2012; Kiukkonen et al., 2010) defined in the previous section. They were also evaluated in term of
performance on Android by comparing them with a non-incremental frequent pattern-mining algorithm.
Due to the lack of ground truth for the Nokia dataset routines, the routines mined by the three algo-
rithms (the two aforementioned approaches and T-patterns), were provided to a crowd-sourcing platform
for an evaluation in which the crowd was asked, to detect among four days belonging to the same users,
the outlier that did not belong to the same routine as the three others. A six-class answer was devised:
The user could select one of the 4 days as the outlier, answer that all the 4 days belong to the same routine
or that none of the days belong to the same routine.
The experiment resulted in 3800 tasks performed by 279 different workers. The performances of the
three approaches are presented in Table 1. These results present FPM as the winner in terms of accuracy

13

MEmoIt

Table 1. Crowdsourced evaluation of T-Patterns, FSM and FPM

Accuracy Sensitivity Specificity


T-patterns 21.6% 40.6% 8.8%
FSM 44.0% 59.1% 49.7%
FPM 56.3% 74.3% 51.7%

sensitivity and specificity. The reader can note that a randomized baseline among the six available op-
tions offered to the crowd would yield 16.7% accuracy.
The performance of the algorithms was tested on a Nexus 4 smartphone (quadcore CPU at 1.5GHz,
2GB of RAM, Android 4.4), by adding data to the history of the user, one week at a time. The results
are displayed in Figure 4 and clearly state the importance of having incremental algorithm to sustainably
perform regular tasks on increasing datasets on a smartphone.

LOCAL DATA MANAGEMENT

One of the main problems of mobile application is the performance. A badly performing application with
much waiting time and freezing interactions can lead to a user’s irritation and result in the application
being uninstalled. Mobile systems have multiple hardware and software limitations that other systems
do not present, such as CPU clock, available memory and power consumption. The database system is
often one of the heaviest components of mobile applications, and good performances are necessary to
conserve a good user experience.

Figure 4. Time required to process a new week of data for both SEM generation methods, compared to
a non-incremental algorithm based on the original Apriori and GSP

14

MEmoIt

Realm

The performance of the default database system (SQLite) in heavy operations (e.g., selecting all the
records) is critical. Some improvements could be made with different techniques such as prefetching and
caching. However, a downside is that the margin of improvement is limited and it comes at the expense
of other resources (memory and battery consumption). Another downside is the complexity of the code
used to support operations on the database. In the specific case of MEmoIt, the frequent turnover of
developers combined with a high code complexity leads to a very steep learning curve, a high number
of bugs in the code and a broad set of coding styles that periodically have to be fixed and refactored.
For all these problems, it is important to find a solution that could solve or improve the application
on many levels. Realm offers such a possibility.
Realm is a mobile database-engine that can be used as an alternative to SQLite. The strengths of this
system, presented by its developers, are the following:

• Ease of Use: As Realm does not work on top of SQLite, it provides a complete alternative to the
engine provided in Android. It uses Java objects as a model and a Fluent Interface for the queries,
as described in Table 2.
• Fast and Optimized for Mobile Platforms: Due to its zero-copy design, Realm is much faster
than an ORM, and often faster than raw SQLite.
• Cross-Platform: By the means of wrappers, Realm is available for Android and IOS ecosystems.

Performance Analysis

The main use-cases where an application interacts with the database, and the types of operation associ-
ated with it, are listed in Table 3. In the context of MEmoIt, write operations are very rare and essentially
affect one or only a few records, whereas the application heavily uses read operations, especially the
selection of all the events performed every time the timeline interface (one of the main one) is shown.

Table 2. Example of a Realm query and an Android Table 3. Use cases per database operations
SQLite query, equivalent to the SQL select * from
Event where id = eventId Use Case Database Operation
Add a new record Single insert
//Realm query Update an existing record Single update
int recordId = generateRandomId();
RealmResults<Record> records = mRealm.where(Record. Load records from file Bulk insert
class).equalsTo(“id”, recordId).findAll(); Show single record details Single read
//Android SQLite query
ContentResolver contentResolver = getContext(). Show all records Bulk read with join
getContentResolver();
Upload records to the cloud Bulk read
String[] proj = {RecordExtendedView.COLUMN_ID};
String sel = RecordtExtendedView.COLUMN_ID + “ = ?”; Show aggregated overview Aggregate (sum/count)
String[] selArgs = {String.valueOf(recordId)};
Cursor cursor = contentResolver.query(RecordEventExtended
ContentProvider.CONTENT_URI, proj, se, selArgs, null);

15

MEmoIt

To be complete, tests were run on different devices, in order to study how different hardware capa-
bilities affect the performances of the two systems. The tables were populated with a different number
of records, ranging from 1000 to 10000.
The metric used to define performances was the execution time of a single operation. Multiple itera-
tions of the tests were run and a confidence interval over the median was used to evaluate the average
performances.

Results

The main operations tested were

• Write Records (from 1 Record to 100 Records at a Time): Write operations show a difference
in the performances with different hardware, consistently showing that the mobile device with
better hardware performed slightly faster. No difference could however be identified between the
two databases that performed similarly (on the same hardware).
• Read a Single Record: The results in this area were too small to identify any correlation with the
hardware configurations, the number of records in the tables or even with the database engine. In
both cases the average execution times were shorter than 5ms.
• Read All the Events (the Main Operation that Needs to Be Measured): This operation yielded
more interesting results.

Two different types of tests were run, the first one performing only the query, the second one per-
forming the query and reading all the return records afterwards.
The results showed that:

• Better hardware consistently leads to better performances, with a meaningful difference for SQLite
and a much smaller difference for Realm.
• In the case of Realm, due to the lazy evaluation this engine implements, the first type of tests aver-
aged execution times at 1ms, independently of the number of returned records.
• The performances of SQLite for the first type of test were linear to the number of records and very
slow when this number was too high (e.g., more than 1s for 10000 records).
• The performances for the second type of tests proved that both SQLite and Realm execution times
were linear to the number of records retrieved; but with very different growth, much steeper for
SQLite than Realm.

The overall results, as depicted in Figure 5 and Figure 6 prove that Realm performs much better than
SQLite (more than 10 times faster). Based on this, MEmoIt was reimplemented in Realm, simultane-
ously applying some improvements and refactoring. This implementation had the side effect of reducing
the codebase of the database component from 28000 lines of code for the SQLite implementation to
13000 lines for the Realm implementation, reducing the complexity of the code by more than a half, and
therefore illustrating the importance of the choice of a database system for a mobile application. These
values were measured using Sloccount (Wheeler, 2014).

16

MEmoIt

Figure 5. Boxplot of the median showing execution times for Realm on a Google Nexus 5 for both types
of operations (type 1 left, type 2 right)

Figure 6. Boxplot of the median showing execution times for SQLite on a Google Nexus 5 for both types
of operations (type 1 left, type 2 right)

17

MEmoIt

CLOUD INTERACTION

An alternative to keeping computation and data local is to outsource these services to the cloud. This
has the advantage of lifting the restrictions on memory and computational power, but it presents a threat
for the privacy of the data. Indeed, data will be stored and processed remotely by a service provider, that
is not controlled by the user. However, interactions with the cloud are sometimes unavoidable. MEmoIt
has a scientific vocation, and in order to be able to conduct experiments, some data still need to be sent
to the servers. For privacy reasons, it is important to make sure that data is properly handled.
The guidelines presented in this section correspond to a use case where a back-end system collects
and stores sensitive data about users and makes it available to third parties in a privacy friendly fashion.
Designing such a system raises two concerns: First the scalability, considering the important amount of
data that users produce; and second the privacy concerns of the users who will not be easily convinced
to share their data.

A Reference System

The authors take inspiration from OpenPDS (de Montjoye et al., 2014), a system for collecting meta-
data from users; IT enables easy access by different entities in a safe manner. Each user has her own
private data repository under her full control, and different applications store the user’s metadata on his
repository. The user also controls to which part of the metadata each application has access. When an
application wants to extract useful information, it can run a query on part of the metadata that the user
authorized it to access; no application has direct access to the metadata. OpenPDS has a distributed
nature; each user’s storage space is completely independent of other users’ spaces. The user creates the
storage herself, for example, by installing OpenPDS on the cloud, or by using a service that provides
such storage spaces; She is the sole owner of her data. When the user uses applications that want to use
her private data, she explicitly authorizes them to have controlled access to part of her metadata. These
applications can freely add data to the user’s storage but cannot read them. They can only query the data
through the SafeAnswers module, which guaranties that the queries do not violate the user’s privacy.

Choice of Platform

There exist, at the time of writing, two main contenders for integrating cloud computing in mobile ap-
plications. The first one, Amazon Web Services displays an important catalog of services ranging from
a notification system, to data storage and processing. The second, Google Cloud Platform, is a complete
set of services for developing applications to the cloud. Its capabilities include high-replication cloud
storage, an auto scaling platform, App Engine, for deploying web applications, and big data services that
include Google Could Storage, BigQuery, Dataflow. The main advantage of Google Cloud Platform is
the seamless integration of its different components. Moving data between different services is free and
requires much less time. Its “pay for what you use” pricing scheme is especially useful for emerging
projects. Another reason for choosing Google Cloud Platform for the back end is the compatibility be-
tween it and Android applications, which allows secure and reliable communication with little effort. In
the case of MEmoIt, the back end uses Google Cloud Storage to store user data, Dataflow to transform
the data and BigQuery to access and query the transformed data.

18

MEmoIt

Google Cloud Storage

Google Cloud storage (GCS) is a high-availability storage service for application developers; regular users
should not use it. GCS uses the concept of buckets and objects to store data. Buckets are at the root of
a project and enable the storage of objects within them. Objects within a bucket are immutable and can
be only overwritten and not appended. The data in a GCS object are opaque to the cloud storage and are
encrypted by default. The objects consist of the actual data and a set of metadata. The object metadata
component is a collection of name-value pairs that describe various object qualities.
All operations on the GCS objects are atomic, thus any object uploaded is immediately available for
reading and any object deleted will immediately become unavailable. For GCS buckets only eventual
consistency is guaranteed; for example, if a request for a list of all objects in a bucket is made after a
deletion operation a deleted object might be returned but it will still be inaccessible.

Google Dataflow

Dataflow18 is a unified programming model and a managed service (in the Google Cloud infrastructure)
for developing and executing a wide range of data processing patterns, including ETL (extract, transform
and load), batch computation, and continuous computation. Cloud Dataflow frees the end user from
operational tasks such as resource management and performance optimization.
Dataflow implements a superset of features of the widely-known MapReduce framework (introduced
by Google in 2004). With Dataflow, Google provides its users with a processing layer that can seam-
lessly transfer (and transform) the data, among all the components of the Google Cloud infrastructure.
It has been recently released as an open-source framework, effectively reducing the lock-in factor of
adopting a full-stack solution based on Google components. Dataflow comes with a Java API and an
experimental Python API.

Google BigQuery

Google BigQuery is a Google service enabling SQL queries against append-only tables, and the process-
ing is done using Google’s infrastructure.
BigQuery is similar to a regular SQL database in terms of capabilities but with the ability to handle
more complex data and in larger quantities (at the scale of terabytes). A table in BigQuery is a regular
two-dimensional array where each row represents one entry and each column represents the data. A
column can contain fields of a standard type such as string, integer and float. But can also contain nested/
repeated fields, for example a column that contains telephone numbers can contain multiple telephone
numbers in each row and/or can represent a telephone number as a set of values such as a country/area
prefix and the actual telephone number. These entries are flattened when a query, that uses the nested
fields, is executed. To perform any type of action on BigQuery, a job needs to be created. Jobs handle
running queries, and importing and exporting data. A job can be synchronous or asynchronous and can
be queried to test its completion. BigQuery offers interoperability with other Google services. It is very
easy to import and export data into a table from the Google Cloud Storage simply by providing the fully
qualified URI (i.e., the bucket and object from which to load or export the data).

19

MEmoIt

MEmoIt Implementation

Compared to OpenPDS (de Montjoye, et al. 2014), MEmoIt has a simpler architecture and a centralized
nature. The authors propose an architecture in which the code that runs a user study is sent to the device,
executed, and only the results, in the shape of aggregates, are sent back to the server and are stored on
Google Cloud Storage, thus contributing to the anonymization of the users. Periodically, a Dataflow job
is run, which aggregates the data. Finally, a BigQuery job is run to present the data to the researchers.

Data Storage

The REST service, used by the application to send data to the server, exposes two API calls: Synchro-
nize User and Upload Data. Each communication with the REST API is authenticated with the user’s
Google username and also contains the random salt or user defined passphrase that is used to hash the
username to secure the user’s anonymity.
In the first transmission, the application performs a Synchronize call to notify the service that there
is a new user and gives the salt for the hashing so that the storage bucket is created. The service hashes
the username with the random salt and obtains a unique hash that will become the name of the bucket
that represents the specific user. In the case where the salt/passphrase is changed for a user, the service
that creates the new bucket with the hashed username copies the contents of the previous bucket and then
deletes it. In the case the user opts out of the data collection, she can choose to have her data retained
on the cloud or deleted -- if she wants the data to be deleted the Synchronize call notifies the service to
delete the data.
To upload data, the application uses the Upload Data API sending the data to the back-end service.
It is worth noting that data transferred between the mobile application and the rest service is structured.
The Endpoints API enables annotations for the API calls and data packet classes and automatically cre-
ates the corresponding Android Java objects.
The REST service is responsible for storing the received data in the Google Cloud Storage. When
data arrives for a user, a new object is created in the user’s bucket with the data for that upload session.
The filename of each object is the timestamp of the upload. This makes it easier to search and delete
parts of the data. When the REST service is notified to delete the data, it only deletes the bucket for
the corresponding user and its contents, and it does not modify the BigQuery table as it is append-only.

Data Processing

On a regular basis, a DataFlow job is responsible for aggregating the data and loading it into BigQuery
tables. This is required because of limits in the Google BigQuery API calls. There is a limit on the
maximum files per load job of 10,000 files and a limit of 1,000 load jobs per table. With these limits, 1
million users would exceed the limit in 10 weeks. Also, the user id needs to be added to each row of data,
and additional transformations can be applied (e.g., data obfuscation for privacy-preservation purposes).

20

MEmoIt

FUTURE WORK

This chapter developed several aspects of mobile-application development that need to be re-adapted and
proposed guidelines as to how to implement them. Multiple problems, however, are still unanswered.
The location-based problem presented in this paper is not restricted to MEmoIt and an API should be
provided by mobile platforms to address this problem without customized algorithms. Another aspect that
the authors remarked during the development of MEmoIt, was the lack of lightweight machine-learning
libraries for smartphones. With the quantity of data at hand and the increase in computational power,
such libraries would open the way to most interesting on-device data-analytics. Finally, the ongoing
effort to implement privacy mechanisms for the cloud, based on strong theoretic foundations such as
differential privacy or k-anonymity (Sweeney, 2002), should be further pursued, as it represents one of
the most promising solutions in this field.

CONCLUSION

Using their experience acquired while developing the life-logging application, MEmoIt, the authors have
described in this chapter different aspects of mobile development that need to be carefully considered
when building an application. Mobile device resources such as memory, computing or battery power are
scarce and should be optimized in order to provide a good user-experience. Simplicity of the different
components of an application is also essential. As seen for the places-of-interest detection algorithm, it
can be interesting to build simple solution using built-in functionalities, rather than designing relatively
complex algorithms that would perform equally well but increase the complexity of the codebase.
Similarly, the authors show that a key enabler to implementing advanced features on a smartphone is to
design algorithms that process data incrementally. In this way, the application can overcome excessive
running times, even if it collected data for months in a row. Finally, cloud integration becomes increas-
ingly appealing as it provides services that simply cannot be performed on a mobile device. Extra care,
however, should be taken regarding the data that are transmitted to remote servers.

ACKNOWLEDGMENT

The authors would like to thank all the EPFL students who participated in the creation of the MEmoIt
application. The MemorySense Project was sponsored by Samsung Research America and by Hasler-
stiftung in the context of the Smart World 11005 (MEM0R1ES) Project. Portions of the research in this
paper used the MDC Database (owned by Nokia and made available by the Idiap Research Institute,
Switzerland).

REFERENCES

Aberer, K., Catasta, M., Radu, H., Ranvier, J. E., Vasirani, M., & Yan, Z. (2014, March). Memorysense:
Reconstructing and ranking user memories on mobile devices. In Pervasive Computing and Communica-
tions Workshops (PERCOM Workshops), 2014 IEEE International Conference on (pp. 195-198). IEEE.

21

MEmoIt

Apple. (n.d.). Healthkit. Retrieved from: http://developer.apple.com/healthkit


Baltrunas, L., Ludwig, B., Peer, S., & Ricci, F. (2011). Context-aware places of interest recommenda-
tions for mobile users. In Design, User Experience, and Usability. Theory, Methods, Tools and Practice
(pp. 531-540). Springer Berlin Heidelberg. doi:10.1007/978-3-642-21675-6_61
Chen, D., & Zhao, H. (2012, March). Data security and privacy protection issues in cloud computing.
In Computer Science and Electronics Engineering (ICCSEE), 2012 International Conference on (Vol.
1, pp. 647-651). IEEE. doi:10.1109/ICCSEE.2012.193
Couchbase. (n.d.). Couchbase Mobile. Retrieved from; http://www.couchbase.com/nosql-databases/
couchbase-mobile
de Montjoye, Y. A., Shmueli, E., Wang, S. S., & Pentland, A. S. (2014). openpds: Protecting the pri-
vacy of metadata through safeanswers. PLoS ONE, 9(7), e98790. doi:10.1371/journal.pone.0098790
PMID:25007320
Developers. (n.d.a). Saving Data. Retrieved from: http://developer.android.com/training/basics/data-storage
Developers. (n.d.b). Creating and Monitoring Geofences. Retrieved from: http://developer.android.com/
training/location/geofencing.html
Dwork, C., & Aaron R. (2014) The algorithmic foundations of differential privacy. Foundations and
Trends in Theoretical Computer Science, 9(3-4).
Ester, M., Kriegel, H. P., Sander, J., & Xu, X. (1996). A density-based algorithm for discovering clusters
in large spatial databases with noise. In KDD (Vol. 96, No. 34, pp. 226-231).
Foursquare. (n.d.). Retrieved from: http://foursquare.com
Furao, S., Ogura, T., & Hasegawa, O. (2007). An enhanced self-organizing incremental neural network
for online unsupervised learning. Neural Networks, 20(8), 893–903. doi:10.1016/j.neunet.2007.07.008
PMID:17826947
Giannotti, F., Nanni, M., Pinelli, F., & Pedreschi, D. (2007). Trajectory pattern mining. In Proceedings
of the 13th ACM SIGKDD international conference on Knowledge discovery and data mining (pp. 330-
339). ACM. doi:10.1145/1281192.1281230
Google Now. (n.d.). Landing Now. Retrieved from: https://www.google.com/landing/now
Google Play. (n.d.). Maps. Retrieved from: http://play.google.com/store/apps/details?id=com.google.
android.apps.maps
Google Translate. (n.d.). Retrieved from: http://play.google.com/store/apps/details?id=com.google.
android.apps.translate
Kiukkonen, N., Blom, J., Dousse, O., Gatica-Perez, D., & Laurila, J. (2010). Towards rich mobile phone
datasets: Lausanne data collection campaign.Proc. ICPS.

22

MEmoIt

Laurila, J. K., Gatica-Perez, D., Aad, I., Bornet, O., Do, T. M. T., Dousse, O., . . . Miettinen, M. (2012).
The mobile data challenge: Big data for mobile computing research. In Pervasive Computing (No.
EPFL-CONF-192489).
Lu, K. et al.. (2015). Checking More and Alerting Less: Detecting Privacy Leakages via Enhanced
Data-flow Analysis and Peer Voting. NDSS; doi:10.1145/1899475.1899487
Montoliu, R., & Gatica-Perez, D. (2010). Discovering human places of interest from multimodal mobile
phone data. In Proceedings of the 9th International Conference on Mobile and Ubiquitous Multimedia
(p. 12). ACM.
Ostrovsky, D., & Rodenski, Y. (2014). Couchbase Lite on Android. In Pro Couchbase Server (pp.
283–292). Apress.
Paek, J., Kim, J., & Govindan, R. (2010). Energy-efficient rate-adaptive GPS-based positioning for
smartphones. In Proceedings of the 8th international conference on Mobile systems, applications, and
services (pp. 299-314). ACM.
Parse. (n.d.). Parse Server. Retrieved from: http://parse.com
Ranvier, J. E., Catasta, M., Vasirani, M., & Aberer, K. (2015). RoutineSense: A Mobile Sensing
Framework for the Reconstruction of User Routines. In 2th International Conference on Mobile and
Ubiquitous Systems: Computing, Networking and Services (No. EPFL-CONF-208793). doi:10.4108/
eai.22-7-2015.2260055
Realm. (n.d.). Retrieved from: http://realm.io
Srikant, R., & Agrawal, R. (1996). Mining sequential patterns: Generalizations and performance im-
provements. Springer Berlin Heidelberg.
Sweeney, L. (2002). k-anonymity: A model for protecting privacy. International Journal of Uncertainty,
Fuzziness and Knowledge-based Systems, 10(05), 557–570. doi:10.1142/S0218488502001648
Tsai, P. S., Lee, C. C., & Chen, A. L. (1999). An efficient approach for incremental association rule
mining. In Methodologies for Knowledge Discovery and Data Mining (pp. 74–83). Springer Berlin
Heidelberg. doi:10.1007/3-540-48912-6_10
Wheeler, D. A. (2004). SLOC count user’s guide. Retrieved from http://www.dwheeler.com/sloccount/
sloccount.html
Xiao, Z., & Xiao, Y. (2013). Security and privacy in cloud computing. IEEE Communications Surveys
and Tutorials, 15(2), 843–859. doi:10.1109/SURV.2012.060912.00182
Ye, Y., Zheng, Y., Chen, Y., Feng, J., & Xie, X. (2009, May). Mining individual life pattern based on
location history. In Mobile Data Management: Systems, Services and Middleware, 2009. MDM’09. Tenth
International Conference on (pp. 1-10). IEEE. doi:10.1109/MDM.2009.11

23

MEmoIt

KEY TERMS AND DEFINITIONS

Cloud: The physical infrastructure composed by many computers housed in massive warehouses
all over the world.
Data Storage: The software and hardware layers to retain digital data.
Finite State Machine: A mathematical model of computation used to design both computer programs
and sequential logic circuits.
Incremental Algorithm: A software algorithm which, whenever a piece of input data changes, at-
tempts to save time by only re-computing those outputs which depend on the changed data.
Location Services: The software and hardware layers used by a smartphone to retrieve the geographi-
cal coordinates of a user.
Privacy: The aspect of Information Technology that deals with the ability an organization or indi-
vidual has to determine what data in a computer system can be shared with third parties.
Routine: A sequence of actions regularly followed.

24
25

Chapter 2
Mobile Application Testing
Vijay Ekambaram
IBM Research, India

Vivek Sharma
IBM Research, India

Nitendra Rajput
IBM Research, India

ABSTRACT
Statistics hold that 80% of the mobile applications are deleted after just one-time use. A significant
reason for this can be attributed to the quality of the mobile application, thus impressing on the need
for testing a mobile application before it is made available on the app stores. At the same time, the mo-
bile application lifecycle time is shrinking. So while operating systems used to get release about once
in a couple of years, mobile operating systems get updated within months. And talking of apps, new
apps are expected to be built and released in a matter of weeks. This impresses the need for automated
mechanisms to do mobile testing. The space of mobile application testing is challenging owing to the
variety of phone devices, the operating systems and the conditions under which an app can be used by
the user in the wild. This chapter is focused on tools and techniques that are used for automated testing
of mobile applications.

INTRODUCTION

Testing mobile applications is an emerging research area that faces a variety of challenges due to in-
creasing number of applications getting developed and a plethora of new devices being released into the
market. These new devices have varied form factors, screen size, resolution, OS, hardware specification
etc. which increases the difficulty to effectively test an application. Also, in comparison to conventional
Desktop and Web applications, mobile applications have shorter release cycles (lesser time-to-market)
and the update frequency is high, making it necessary for the tester to perform additional testing quite
often. Due to these factors, testing a mobile application becomes a very expensive, laborious and time
consuming process. This chapter primarily focusses on explaining the inherent challenges and solutions
associated with different types of mobile testing.
DOI: 10.4018/978-1-5225-0945-5.ch002

Copyright © 2017, IGI Global. Copying or distributing in print or electronic forms without written permission of IGI Global is prohibited.

Mobile Application Testing

The goal of any mobile testing solution is two folds. The first aim is to ensure that all possible chal-
lenges with respect to the application are detected. Detection of such challenges, which could be functional
issues in the application, or usability issues that make the application difficult to use, or performance
issues that make the application frustrating to use due to resource constraints. The second, optional but
preferred, aim is to determine the cause of such a challenge.
As has been discussed in earlier chapters, there are at least three different ways of building a mobile
application: native, hybrid, and web. Each of these mechanisms differ in the way where and how most
of the processing of the application happens. To complicate matters further, a mobile application can
access backend data and services over the network. In such a complex scenario, it is important to deter-
mine the challenges in a mobile application, not only from within the mobile device, but across entities
that are eventually enabling the application to execute. Such issues make mobile application testing an
interesting and a challenging software engineering problem to look at.

ORGANIZATION OF THIS CHAPTER

Testing a mobile application has some obvious key goals. The main goal being that the application should
work well. However, from a software engineering perspective, we need to ensure that the application
does the task for which it is designed, and does it easily enough so that users can use it easily and does
it with optimal compute resources. These main characteristics of a desirable good mobile application
then raise three key forms of mobile testing. Functional testing is performed to ensure functionality, i.e.
to test whether the application is performing the functions that it was designed for. Performance testing
is conducted to determine how optimal the application is, in terms of its compute resource usage, battery
usage and latency related issues. And finally, Usability and Accessibility testing aims to capture how
easy is for users to be able to work with the applications to execute the functions for which the applica-
tion is designed. All of these three different forms of testing have an implication to each other and so are
not strictly orthogonal. However, a division of purpose enables to determine the source of the problem
in a mobile application, thus making the possible solutions and the resources required to fix it. As an
example, if there is an issue detected in usability of the application, then perhaps designers are best at
fixing them. On the other hand, if there is an issue with respect to the performance of the application,
such as the response is too slow (which itself can lead to usability issues), then a software engineer hav-
ing knowledge of the mobile operating system should get involved. For such reasons, in this chapter,
mobile testing will be studied under these three umbrella topics: functional, performance, and usability
& accessibility. At the end of this chapter, we discuss detailed literature survey on these three umbrella
topics with various discussion on latest trends followed in mobile testing. But before studying each one
of these in detail, let us discuss the basics of mobile testing in the next section.

KEY COMPONENTS OF MOBILE TESTING

Mobile Applications are tested in 3 main ways: unit, manual and automated testing. This chapter is mostly
focused on automated testing and its associated challenges and standards, but we will also discuss below
about the unit and manual testing process at high level, from a completeness perspective.

26

Mobile Application Testing

Unit Testing Process

In unit testing process, developers test individual software artifacts (i.e. code module, libraries, UI, etc.)
to determine their readiness to integrate with other code components. This testing phase happens in par-
allel during development and mostly conducted by developers. The goal of unit testing is to isolate and
test each part of program to test its correctness. To achieve this, developers write and execute various
unit test-cases to test various individual components.

Manual Testing Process

In manual testing process, a test engineer manually executes the complete Application Under Test (AUT)
in various scenarios and record the observed output. Then, Test Engineer compares the observed output
with the expected output to discover defects/issues in the AUT.
In mobile testing, it is highly recommended to test the AUT in various devices, contexts and configu-
rations. So, a Test Engineer has to repeat the same testing process multiple times in different devices/
configurations which is time-consuming and tiring process. Automation of the testing process is extremely
helpful for Test Engineers to speed-up this otherwise repetitive testing process.

Automated Testing Process

In this section, we explain the basic components involved in a Mobile Test Automation Framework (in
Figure 1). These are generic components that are used across the different type of automated testing
(functional, performance and usability) and so we will discuss these at a high level first:

Figure 1. Components of mobile test automation framework

27

Mobile Application Testing

1. App Center (AC): Contains a collection of AUTs for instrumentation and testing. For Android,
AUT is same as an Application Package Kit (APK) file and for iOS, AUT same as the Source-code
Zip file.
2. App Instrumentation Module (IM): The IM transfers the input AUT to an instrumented AUT
by injecting specific code snippets for various purposes. The process of instrumentation is to
ensure that the tester platform has certain hooks through which it can capture the parameters that
can help in identifying whether the test was successful or not. Following are the different types of
instrumentation techniques that are commonly used.
a. Record Instrumentation: In Record instrumentation, Code-snippets are injected into an AUT,
with the goal that it could record all events and interactions with the AUT. This instrumenta-
tion process enables construction of test-cases.
b. Playback Instrumentation: In the testing phase, it is also important to enable playback of a
test case. Code-snippets are injected into AUT which could apply specific events on the AUT.
This instrumentation process enables automatic execution of events on AUT without human
involvement.
c. Data Collection Instrumentation: This instrumentation is focused on code-snippets that are
injected into AUT to collect various logging events with respect to functional, performance,
usability and accessibility testing. This instrumentation process collects data for defect analysis.
d. More details on the instrumentation process is explained in the next section.
3. Record Service (RS): The Record Service provides a framework to enable Test Engineer to manu-
ally execute and record sequence of actions on the AUT. When user interacts with the AUT, RS
captures all the user/system events with respect to the AUT. These captured user/system events are
then converted to a test-case. Test-case contains all the user/system events with additional meta-
data (like timestamp). Example of a Test-case is depicted in Figure 2.
4. Test-Case Repository (TR): This is a repository that maintains a collection of test-cases for each
AUT. These test-cases are constructed using the above record service.
5. Playback Engine (PE): Given an instrumented AUT and a test-case, the Playback Engine enables
execution of the test-case on the AUT without human involvement and also collects necessary
logging details for defect analysis. The Playback Engine depends on the following two services to
enable the automatic playback of test cases:
a. Playback Service: Enables execution of recorded events (as depicted in test-case) on the
AUT.
b. Data Collection Service (DCS): Collects various logging details for defect analysis based
on the type of testing (i.e. functional, performance, usability, etc.)
6. Reporting Engine (RE): The Reporting Engine is the key component that eventually generates test
reports for the test case executions on the AUT by the Playback Engine. An example of test-report
is depicted in Figure 3. Based on the type of testing, various interactive visualizations and reports
could be generated. Ideal test-report should not only pin-point defects in the application, but also
suggest root-cause for the defects.

28

Mobile Application Testing

Figure 2. Sample test-case

Figure 3. Sample test report

FUNCTIONAL TESTING

Proper functioning is a basic need of an app to stay in App world. If an app does not function well, it
gets bad reviews and less user attention. That is why functional testing of a mobile application is very
important. In this phase, the app goes under a process to check app’s functionality thoroughly in terms
of every screen or widget is responding as expected, transition between screens is also as expected in
all kind of end user possible scenarios. Functional Testing can be done in both fashions - manual or
automated. Let’s talk about automation of functional testing in detail below.
Automating the process of testing an app in terms of its overall functionality is Functional Test Auto-
mation. It is very helpful to reduce time and effort required to test an app, especially in Regression Testing
model where apps have to repeatedly tested. There are different phases of Functional Test Automation
– Instrumentation Phase, Record Phase, Playback Phase and Reporting Phase (Functional Test Reports).

Instrumentation Phase

Since the instrumentation of an application depends heavily on the operating system for which the ap-
plication is authored, we will cover the instrumentation for android and iOS in separate sections.

Instrumentation in Android

In the case of Android, the AUT is decompiled, reverse engineered and instrumented. The detailed
instrumentation process in Android is described in Figure 4. The following are the steps involved in the
Android instrumentation process.

29
Exploring the Variety of Random
Documents with Different Content
a lábán tartani. Leomlott és düledező házak közt taszitották,
lökdösték előre, s az üvöltözés, jajveszéklés egyre erősebb lett
körülötte. A lehullott faltömegek alatt haldoklók nyöszörögtek, s egy
asszonyt, a ki férje holtteste mellett jajongott, eltiportak. Odább,
kőhalmok közé zárva, kis gyermek siránkozott.
Senki se hallgatott rá. Abiront előre rugták. A betegek házának
ablakaiból a benn felejtett nyomorultak kétségbeesve könyörögtek le
az utczára, hogy szabaditsák ki őket. Nem kaptak más feleletet, csak
azt, hogy:
– Jön a viz-ár! Jön a viz-ár!
Majd egy őrült rivalgás. A hullám-tömeg, mely megkerülte a
várost, szemben támadt rá a menekülők seregére s a legelül rohanók
félig őrülten fordultak vissza, nekik esve a mögöttük küzdőknek.
»Vissza! Jobbra!« – hangzott a rémület orditása. A menekülők
fojtogatták egymást.
Végre még egy rettentő dördülés, a legerősebb valamennyi közül,
s a szomszéd kőfalak is megingottak. Abiron hanyatt vágódott; egy
téglatömeg zuhant a lábára. Félre ugrott előle, s egy másik kőroncs
majdnem agyonzúzta. A feje érintetlen maradt, de a karjai ott
maradtak a tégla alatt.
Elkábult. Még hallotta a bődületet, s látta, hogy az ég vörös
fénybe borul, aztán elvesztette az eszméletét.
***
A hol előbb Ninive pompázott, ott nem volt egyéb, csak egy nagy
temető. A paloták helyén kő-romok és viz-ár; a függőkertek s thuja-
liget helyén füstölgő fák és büzhödt pocsolya. Szerte, szanaszét és
mindenütt: emberek és állatok hullái.
Betelt a jövendölés. Az Ur haragja elsöpörte a mi ismerőseinket.
A kis öreg Reczepiczét úgy elmosta a viz ár, mint egy kis szemetet;
Mikimóki rémületében eltört, és senki se ragasztotta össze. Dáthánt
kardostul eltemette egy sziklatömeg.
A tudós Abiron, sántán és bénán, egyedül vánszorgott ki élve a
roppant pusztulásból. Nehéz sora volt a tudós Abironnak. Kéz és láb
nélkül nem sokat ér az élet, különösen, ha az ember nem lát maga
körül egyetlen élő lelket se, a ki megitassa s kenyeret adjon neki.
Három napi vergődés után felvonszolta magát egy magaslatra, s
végre talált egy embert, a ki élt.
Az ember egy sziklán ült és zokogott.
Abiron megismerte, s láttára elfogta a düh. Elfelejtette éhségét
és szomjuságát, nem érzett egyebet, csak kimondhatatlan haragot.
Elfelejtette minden nyomoruságát, csak az volt az eszében, hogy ez
az ember az, a ki megjósolta Ninive pusztulását, s hogy ez az ember
most itt, előtte, jajgat.
– Te átkozott kuvik! – kiáltott fel – te szörnyü halálmadár, hát te
élsz?! Te, a ki ezt a kárhozatot hoztad városunkra, élsz és
pityeregsz?! De hisz tánczolnod kellene s vigadnod, hogy ennyi
szerencséd volt, s hogy alávaló jóslatod ilyen szépen betelt! De hát
miért pityeregsz, átkozott sirásó, miért sírsz, halál fattya, mondd?!
– Azért sírok – szólt Jónás, – mert olyan nagyon szőke volt.
AZ ISPILÁNTI LÁNYOK.
I.
A kis pásztor a fűben feküdt és nádsípját fujta. Egyszerre
észrevette, hogy’ messziről, a Fellegvár felől, három kis pillangó száll
le a rétre. Egy vörös, egy sárga és egy fehér. A hogy közelebb értek
hozzá, látta, hogy nem pillangók azok, hanem három kicsi
grófkisasszony.
A kis pásztor leeresztette a nádsipot s eltátotta a száját. Nem
mert lélekzeni a fűben; csak nézte őket.
A kicsi grófkisasszonyok vigan ugrándoztak a harmatos gyepen. A
legnagyobb, a vörös ruhás, megfogta a szoknyácskája szélét s
danolászva tánczolt. A középső, a kin sárga ruha volt, virágokért
szaladgált s szőke hajába egy csunya pipacsot dugott. A legkisebbik,
a fehér ruhás, ugy futkosott körülöttük, mint egy édes kicsi nyul.
A kis pásztor csak nézett. Nádsipját elfelejtette, és félt.
Egyszerre a pillangók fölkerekedtek és odább szállottak. A fűben
rejtőzködő két szem követte őket. Egy darabig messziről, nagyon
messziről, valami vékony, czérnahangu danolászás hallatszott, aztán
eltünt a három piczi pont.
A kis pásztornak úgy tetszett, hogy hirtelen beesteledett. Nem
vette elő a nádsipot, hanem a Fellegvárt nézte, melyet lassankint
eltakart az alkony és a köd.
Aztán felszedelőzködött, nagy lassan megindult hazafelé, és
sokáig elgondolkozott.
Olyan sokáig gondolkozott, hogy e közben a grófkisasszonyok
felnőttek. Egyik a másik után.

II.
A grófkisasszonyokat úgy hivták, hogy: Langli, Flór, Eliant. Fenn
laktak a Fellegvárban, ott is az ó-toronyban, annak is a legfelső
emeletén.
Lentebb az apjuk lakott, a ki valóságos gróf volt. Tetőtől talpig
gróf; a feje búbjától a lábujja bütykéig. Ez a gróf igen sok névvel
ékeskedett. Mikor reggel fölkelt, mindig az volt az első dolga, hogy
elmondta magában valamennyi nevét. Ilyenformán:
– Én Fellegvári Hókusz-Pókusz Árgyil gróf vagyok, Henczida és
Bonczida örökös ura, Lárifári báró, Ispilánt herczege…
Délig tartott, a mig egészen elmondta.
Mikor öregedni kezdett, belátta, hogy ez a foglalkozás igen-igen
fárasztó. Attól fogva egy csatlós fiunak kellett helyette elmondania,
reggeltől délig, a litániát. De a csatlós fiu nem birta sokáig az
állapotot, s egy szép nap megszökött.
… Langli, egy reggel, a mint ablakából letekintett a rétre,
álmélkodva látta, hogy tündérek tánczolnak a gyepen, összefogózva.
A nap tüzesebben sütött, mint azelőtt; a bokrok zöldje melegebb
volt, s a virágok szinte kicsattantak a sötét pirosságtól.
Ugyanaznap a gróf magához hivatta Langlit és igy szólt hozzá:
– Langli, fiam, immáron tizenhat esztendős vagy. E nagy napon
egy komoly szóm van hozzád. Langli, fiam, soha se felejtsd el, hogy
én Fellegvári Hókusz-Pókusz Árgyil gróf vagyok, Henczida és
Bonczida örökös ura, Lárifári báró, Ispilánt herczege, s hogy te a
leányom vagy!
– Igen, apám – szólt Langli.
– Kincstáram üres, – folytatta a gróf – a jobbágyok oly renyhék s
a természet oly mostoha!… Hozományt vajmi keveset adhatok veled.
De rangodat ne felejtsd, Langli, s jusson eszedbe mindig, hogy
királyfi jön érted, nyolczlovas hintón, száz főből álló kisérettel,
aranynyal himzett s drágakövekkel kirakott ruhában. Langli, fiam,
menj fel az ó-toronyba, s nézd meg, nem jön-e a királyfi?
– Igen, apám – szólt Langli.
Felment az ó-toronyba, annak is a legfelső emeletére, a melynek
széles kiugrójáról el lehetett látni messze, igen messze. De csak a
tündéreket látta, a kik odalenn tánczoltak, a gyepen, összefogózva.
A királyfi nem jött.

III.
Jött azonban az Ifju Szerelem. Az Ifju Szerelem lovag-ruhát viselt
s prüszkölő fekete paripán érkezett.
– Szeretlek, szép kis Langli – szólt, s a hogy’ selymes,
felkunkorodott bajszát megpödörte, Langli, vörös ruhájában,
összerázkodott.
De eszébe jutott apja intése s igy felelt a lovagnak:
– Az én apám Ispilánt herczege s én az apám leánya vagyok.
Értem királyfi jön, nyolczlovas hintón, száz főnyi kisérettel, aranynyal
himzett, s drágakövekkel kirakott ruhában.
A lovag köszönt, felült lovára s belevágta sarkantyuját paripája
testébe. Aztán elvágtatott. Mikor már messzi volt, visszafordult és
búcsút intett. Majd tovaszáguldott és szem nem látta többé.
A tündérek is eltüntek a gyepről.
Ezenközben a gróf nagyon elbúsult a jobbágyok renyheségén s
jónak látta megtérni őseihez. Egy utolsót sóhajtott:

É Á
– Én Fellegvári Hókusz-Pókusz Árgyil gróf vagyok, Henczida és
Bonczida örökös ura, Lárifári báró, Ispilánt herczege – s kiadta
nemes lelkét.
Langli igen megsiratta őt s mikor könnyei kiapadtak, igy szólt
testvéreihez:
– Flór, Eliant, menjetek ki az erkélyre, s nézzétek meg, nem jön-e
a királyfi?
Semmit se láttak, Flór és Eliant.

IV.
– Mily szép vagy, Flór, aranysárga ruhádban! – szólt Langli egy
gyönyörü őszi este. – Szőke hajadnak fosztott selymét mintha
bűbájos törpék fésülték volna meg, s a nefelejts nem oly szelid, nem
oly kék, mint két édes szemed! Most már értem, mért nem jött a
királyfi. A királyfi terád vár!
De Flór nem felelt. Flór a vadászra gondolt, a kivel nemrég az
erdő tisztásán találkozott.
Langli, a ki, mióta apja meghalt, folyvást gyászruhát viselt, nap
nap után kint ült az ó-torony erkélyén. A királyfit leste, a Flór
királyfiját, a ki bizonyára utban volt már a Fellegvár felé.
– Porfelhőt látok – szólt néha. – Alighanem a királyfi jön.
De Flór sirva fakadt, s egy késő éjszakán megvallotta Langlinak a
vadászt.
Langli megrémült.
– Nem, kis Flórom – szólt könyörgő hangon – te ezt nem teheted
velünk. Nem felejtheted el ősz atyánk utolsó kivánságát, nem
alázhatod meg az én gyászruhámat, büszkeségem és lemondásom
sötét öltönyét. A királyfi már nem késhetik soká. Csak még egy
kicsinyég várj, édes szerelmem.
Flór sirt és még sokáig gondolt a vadászra.

V.
Rohant az idő, illantak az évek. Langlinak, a ki folyvást az
erkélyen ült gyászruhájában, a hosszu várakozásban megdermedt a
lába, s Flór homályosra sirta a szemét. Eliant egyedül járt le a rétre
virágot szedni.
Eliant karcsú volt, mint a szarvas-ünő, s oly szeliden, annyi
bizalommal nézett a világba, mint egy őzike, mely most lépett ki
először sziklaodvából, s nem ismerve semmi veszedelmet, nem fél
semmitől.
De a hogy hirtelen a pásztorra bukkant, a ki egy levágott fa
törzsére könyökölve nézte az égen uszkáló bárányfelhőket, maga
sem tudta mért, mégis megrettent.
A kis pásztor megnőtt azóta s már nem félt a fehér-ruhás lánytól.
– Jó napot, kicsi grófkisasszony – szólt vidáman, mert örült, hogy
ujra látja a fehér pillangót – csak nem tőlem ijedtél meg?!
Eliant még soha se látott pásztort, de azért nekibátorodott és
nem futott el.
– Megmutatom neked a legkisebb báránykámat – folytatta a
pásztor. – Fehér, mint a frissen esett hó, s ezüstös csengő van a
nyakán.
Eliant örült a báránykának, s kérte a pásztort, szedjen neki
virágot.
Azután mindenfélét beszélgettek. A pásztor azt mondta neki:
– Kedves emlékeim, édes reménységeim kis pillangója, oly régen
vártalak!
S attól fogva Eliantnak folyvást ez a pár szó járt a fejében.
Nem is titkolta el Flór és Langli előtt:
– Beszéltem a pásztorral, s nekem adta a legszebb báránykáját.
Flór és Langli nagyon megijedtek.
– Többet nem szabad lemenned a rétre – szólt szigoruan Langli.
– Kis Eliantom, felejtsd el a pásztort – könyörgött Flór – én sem
gondolok többé a vadászra.
De Eliantnak hiába beszéltek.
– Vissza akarok menni a pásztorhoz – szólt másnap, makacsul,
mint a rossz kis lányok. – Látni akarom a báránykámat. Báránykám
fehér, mint a frissen esett hó, s ezüstös csengő van a nyakán.
Langli igen megharagudott, s nem engedte, hogy lemenjen a
rétre. Flór pedig összetett kézzel kérte, hogy maradjon a toronyban,
s igy suttogott a fülébe:
– A királyfinak ma vagy holnap meg kell érkeznie. Mit szól, ha
megtudja, hogy nem várod jegyben, gyűrűben, hanem naphosszat
künn csatangolsz a réten?!
És a két szomorú leány körülfogta a kis fehér ruhást.
– Emlékezzél vissza apánkra, Ispilánt herczegére! Igy szenteled
meg végső akaratját?!
Eliant nem akart rájok hallgatni, de nénjei folyvást a halottról
beszéltek neki.
– Még jó, hogy nem érte meg ezt a szégyent! – szörnyüködött
Langli.
– Megfordul a sirjában – tóditotta Flór.
De Eliant csak a pásztorra gondolt.
– Virágot szedett nekem, s hogy kedvemben járjon, felkúszott
egy gyopárért a meredekre, a hol a madár se jár.
– S nem gondolsz apádra, a ki az életedet adta?
– Kedves emlékei, édes reménységei pillangójának mondott! –
suttogta Eliant.
– El kell szakadnod tőle – ismételte Langli.
– Oly régen várt! – könyörgött Eliant.
S egy ideig nem hajtott semmi szóra. De mikor egyszer zivatar
rázta meg az ó-torony ablakait, s a szélvihar sirámában Langli
felismerte apjuk szavát, megtört az akaratja. A rétre feketeség
borult; a pásztor messze volt.
– Legyen – szólt Eliant.
– Jó leány vagy – szólt Langli – s a királyfi le fogja hozni érted az
ég csillagait.
– Azért mindig ő rá fogok gondolni – sugta Eliant Flórhoz.
– Egy darabig – felelt Flór. – Aztán elmúlik minden.

VI.
Eliant ajka szinte kicsattant a tüzes pirosságtól. A szeme égett, és
házi dolgoktól formátlan, barnás kis keze remegett. Nem lelve egy
pillanatnyi nyugtot, mint egy megszállott hánykolódott ágyában. És
vére keringett, keringett szilajon.
A mult két kisértete ott ült az ágya mellett, mozdulatlanul.
Eliant szólt:
– Nézzétek meg, nem jön-e a királyfi?
Langli már nem igen tudott járni, és Flór csak keveset látott. A
szürke kisértetek mégis összefogóztak s kimentek az ó-torony
erkélyére.
De a királyfi nem jött.

VII.
Sok év haladt el. A lovag, a vadász és a pásztor, csontkezüket
szépen összekulcsolva, feküdtek a földben s Fellegvár leányai még
folyvást várták a királyfit.
Szellemekhez hasonlatos árnyék-alakjaik meg-megjelentek az ó-
torony erkélyén. Szürke ruhájukat látva, a libapásztor lányok ijedten
futottak vissza a faluba, s a kis csordás fiu egy terebélyes fa mellől
álmélkodva nézte szüntelen bolyongásukat. Sóhajtásaik
elhallatszottak a rétre, s a faluban keresztet vetve beszélték, hogy
husz év óta egyik sem evett s hogy a béna ismét jár, mint a hogy a
hazajáró lelkek. De fergetegben kellett őket látni! Vad tánczot jártak
a villám fényénél, s mikor a zivatar elvonult, üvöltésük betöltötte a
tájt.
A Fellegvár pedig pusztult, egyre pusztult. Kövét belepte a moha;
falai összeroskadoztak; ember, állat nem mert a közelébe menni.
Utóljára már messziről is látszott, hogy csak pókhálóból vannak a
falai. A hold keresztülsütött rajta.

VIII.
Egy este roppant köd szállt a rétre. Ez a köd betöltötte a kunyhók
piczi kertjeit, nehézzé tette az alvók lélekzetét, s teljesen eltakarta a
Fellegvárt.
Reggel, mikor a nap ismét letűzött a rétre, a pókhálóvár és a
gróf-kisasszonyok eltüntek. Szétfoszlottak, mint a köd és az álom.
DOM GIL, A ZÖLD NADRÁGÚ.
(PORTUGÁL HISTÓRIA.)

I.
Mély gyászba borulva ült Dom Gil, a zöld nadrágú, a Szent-Bálint-
vendéglő erkély-ajtajánál, mely a Tajora bámult.
Kócsagtollas birétomát lehúzta az orrára, és előkelő ujjai
szomoruan turkáltak fürteiben, melyek egy idő óta fehér szinben
hivalkodtak. Szomoruan, mondom, mert az október hónap
gyalázatos még Portugalliában is.
Odakünn, a Tajo piszkos habjai lomhán hömpölyögtek a nagy
semmi felé. Az utczán fázós emberek nyargaltak adni és venni,
rászedni felebarátjaikat, koldulni vagy páváskodni, s legkivált enni,
hosszan, hosszan, örökkön enni, mint a sertések. Mindezek az
emberek el valának merülve szennyes gondolataikba, s nem látták
Dom Gilt és az ő zöld nadrágját.
Benn, a korcsmában, már alig volt ember. A pinczérlegények
unták a létet, és ásitozva csörömpöltek tányéraikkal. Ezek se vették
észre a Dom Gil zöld nadrágját. Megszokták már régen.
Dom Gil fázott, el volt keseredve, és nem találta helyét a
világban. Öngyilkos gondolatok emésztették, és kétségbeesetten
ismételgette:
– Meg fogok házasodni, meg fogok házasodni.

II.
A legsötétebb gondolatok a legcsábitóbbak. Az örvény mindig
jobban vonz, mint a forrás. S Dom Gil, számos üveg xeresitől
megittasodva, makacsul megmaradt fekete elhatározása mellett.
Csakhogy volt egy kis bibéje a dolognak.
Dom Gil értett ezer dologhoz, tudott mindent, Dom Gil gyönyörü
közjátékokat irt, s zöld nadrágja a legszebb zöld nadrág volt egész
Portugalliában. De mivel rendet tartott a tanulmányaiban, s a
hívságok tanulmányozását kilenczvenedik évére tartotta fenn, Dom
Gil nem igen tudott különbséget tenni szoknya és szoknya között.
– Tanácsot fogok kérni Dom Sanchotól.
Ez a Dom Sancho nevezetes ember volt. Egész nap a kávéházban
ült és folyvást hunyorgatott. Nagyra becsülte a Dom Gil zöld
nadrágját, s tele volt kiváló erényekkel.
– Ó, Dom Sancho – kérdezte tőle Dom Gil – ért-e ön a kicsinyes
hívságokhoz?
– Fölötte – válaszolt Dom Sancho. – De semmit se tudok jobban,
mint az asszonyra vonatkozó tanulmányokat. Tudom, mit mondanak
róla az egyházatyák és a szent inkvizitorok, s képes vagyok értekezni
róluk úgy a történelem, mint a bölcsészet és a néprajzi tudományok
nézőpontjából. Nem titok előttem a hét asszonyi szépség, s könyv
nélkül tudom a hetvenhét módot, a melyen megnyerhetni őket.
Félelmetes tudós vagyok e tekintetben.
Dom Gil nagyra becsülte a Dom Sancho itéletét, mert nem volt
ismeretlen előtte, hogy Dom Sancho nagyra becsüli az ő zöld
nadrágját. Azért ilyeténképpen szólt Dom Sanchohoz:
– Asszonyt keresek.
A meglepő kivánság Dom Sanchot nem hozta zavarba:
– Menjünk a Szent-Izidor-kávéházba – szólott.
III.
A Szent-Izidor-kávéház fényesen ki volt világitva. Az apró kerek
asztalok körül asszonyok és lányok ültek nagy füstfelhőben,
mindannyian türelmesen, némelyek egy-egy nemes úr oldalán. A
nagyobb társaságban ülő hölgyek többet ittak és többet
beszélgettek; ellenben azok, a kiket nem környékeztek nemes urak
vagy harczfiak, csöndesebbek és szomoruak voltak.
Alig hogy beléptek, Dom Gil figyelmét két hölgy keltette fel, a kik
egy asztalnál ültek, de egy szót sem szóltak egymáshoz. Az egyik
éltes delnő volt, s evett, a mennyire a fogai engedték; a másik fiatal
leány. Ez nem evett, ellenben úgy nézett maga elé, mintha
mindenen csodálkoznék: a sürgő-forgó pinczérlányokon, a pipázó
harczfiakon, a faragványos oszlopokon, és a sárgaréz-amoretteken
is, a melyek mézzel teli poharat tartottak eléje.
Dom Gil hirtelen elhatározással fölkelt, ott hagyta Dom Sanchot a
gránát-vize mellett, s a hölgyekhez sietett. Asztalukhoz érve, levette
birétomát, mélyen meghajlott és tisztelettudóan így szólt:
– Én Dom Gil vagyok, a zöld nadrágú.
A hölgyek előbb összenéztek, aztán mindaketten felállottak. Az
éltes delnő lenyelt egy nagy darab süteményt, és helylyel kinálta
meg Dom Gilt. A fiatal leány így szólt:
– Nevem Melancolia.
– Nemde, kisasszony – kérdezte Dom Gil – ön édes testvére ama
nagyhirü Dulcineának, a kiért spanyolországi rokonom, az elmés,
nemes Don Quijote de la Mancha epedett?! Vonásai és szende
arczulata kétségtelenné teszik ezt előttem.
– Nem, uram – felelt a fiatal leány – én egyszerüen Melancolia
vagyok.

Ó
– Ó, nemes Dom – vágott közbe az éltes delnő – ne ejtsék önt e
szavak tévedésbe: Önnek van igaza. Húgom maga sem ismeri úri
rokonságát, mert gyermekkorában czigányok rabolták el szüleitől, kik
azóta meghaltak. Legyen üdvözölve asztalunknál!
Dom Gil leült, és jó sokáig maradt a hölgyek asztalánál, mert igen
jól találta magát. Elbeszélgettek különböző szép dolgokról: a május
hónap bájáról, az érett kor előnyeiről, és még sok egyebekről.
Tulajdonkép csak az éltes delnő beszélt. A fiatal leány hallgatott, s
nagy fekete szeme csodálkozva tapadt a Dom Gil ősz szakállára.
Mikor Dom Gil elhagyta a Szent-Izidor-kávéházat, jókedvü volt, és
így szólt Dom Sanchohoz:
– Feleségül veszem e leányt.
– Vagy úgy?!… – álmélkodott Dom Sancho.
De többet nem szólt egy szót se, mert Dom Sancho filozóf volt.

IV.
A harangok zúgtak, a püspök latin szavakat mormogott,
Melancolia csodálkozva nézte az oltár faragványait, s Dom Gil
büszkén feszitett zöld nadrágjában a templomi nép előtt. A frigy
megtörtént.
Szégyenkezve kell megvallanunk, hogy Dom Sancho, valahol
hátul, épp úgy vigyorgott, mint a többi szájtátó. S mikor este, a
kávéházban elmondta czimboráinak az egész történetet, hozzá tette,
hogy a szegény Dom Gil, akármily kiváló férfiu is az ő zöld
nadrágjában, semmit se sejt az asszonyok hetvenhét gonoszságáról.
Az eseten sokat nevettek. A portugál tudvalevőleg a legvidámabb
nép egész Európában, s mint az ének mondja:

Vigan dudál
A portugál;
Mindegy neki: jó, rossz hajó,
Május avagy deczember hó,
Vigan dudál
A portugál.

V.
Melancolia, mikor először szétnézett a világban, azon vette észre
magát, hogy őt keresztül-kasul szerették urak és borbélylegények. A
borbélylegények egy kicsit többször verték meg, az urak egy kicsit
rosszabbul bántak vele: ennyi volt az egész különbség.
Dom Gil nem verte meg soha s Dom Gil nem bánt vele rosszul.
Melancolia igen különösnek találta ezt az ősz szakállu embert.
És mikor az éltes delnő egyszer néhány szót sugott a fülébe, úgy,
hogy Dom Gil ne hallja: Melancolia életében először mondott
valamit.
Azt mondta, hogy:
– Nem. Ő igen különös ember, és én engedelmes szolgálója
leszek.
Az éltes delnő nem tudott hova lenni bámulatában.
De igen okos asszony volt ám ez az éltes delnő, s leküzdvén
felindulását, így szólott magában:
– Bizzuk az időre a dolgot.
A mit az éltes delnő az időtől várt, azt sokkal jogosabban
várhatta volna a zöld nadrágtól. De még az éltes delnő sem volt oly
okos és számitó, hogy figyelembe vette volna a Dom Gil zöld
nadrágját.
Egy szép nap Dom Gil fölkerekedett és így szólt Melancoliához:
– Elmegyek a hársfák és a tölgyek közé. A hársfák és a tölgyek
szeretik nézni zöld nadrágomat.
Melancolia egyedül maradt és csudálkozva nézett körül a
szobájában.

VI.
Nem tudnám egész bizonyosan megmondani, hogy a hársfák és a
tölgyek csakugyan annyira lelkesedtek-e a Dom Gil zöld nadrágja
iránt, mint Dom Gil képzelte, de annyit mondhatok, hogy ez a zöld
nadrág igen különös nadrág volt.
Mert bűvös nadrág volt ám ez a zöld nadrág, úgy tessék
elgondolni. Kelméjét nagy szakállu törpék szőtték smaragd kövek
fénysugaraiból, és tündérek voltak a szabói. Nem is a Dom Gil
számára csinálták; csak úgy jutott hozzá rejtelmes véletlenből.
Minden emberöltőben készitenek ilyet a láthatatlan munkások, s a
zöld nadrág azé, a ki nem keresi, hanem csak úgy, véletlenül akad
rá.
Dom Gil nem kereste; úgy bukkant rá, a mint egy holdvilágos
este az erdőn barangolt. »Lám, milyen szép zöld nadrág! – szólt
magában. – A szövete szint játszik, és czimernek aloe-virág van
hímezve rajta.«
Dom Gil szegény volt, mint a templom egere, és öltözete
rongyokból állott. Felhúzta a szép zöld nadrágot, és végig
páváskodott vele az ezüst párás tisztáson.
Mikor a cserjéhez ért, már világosan hallotta, a mint egy csóka
azt mondta egy varjúnak:
– Ime, a dicső Dom Gil, a ki nagy dolgokra van hivatva!
– Az ám, szegény Dom Gil! – sajnálkozott a varjú.
A ki a zöld nadrágot felhúzta, tisztán értette a madarak beszédét.
De nemcsak a madarak nyelvén tudott, hanem értette azt is, a
mit a reszkető nyárfalevelek zizegnek egymásnak, s nem maradt
titok előtte, mit zúg az erdő sejtelmes éjszakákon, miért morognak a
hegyek, mit karatyolnak a kis vizek, és mért, kire haragszik a tenger.
A ki a zöld nadrágot felhúzta, az úgy olvasott az égboltozatból, mint
más a nyitott könyvből; a csillagok járásából ki tudta betüzni a
jövendő titkait, az abrakadabra abéczévé vált előtte, s ha azt akarta
megtudni, hogy akárhol mi történt, csak dobbantania kellett, hogy a
mult összes szolgáló szellemei ijedten jelenjenek meg
parancsszavára. A ki a zöld nadrágot felhúzta, megértette, miért
sietnek a kis folyók a tengerbe, miért les a menyét a szárnyasokra,
és tudta, hogy mit akarnak a szegény kis földi férgek. Mondom,
bűvös nadrág volt ez a szép zöld nadrág.
De – reszkessetek a tündérektől, ha ajándékot hoznak is! – a zöld
nadrágnak volt egy szörnyü átka. A ki felhúzta, azt menten elfogta
egy égető szomjuság: az a vágyakozás, hogy emberek és madarak,
erdő és tenger, plánták és földi férgek, mind, mind azt susogják
körülötte folyton, örökké:
– Ó, milyen szép zöld nadrág! Ó, milyen szép zöld nadrág!

VII.
– A hársfák és a tölgyek szeretik nézni zöld nadrágomat – így
vigasztalta magát Dom Gil, a hányszor az utczagyerekek
megcsúfolták és köveket dobáltak utána. És egyre többet járt a
hársfák és a tölgyek közé, a melyeknek csak ő értette a nyelvét.
Melancolia ezalatt egyedül ült otthon és pergette a rokkáját.
Melancolia nem értett semmit; csak nézett ki az ablakon nagy, fekete
szemével, de nem látott odakünn egyebet érthetetlen tarkaságnál.
Melancolia sehogy se tudta felfogni, mire ez az egész, különös világ.

VIII.
Dom Gilnek a házikója künn állott a város végén, közel az
erdőhöz. A házikó előtt egy kis kék pántlika folydogált, melyet Dom
Gil úgy hítt, hogy: a folyó.
Egyszer, a mint Melancolia egyedül üldögélt ablakánál, rokkáját
pergetve, egy vándor tartott a kis kék viz felé, láthatóan azért, hogy
szomjuságát oltsa. Vidám vándor volt; kakastollas kalapját
félrecsapta a fején s harsányan fütyörészett.
A mint meglátta Melancoliát az ablaknál, hirtelen mást gondolt.
Oda ment az ablakhoz s bekiáltott hozzá:
– Ereszsz be, szép virágszál.
– Nem – felelt Melancolia – ő igen különös ember, s én
engedelmes szolgálója leszek.
De az ajtó nyitva volt, és a vándor bement.
– Csak egy csókot kérek – szólott a küszöbről. – De ha kettőt
adsz, azt se bánom.
– Nem lehet – szólt Melancolia. – Ő igen különös ember, s én
megígértem, hogy engedelmes szolgálója leszek.
– Ne tréfálj, lelkem – suttogott a vándor. – Szép asszonynak nem
a rokkánál a helye.
– Ó – zokogott Melancolia – mily borzasztó, hogy meg kellett
csalnom ezt az igen különös és igen derék embert!…
– Isten jó nap, szolgám – készülődött a vándor. – Még hosszu
utam van, s mindjárt beesteledik.
– De hát kicsoda vagy? És hová méssz? Nem jössz vissza többet?
– A nevem: Soha Másnap – válaszolt a vándor.
Félrecsapta a kalapját és fütyölve ment tovább. Melancolia
csudálkozva nézett utána.
IX.
Ettől fogva Melancolia összetett kézzel ült rokkája mellett és csak
nézett ki az ablakon. A munka nem haladt előre, de Melancolia nem
bánta.
És sorra előjöttek a Szent-Izidor-kávéházi ismerősök, mondván:
– Az eszelős nincs itthon, Melancolia. Mért nem eresztesz be?
Melancolia vállat vont, és az ismerős bement.
Ezek legalább selyemkendőkről, csipkés ruhákról és fülbevalókról
beszéltek neki. Dom Giltől pedig már soha se hallott egyebet, csak
azt, hogy:
– Megyek a hársfák és a tölgyek közé.
A szomszédok eleinte csak nagyokat nevettek, s »helyes«-t
bólingattak, mert Dom Gil nem ivott velök. Később azonban nagyon
megharagudtak, látván, hogy Dom Gil nem jött rá a dologra.
Egy szomszéd érte ment a hársfák közé és igy szólt hozzá:
– Nemes Dom, kövessen engem, hogy ha látni akar valamit.
És mondott még egyet-mást, nem tudom mit.
– Az nem igaz – szólt Dom Gil. – Ő édes testvére Dulcineának,
kiért spanyolországi rokonom epedett.
De igaz volt.
– Meggyaláztad zöld nadrágomat! – kiáltott fel Dom Gil, s kiűzte
házából Melancoliát. Aztán sirva fakadt, s elment a hársfák és a
tölgyek közé, elpanaszolni nekik bánatát.

X.
Egy este kopogtattak a Dom Gil ajtaján. Ismeretlen ember nyitott
be, a ki igy szólt hozzá:
– Uram, egykori feleséged nagy nyomoruságban fekszik a Szent-
Balázs-ispotályban. A sebek elemésztették arczát, és a lehellete
türhetetlen. Koldusabb a koldusnál, és ha te is elhagyod, mint
elhagyta mindenki, a közös élelmen fog tengődni, s a közös sirba
fogják eltemetni.
Dom Gil fehér lett mint a fal, és azt mondta, hogy:
– Megyek.
Mikor az ispotályhoz értek, az ismeretlen igy szólt:
– Nem fogsz ráismerni, uram. Nagyon megváltozott. Nincs meg
belőle semmi, csak a nagy fekete szeme.
Dom Gil fölemelte a fejét.
– Tévedésben vagy, uram – szólt kevélyen. – Azon a napon,
melyen megtaláltam zöld nadrágomat, szent fogadást tettem, hogy
mindenha gyámola leszek a szegényeknek, az elhagyatottaknak, a
betegeknek. Ezért jöttem el. És ne hidd, mintha lágy érzelmek űztek
volna e küszöbhöz. Ahhoz, a kinek ilyen zöld nadrágja van, nem fér
efféle gyengeség.
És megigazitotta fején birétomát.

XI.
Melancolia hosszu ideig sinlődött. Ez idő alatt Dom Gil hűségesen
megtartotta szent fogadását, melylyel zöld nadrágjának tartozott, s
egész nap ott ült a szerencsétlen mellett. Lágyan szólt hozzá, mint
gyerekhez szokás, s igyekezett kitalálni titkos óhajtásait. Beszélt neki
a plánták díszruháiról, a csillagok kalandos utjairól, s a pacsirta
szerelméről. Melancolia csak nézte, s hallgatott.
– Mire gondolsz, Melancolia?
– Ó, Dom Gil, azon gondolkozom, hogy milyen különös és milyen
derék ember ön!

XII.
Egy napon végre a kaszás ember megjelent a szegény nyomorult
ágyánál. Leült a lábánál, mintha otthon lett volna, s egy kicsit
várakozott. Melancolia csodálkozva nézett rá.
Dom Gil ráborult az ágyra, s csöndesen sirdogált. Bizonyára
megfeledkezett arról, a mit az ismeretlennek mondott vala.
– Ó, Dom Gil – szólt Melancolia – adja ide a kezét, hadd
csókoljam meg!
Egész életében soha se szólt máskor, csak ha kérdezték. Most
beszélt magától legelőször.
Dom Gil nem mocczant. A sovány, nedves kéz bátortalanul
tapogatózott maga körül, mintha valamit keresett volna.
– Köszönöm, Dom Gil, hogy ilyen irgalmas volt hozzám, hogy
ápolt s nem hagyott el nyomoruságomban. Én nyomorultul
megcsaltam önt s ön nagylelkü volt irántam. Köszönöm, Dom Gil. És
még jobban köszönöm, hogy egykor, akkor nyájas volt hozzám.
Köszönöm, Dom Gil.
Dom Gil megfogta az erőtlen kezet és elboritotta csókjaival.
– Ön mindig különös ember volt, Dom Gil – folytatta Melancolia –
de most már tudom, hogy milyen fő-fő magas ember. Lám, milyen
szép aranyláncz van a nyakán, aranyláncz és aranykereszt,
gyémántokkal köröskörül… Ó, hogy elvakitanak ezek a gyémántok!…
Fáj látnom, Dom Gil, fáj látnom…
Látomásai voltak szegénynek. Dom Gil zokogni kezdett.
A kaszás ember lassan fölemelkedett és csontos ujjait rátette a
haldokló homlokára. Melancolia szeme csöndesen lecsukódott.
***
Harmadnap Dom Gil eltemettette Melancoliát, aztán kiment a
hársfák és a tölgyek közé, hogy kisirja előttük bánatát. Az erdő
értelmetlen dolgokat zúgott a fülébe, s Dom Gil igy panaszkodott a
nagy egyedülvalóságnak:
– S ő sem látta meg zöld nadrágomat!
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookbell.com

You might also like