CUSTOMIZATION FOR MOBILE EBOOK READERS

______

A Thesis

Presented to the

Faculty of

San Diego State University

______

In Partial Fulfillment

of the Requirements for the Degree

Master of Science

in

Computer Science

______

by

Swathi R. Simmula

Summer 2013

iii

Copyright © 2013 by Swathi R. Simmula All Rights Reserved

iv

DEDICATION

Dedicated to my Sai, Parents and Friends.

v

I climbed and climbed where is the peak my lord, I ploughed and ploughed where is the knowledge treasure my load, I sailed and sailed where is the island of peace my lord, almighty bless my nation with vision and sweat resulting into happiness -Dr. A. P. J. Kalam

vi

ABSTRACT OF THE THESIS

Customization for Mobile EBook Readers by Swathi R. Simmula Master of Science in Computer Science San Diego State University, 2013

Today’s users are often extensively dependent upon applications to accomplish their daily needs. Mobile applications help the users in the following ways: accessing email, navigation, chatting, reading e Books etc. All these purposes are fulfilled only when there is a framework, which provides a complete mobile platform to achieve these tasks. Android is one of the mobile application based platforms for providing a wide range of applications that are reliable. An electronic book (variously, e-book, eBook, digital book, or even e-editions) is a book-length publication in digital form, consisting of text, images, or both, and produced on, published through, and readable on computers, Mobiles or other electronic devices. E-book websites can include the ability to translate books into many different languages, making the works available to speakers of languages not covered by printed translations. Depending on the device, an e-book may be readable in low light or even total darkness. Many newer readers have the ability to display motion, enlarge or change fonts, use Text-to- speech software to read the text aloud for visually impaired, partially sighted, elderly or dyslectic people or just for convenience, search for key terms, find definitions, or allow highlighting bookmarking and annotation. This research paper describes how these features can be achieved with an android application. It also describes what methods are used and what the limitations were, while the application was being built. Specifically this thesis develops an Android Application titled Customization for Mobile E-book Readers. The features developed include font changes, searches, social media posting, light mode change, background image change, bookmarks, and text-to-speech and reminder alarms.

vii

TABLE OF CONTENTS

PAGE

ABSTRACT ...... vi LIST OF TABLES ...... xi LIST OF FIGURES ...... xii ACKNOWLEDGEMENTS ...... xiv CHAPTER 1. INTRODUCTION ...... 1 1.1 Research Objectives ...... 2 1.2 Existing System & Analysis ...... 2 1.3 Proposed System (Application) ...... 4 2. ANDROID MOBILE APPLICATION AND ANDROID ARCHITECTURE ...... 5 2.1 Introduction ...... 5 2.2 Statistics and Facts ...... 6 2.3 Overview of the Mobile Application System (Market) ...... 6 2.4 Analysis of Android ...... 7 2.5 Acquisition by Google ...... 9 2.6 ...... 9 2.7 Version history ...... 10 2.7.1 Android 1.5 (Cupcake)...... 10 2.7.2 Android 1.6 (Donut) ...... 10 2.7.3 Android 2.1 (Eclair) ...... 10 2.7.4 Android 2.2 (Froyo) ...... 10 2.7.5 Android 2.3 (Gingerbread) ...... 10 2.7.6 Android 3.0 – 3.2 (Honeycomb) ...... 10 2.7.7 Android 4.0 (Ice Cream Sandwich) ...... 11 2.7.8 Android 4.1 & 4.2 (Jelly Bean) ...... 11 2.8 Android Architecture ...... 11 2.8.1 Applications ...... 11

viii

2.8.2 Application Framework ...... 11 2.8.3 Libraries ...... 13 2.8.4 Android Runtime ...... 13 2.8.5 Kernel ...... 13 2.9 Application components ...... 15 2.9.1 Activities ...... 15 2.9.2 Services ...... 16 2.9.3 Content providers ...... 16 2.9.4 Broadcast Receivers ...... 16 2.10 Activating Components ...... 17 2.11 Application Resources ...... 18 2.11.1 Internal Application Organization ...... 19 2.11.2 Activity Life Cycle of an Android Application and its States ...... 19 2.12 Native Application Interface ...... 19 2.13 Dalvik Virtual Machine ...... 20 2.14 Garbage Collection ...... 23 2.15 Power Management ...... 23 2.16 Application Framework ...... 23 3. APPLICATION DESIGN ...... 25 3.1 Introduction ...... 25 3.2 Software Development Model: (Water Fall Model) ...... 25 3.2.1 Requirements ...... 25 3.2.2 Design ...... 26 3.2.3 Construction ...... 26 3.2.4 Testing...... 26 3.2.5 Installation...... 27 3.2.6 Maintenance ...... 27 3.3 Front End or User Interface Design ...... 27 3.4 About Java Programming Language ...... 28 3.4.1 Platform Independent ...... 28 3.4.2 Simple ...... 29 3.4.3 Object Oriented ...... 29

ix

3.4.4 Robust ...... 29 3.4.5 Distributed...... 29 3.4.6 Portable ...... 29 3.4.7 Dynamic ...... 30 3.4.8 Secure ...... 30 3.4.9 Interpreted ...... 30 3.4.10 Architecture Neutral ...... 30 3.4.11 Multithreaded ...... 31 3.4.12 The Byte code ...... 31 3.4.13 Java Virtual Machine (JVM) ...... 31 3.5 UML Diagrams ...... 32 3.5.1 Use Case Diagram ...... 32 3.5.2 Activity Diagram ...... 32 3.5.3 State Chart Diagram ...... 32 3.5.4 Deployment Diagram ...... 33 3.6 Data Dictionary ...... 35 3.6.1 User details...... 35 3.6.2 Bookmark details ...... 37 3.7 Application Design ...... 37 3.7.1 Registration Page: ...... 39 3.7.2 Registration Success Screen ...... 39 3.7.3 Wrong Credentials ...... 40 3.7.4 Home Screen ...... 40 3.7.5 Bookshelf Page ...... 41 3.7.6 Change Mode Options Page...... 41 3.7.7 Search Text Screen ...... 42 3.7.8 More Options Screen ...... 43 3.7.9 Share on Facebook Wall ...... 44 3.7.10 Log on to Facebook ...... 44 4. TESTING AND DEBUGGING ...... 55 4.1. Testing Objectives ...... 55 4.2. Testing...... 55

x

4.2.1 White-Box Testing ...... 56 4.2.2 Black-Box Testing ...... 56 4.3 Login Test Cases ...... 57 4.4 Testing Application Features ...... 57 4.5 User Registration Authentication ...... 57 4.6 Data Field Validation ...... 59 5. CONCLUSIONS AND OBSTACLES ...... 60 6. FUTURE WORK ...... 61 REFERENCES ...... 62

xi

LIST OF TABLES

PAGE

Table 3.1. Profile Details ...... 36 Table 3.2. Book Details ...... 37 Table 4.1. Test Cases ...... 57 Table 4.2. Application Features ...... 58

xii

LIST OF FIGURES

PAGE

Figure 1.1 Cellular mobile switching center, adapted by V. Koudounas and O. Iqbal...... 2 Figure 1.2. Flow chart of the customizable bookshelf mechanism (made with Visio)...... 3 Figure 2.1. Organizations of the mobile ecosystem (done with Visio)...... 7 Figure 2.2. Global mobile device – usage growth...... 8 Figure 2.3. Android architecture...... 12 Figure 2.4. Application internals...... 20 Figure 2.5. Life cycle of an activity...... 21 Figure 2.6. Dex file structure...... 22 Figure 3.1. Definitions of different phases of the water fall model...... 26 Figure 3.2. Development process of JAVA program...... 32 Figure 3.3. Usecase diagram...... 33 Figure 3.4. Activity diagram...... 34 Figure 3.5. Statechart diagram for bookshelf...... 35 Figure 3.6. Deployment diagram for bookshelf...... 36 Figure 3.7. Welcome page...... 37 Figure 3.8. Login page...... 38 Figure 3.9. Registration page...... 39 Figure 3.10. Registration success page...... 40 Figure 3.11. Wrong credentials page...... 41 Figure 3.12. Home page...... 42 Figure 3.13. Bookshelf page ...... 43 Figure 3.14. Page content...... 44 Figure 3.15. Change mode page...... 45 Figure 3.16. Book in night mode...... 46 Figure 3.17. Search text word found page...... 47 Figure 3.18. Text not found page...... 48 Figure 3.19. More options page...... 49

xiii

Figure 3.20. Title added to Bookmarks...... 50 Figure 3.21. Bookmarks screen...... 51 Figure 3.22. Set alarm screen...... 52 Figure 3.23. Share on Facebook wall screen...... 53 Figure 3.24. Facebook login screen...... 54

xiv

ACKNOWLEDGEMENTS

I would like to thank almighty for all the strength and courage he has showered on my family, and me, and also for giving me an opportunity to do my graduation from such a prestigious school, and work closely with several professors. I hope that the knowledge that I acquired through this thesis helps me to enhance my career prospects in the field of my interest. I would also like to extend my gratitude and sincere thanks to my thesis advisor and thesis committee chair Dr. Joseph Lewis for all the support and encouragement he has given me in completing my thesis work. I would also like to extend my special thanks to my committee members Dr. Carl Eckberg and Dr. Satish K. Sharma for serving on my committee and also for their valuable guidance.

1

CHAPTER 1

INTRODUCTION

Customizable Bookshelf System maintains the details of the books. Books are portable, consist of text, and are readable on computers, mobiles or other electronic devices. Using this application a user can post messages on Facebook, and a ‘bookmark’ is used to move quickly to a particular chapter or subsection. The features provided should make the mobile reading experience complete and rewarding. The system has reading features such as Day/Night mode, Text-To-Speech, modify the book details. Today the use of cell phones has become an amazing part of daily life. Next we are going to describe briefly about the history and current state of mobile technologies. Mobile technology took off with the introduction of Cellular telephony, which in turn allowed a large number of user connections through utilization of efficient frequencies. Analog technologies were used during of the 1980’s, when the most well known systems were Nordic Mobile technology-NMT900 and 450. Then later in the 1990’s, the digital technology was proposed with GSM (Global System Mobile), which is the most widely accepted system around the world today. A network of cellular devices consists of several mobile devices connected in such a way that they in turn are linked to one switching unit, which is then connected to a fixed Public Switched Telephone Network (PSTN). This technology is then incorporated into several transceivers called Base Stations (BS), which communicate with the Mobile Switching Center (MSC). It is responsible for switching calls from the caller to the receiver (Figure 1.1 [1]). The next generation mobile technology that has begun is 3G technologies. 3G technologies are a replacement for GSM technology. The mobile Internet speed for the 3G technologies began with 384kbps, which is in the range of DSL speeds. This speed added a new feature of video calling in the 3G technologies, which was a drawback in the GSM technology. The latest version is 4G-network technology, which has been getting a lot of focus by the research community. 4G technologies have the following cellular standards:

2 PSN

Other MSC MSC Other

MSC

B B B B B B B

B

Figure 1.1 Cellular mobile switching center, adapted by V. Koudounas and O. Iqbal. Source: V. Koudounas and O. Iqbal. Mobile Computing: Past, Present and Future, n.d. http://www.doc.ic.ac.uk/~nd/surprise_96/journal/vol4/vk5/report.html, accessed June 2013.

3GPP LTE and IEEE 802.16, which are used both by mobile and stationary users. To maximize the power issues in mobile devices, these 4G standards will be used [2]. Now, working with these technologies, I came up with a lot of difficulties, such as configuring all these technologies into a single representation, working with these technologies on different versions of Android, supporting all the applications that are installed on the devices, and finally handling the variety of bugs in the mobile devices [3].

1.1 RESEARCH OBJECTIVES My research objective is to create an Android e-Book reader to support the advanced features related to e-Book readers through an android application. Following is the flow chart as to how the whole mechanism of tracing the bugs and improving the application works (Figure 1.2).

1.2 EXISTING SYSTEM & ANALYSIS The proponents would like to develop the E-Book Reader Android Mobile Application to address different Features of E-Books. To keep pace with the modernization, there should be room for improvement in the field of E-Books. Nowadays, there are more

3

Figure 1.2. Flow chart of the customizable bookshelf mechanism (made with Visio). apps from normal features to advanced primarily because of advantages brought by the use of Mobiles. The Current system is a web application with normal e-book reading features like  Change the font size.  Change the book page background.  Change the mode (Day/Night Mode) in which the page is being displayed.  Search for some content in the book using search keywords.  Auto Scrolling of the book content.  Save a favorite book title as a bookmark.

4

Using this application the normal user can have a basic reading experience of books. But these days connecting to social networking from existing apps has become nearly compulsory. And also visually challenged people must also be able to make use of these apps. These are the limitations we want to overcome in our proposed application.

1.3 PROPOSED SYSTEM (APPLICATION) To overcome the limitations in the existing application and to make users / readers of the e-Book more flexible we want to add or implement the following features in our proposed application.  Can get the voice form of the book content.  Can share the content of a book on a Facebook wall.  Can set alarm as a reminder to read a particular book in the future.  The above features can be implemented in Android using some advanced features in android as stated below. In this research paper, all the technical and design details of an Android application customizable bookshelf mechanism are described. The mobile application ecosystem and the complete android architecture are explained in chapter 2. In chapter 3, the android application design, how the customizable bookshelf works overall, the rules and limitations to the design process are described. Also the tests that are implemented in order to fulfill all the requirements of the customizable bookshelf mechanism are explained in chapter 4.

5

CHAPTER 2

ANDROID MOBILE APPLICATION AND ANDROID ARCHITECTURE

In the next five years, web access through computers will be overtaken by mobile access through mobile applications on handset devices like and tablets. It is expected that around one billion users will be accessing the web world through their mobile handsets by 2015. There are many such firms, which are still challenged and struggling with how to fulfill their customers and stakeholders needs through mobile platforms. The majority of them are still into the web version of the desktop applications as they were basically optimized for that purpose and not making use of the mobile version [4]. Today there are many procedures and limitations in the world of mobile application development. There are so many kinds of device properties & parameters such as the storage capacity, the capability of processing the data, and the fixed size of the screen. [5] With a rapid increase in cultivating these technological aptitudes, also with a rapid declining price of these technologies, the need for such innovative and useful applications is also increasing rapidly. Example: by the year 2013, the number of downloads and installations in the mobile devices will increase 700 percent, that is from 2.9 billion to 21 billion [6]. Considering all this growth in the mobile market, these firms need to increase their development policies rapidly. In order to do that they need to commence as follows:  Be careful about considering mobile application systems.  Characterize mobile application proposals.  Build strategies for remaining competitive in the market.  Serve their customers as much as possible.

2.1 INTRODUCTION We know that in the world of software and business applications, mobile applications are similar to others. For many years, organizations have released many applications for the

6 desktop and the web, and at last in the form of portable sized mobile devices like smartphones and tablets.

2.2 STATISTICS AND FACTS  By the year 2011, the global market for mobile application is about to reach a significant increase of $9 billion.  By 2015, it is predicted that shopping for goods and services with mobile phones will reach $119 billion, according to M-commerce [7].  Globally, 1.2 billion mobile devices have been sold, of which 172.4 million mobile devices are taking complete benefits of the mobile applications used by smart phones [8].  In the year 2009, totally 2.69 billion applications were downloaded and this aggregate amount is predicted to increase to about 21.3 billion by the end of 2013; that is a total increase of 700 percent in the mobile market [8, 9].  The most important well-known types of mobile application presently are:  E Books (17-20%)  Games (14%)  Entertainment (11%)  Education (7%)  Travel (6%)  Business applications are around 2.3 percent; common applications include location- based services, web browsing and fitness monitoring [10]. In order to understand these statistics and facts, there are individual needs to understand how the mobile ecosystem is managed.

2.3 OVERVIEW OF THE MOBILE APPLICATION SYSTEM (MARKET) The term Mobile Application Environment is based on many firms and organizations, which perform different tasks and complete augmentation of the mobile industry. These organizations have been distinguished into the following categories [11] (Figure 2.1):  Developers of the mobile OS  Device Makers (Hardware Providers)  Network operators of these devices (Telecom Services)

7

OS DEVELOPER

DEVICE MANUFACTURER

NETWORK OPERATOR

Figure 2.1. Organizations of the mobile ecosystem (done with Visio).

The top and biggest participant in the mobile application industry is Apple Inc.,which had 99.4% of mobile application sales in the year 2009, with nearly $4 billion in profit [8, 12] (Figure 2.2 [12]).

2.4 ANALYSIS OF ANDROID OPERATING SYSTEM Android is an operating system that is based on Linux for mobile devices such as smart phones and tablet computers. It was first developed by Android Inc and later acquired and improved by the Open Handset Alliance led by Google. Google purchased the actual developer of the software, Android Inc., in 2005 [13]. The introduction of the Android distribution was announced in 2007 with the beginning of the Open Handset Alliance, a syndicate of 86 hardware, software, and

8

Figure 2.2. Global mobile device – usage growth. Source: Wikipedia. Waterfall Model, 2013. http://en.wikipedia.org/wiki/Waterfall_model, accessed Dec. 2012 telecommunication companies dedicated to advancing open standards for mobile devices. Google releases the Android code as open-source, under the Apache License. The Android Open Source Project (AOSP) is aimed with the maintenance and further development of Android. Android has a large community of developers developing applications (also called "apps") that expand the functionality of the devices. Developers first write in a personalized version of Java [13-16]. Android SDK 2.3 and SDK 4.0 were used to check the application [17]. Applications can be downloaded from third-party vendor sites or through online stores such as Google Play (previously called Android Market), the app store run by Google. By Feb 2012 there were more than 450,000 applications available for Android, and the predicted number of applications downloaded from the Android Market by December 2011 exceeded 10 billion.

9

Surveys listed android as the best-selling platform worldwide in Q4 2010 with over 300 million Android devices in use by February 2012. According to Google's Andy Rubin, as of February 2012 there are over 850,000 Android devices activated every day [14-16].

2.5 ACQUISITION BY GOOGLE Google acquired Android Inc. on August 17, 2005, making Android Inc. a owned subsidiary of Google Inc. Key employees of Android Inc., including Andy Rubin, Rich Miner and Chris White, stayed in the company after the acquisition. Not much was known about Android Inc. at the time of the acquisition, but many assumed that Google was planning to enter the mobile phone market with this move [18]. Speculation about Google's intention for entering the mobile communications market continued to build through December 2006. Reports from the BBC and The Wall Street Journal noted that Google wanted its search and applications on mobile phones and it is working very hard to deliver that. Print and online media outlets soon reported rumors that Google is developing a Google-branded handset. Some speculated that Google is defining technical specifications; it was showing prototypes to cell phone manufacturers and network operators [18].

2.6 OPEN HANDSET ALLIANCE On November 5, 2007, the Open Handset Alliance, a consortium of several companies, which include Broadcom Corporation, Google, HTC, Intel, LG, Marvell Technology Group, Motorola, Nvidia, QUALCOMM, Samsung, Sprint Nextel, T-Mobile and Texas Instruments, introduced itself. The goal of the Open Handset Alliance is to develop open standards for mobile devices. On the same day, the Open Handset Alliance also introduced their first product, Android, a mobile device platform built on the version 2.6. On December 9, 2008, 14 new members joined, including ARM Holdings, Atheros Communications, Asustek Computer Inc, Garmin Ltd, Huawei Technologies, Packet Video, Softbank, Sony Ericsson, Toshiba Corp, and Vodafone Group Plc [16, 19].

10

2.7 VERSION HISTORY Android has introduced a number of updates since its original release, each fixing bugs and adding new features. Each version is named, in alphabetical order, after a dessert.

2.7.1 Android 1.5 (Cupcake) The Android version 1.5 came in April 2009. This version consisted of features such as: All the applications were accelerometer-based for rotation, soft keyboards on the screen, video recording and playback; all the core elements had UI updates provided. This version was based on kernel 2.6.27 [20].

2.7.2 Android 1.6 (Donut) The Android version 1.6 was released in September 2009. It has features such as different gesture support, supports higher screen resolution (WVGA), speech recognition system, Virtual Private Network. This version was based on kernel 2.6.29 [20].

2.7.3 Android 2.1 (Eclair) This version of Android was released in October 2009. This release gave major updates in the UI, and an improved media framework; it also supported syncing up of the corporate exchange mailing system. This version was on kernel 2.6.29 [20].

2.7.4 Android 2.2 (Froyo) It was released in May 2010. It had just in time compilers, tethering and Wi-Fi hotspot capability, based on kernel 2.6.32 [20].

2.7.5 Android 2.3 (Gingerbread) This version was released in December 06, 2010. It supports large screen size and resolution, NFC (Near Field Communication), which allows the users to get nearby tags in the form of advertisements or posters, support for SIP VoIP Internet telephony. This version was based on kernel 2.6.35 [20].

2.7.6 Android 3.0 – 3.2 (Honeycomb) On February 22, 2011, the first tablet was released. Motorola Xoom tablet was the first device that came with this version; it includes support for video chat using Google Talk,

11 supports multiple core processors and other UI related features. This version was based on kernel 2.6.36 [20].

2.7.7 Android 4.0 (Ice Cream Sandwich) This version was first previewed at a Google I/O event in May 2011 and officially launched on 19th October 2011. The new features include: enhanced speed and performance, 1080p video recording for stock Android devices, allowing of opening up to 16 tablets and many more. This version is based on kernel 3.0.1 [20].

2.7.8 Android 4.1 & 4.2 (Jelly Bean) Google announced Android 4.1 (Jelly Bean) at Google I/O conference on June 27, 2012. Based on Linux kernel 3.0.31, Jelly Bean is an incremental update for improving the functionality and performance of the user interface. The performance improvement involves "Project Butter", which uses touch anticipation, triple buffering, etc. [20].

2.8 ANDROID ARCHITECTURE The Architecture of Android, as shown in Figure 2.3 [16], is divided into five different layers, which are all inter-related to each other. From the bottom comes the Linux Kernel layer, sitting on top of that is the native library, next to that is the Android Runtime with the Dalvik Virtual Machine, the Application Framework and finally on top of the framework is the Application. This is also called the Software Stack [20].

2.8.1 Applications Android consists of a set of basic built-in applications including an email client, SMS program, calendar, maps, browser, contacts, and others. All applications are developed using the Java programming language [20].

2.8.2 Application Framework Android offers developers the ability to build extremely rich and innovative applications by providing an open source development platform. Developers are free to take advantage of the device hardware, access location information, run background services, set alarms, add notifications to the status bar, and much more [20].

12

Figure 2.3. Android architecture. Source: Android.com. Android Developers, n.d. http://developer.android.com, accessed Nov. 2012.

13

Developers get full access to the framework APIs used by the basic and core applications that are shipped with Android. The application architecture is designed to simplify the reuse of components; any application can publish its capabilities and any other application may then make use of those capabilities (that is, subject to security constraints enforced by the framework). This same system allows components to be replaced by the user. [20].

2.8.3 Libraries Android contains a set of libraries, which are developed using C/C++, and these are used by various components of Android. These abilities are made available to developers through Android application framework. System C library, Media Libraries, Surface Manager, LibWebCore, SGL, 3D libraries, Free Type, SQLite are some of the libraries available in Android [21].

2.8.4 Android Runtime Android contains a set of core libraries that provide most of the functionality available in the core libraries of the Java programming language. Each Android app runs in its own process, with its own instance of the Dalvik virtual machine. Dalvik has been written so that a device can run multiple Virtual Machines at a time very efficiently. The DVM executes files in the Dalvik Executable (.dex) format, which is optimized, for minimal memory usage and the Virtual Machine is register-based, which runs classes compiled by a Java language compiler that have been converted into the .dex format by the included "dx" tool kit in Android SDK. And the DVM depends on the top of Linux kernel for underlying functionality such as threading and low-level memory management [20].

2.8.5 Linux Kernel Android works on Linux version 2.6 for core application and system services such as memory management, process management, security, network stack, and driver model. The kernel also works as an abstraction layer between the hardware and the remaining stack of the software [21]. Application Fundamentals:

14

 Android applications are a collection of one or more application components (activities, services, content providers, and broadcast receivers) [21].  Each component performs a different role in the overall application behavior, and each one can be activated individually (even by other applications) [21].  The manifest file must declare all the fundamental components in the application and should also declare all application requirements, such as the minimum version of Android required and any hardware configurations required, and permissions that have to be given to the application. [21].  Application resources (images, strings, layout files, etc.) should contain alternatives for different device configurations (such as different strings for different languages and different layouts for different screen sizes etc.) [21]. Android applications are developed in Java programming language. The Android SDK tools compile the code along with any data and resource files into an Android package, a compressed file with an .apk extension. All the contents in a single .apk file is considered to be one application and is the file that the devices run on android use to install the application. [22]. In Android operating system, each application is a different user because it is a multi user Linux system. By default, the system will assign a unique Linux user ID to each application (this ID is used only by the system and it is not known to the application). The system sets permissions to all the files in an application so that only the user ID assigned to that application could access them [22]. Each process has its own virtual machine (VM), so that an application's code runs in isolation from other applications [22]. By default, every application runs in its own Linux process. Android starts the process when any of the application's components are to be executed, then shuts down the process when it is not used or when the system needs memory for other applications. In this way, the Android system implements the principle of least privilege. That is, each application, can access only the components that it requires to do its work and otherwise no need. This creates a very secure and good environment in which an application cannot access parts of the system for which permissions are not given [22]. However, there are ways for an application to share data with other applications and for an application to access system services:

15

We can arrange two applications, so that they share the same Linux user ID; by this they are able to access each other's files. To conserve system resources, applications with the same user ID are also arranged to run in the same Linux process and share the same VM (the applications must also be signed with the same certificate) [22]. An application can request permission to access device data such as user's contacts, SMS messages, the mountable storage (SD card), camera, Bluetooth, and more. The user must grant all permissions for the application at install time. That covers the basics regarding how an Android application exists within the system. The rest of this document introduces you to: The core framework components that are used for defining an application, the manifest file, where components and required device features are declared for that application. Resources that are separate from the application code and allow the application to optimize the behavior for a variety of device configurations [22].

2.9 APPLICATION COMPONENTS Application components are the important building blocks of an Android application. Each component is a different point through which the system can enter your application. Not all components are actual entry points for the user and some depend on each other. Each one is a unique building block that helps to define your application's overall behavior [21]. There are four different types of application components. Each type has a distinct lifecycle that defines how the component is created and destroyed. Here are the four types of application components:

2.9.1 Activities An activity is a single screen with a user interface. For example, an email application can have one activity, which shows a list of new emails, another activity to compose an email, and another activity for reading emails. Although the activities work together to get a user experience in the email application, each one is independent of the others. As such, a different application can start any one of these activities (if the email application allows it). For example, a camera application can start the activity in the email application, which composes new mail, in order for the user to share a picture [21].

16

2.9.2 Services A service is a component that runs in the background to perform long-running operations or to perform work for remote processes. A service does not provide a user interface. For example, a service can play some music in the background while the user is in a different application, or it can fetch the data using the network without blocking user interaction with an activity. Another component, such as an activity, can start the service and let it run or can bind the service in order to interact with it [21].

2.9.3 Content providers Content provider manages application data, which is shared by different components of an Application. An application can store the data in the form of files, an SQLite database, on the web, or any other permanent memory location, which can be accessed by the application. With the use of content provider, other applications can retrieve or update the data (if permission is given). For example, the Android system provides a content provider that manages the user's contact information. As such, any application with the proper permissions can query part of the content provider (such as Contacts Contract Data) to read and write information about a particular person [21]. A content provider is created as a subclass of Content Provider and must implement a standard set of APIs that enable other applications to perform transactions [21].

2.9.4 Broadcast Receivers These are the components that respond to system based broadcast announcements. Many broadcasts originate from the system, for example a broadcast announcing that the screen has turned off, the battery is low, or a picture was captured. Applications can also initiate broadcasts, for example to let other applications know that some data has been downloaded to the device and is available for them to use. Although broadcast receivers don't display a user interface, they may create a status bar notification to alert the user when a broadcast event occurs. More commonly, though, a broadcast receiver is just a "gateway" to other components and is intended to do a very minimal amount of work. For instance, it might initiate a service to perform some work based on the event [21]. A broadcast receiver is created as a subclass of Broadcast Receiver and each broadcast is delivered as an Intent object. This class is a subclass of the Receiver class.

17

A unique aspect of the Android system design is that any application can start another application’s component. For example, if you want the user to capture a photo with the device camera, there's probably another application that does that and your application can use it, instead of developing an activity to capture a photo yourself. You don’t need to incorporate or even link to the code from the camera application. Instead, your application can simply start the activity in the camera application that captures a photo. When complete, the photo is even returned to that application so it can be used. To the user, it seems as if the camera is actually a part of an her application [21]. Because the system runs each application in a separate process with file permissions that restrict access to other applications, an application cannot directly activate a component from another application. The Android system, however, can. So to activate a component in another application, it must deliver a message to the system that specifies intent to start a particular component. The system then activates the component [21].

2.10 ACTIVATING COMPONENTS Thus three of the four components (activities, services, and broadcast receivers) are activated by an asynchronous message called an “intent”. Intents connect individual components to each other at runtime, whether the component belongs to that application or another. An “intent’ is created with an object of the Java SDK Intent class of Android API, which defines a message to activate either a specific component or a specific type of component. Intents can be either explicit or implicit, respectively. For activities and services, an Intent defines the action to perform and may specify the URI of the data to act on (among other things that the component being started might need to know). For example, an Intent might convey a request for an activity like to start another activity, to open a document etc. In some cases, you can start an activity to receive a result, in which case, the activity also returns the result in an Intent. For broadcast receivers, the Intent simply defines being broadcast (for example, a broadcast to indicate the reception of an image or indicate that a message has been sent [21].

18

The other component type, content provider, is not activated by Intents. Rather, it is activated when targeted by a request from a Content Resolver [21]. There are separate methods for activating each type of component:  We can start an activity by passing Intent to the functions startActivity() or startActivityForResult () (when you want the activity to return a result).  We can start a service by passing an Intent to thestartService() method. Or it can bind to the service by passing an Intent to the function bindService().  We can initiate a broadcast by passing Intent to methods like sendBroadcast (), sendOrderedBroadcast (), or sendStickyBroadcast ().  We can perform a query to a content provider by calling query() on a Content Resolver.

2.11 APPLICATION RESOURCES An Android application is a combination of more than just java or native code. It needs resources, which are separate from the source code, such as images, audio files, etc. of the application. For example, you should define animations, menus, styles, colors, and the layout of activity user interfaces with XML files. Using application resources makes it easy to update various characteristics of your application without modifying code and by providing sets of alternative resources you are able to optimize your application for a variety of device configurations. For every resource that is placed in an Android project, the Android System build tools define a unique integer ID, which can be used to reference the resource from that application code or from other resources defined in XML [21]. One of the most important aspects of keeping your resources separate from source code is the ability to provide alternative resources for different device configurations. For example, by defining UI strings in XML, you can translate the strings into other languages and save those strings in separate files. Then, based on a language qualifier that is appended to the resource directory's name (such as res/values-fr/ for French string values) and the user's language setting, the Android system applies the appropriate language strings to you. [21]. Android supports many different qualifiers for alternative resources. The qualifier is a short string that is included in the name of resource directories in order to define the device configuration for which those resources should be used. As another example, a resource should often create different layouts for activities, depending on the device's screen

19

orientation and size. For example, when the device screen is in portrait orientation (tall), you might want a layout with buttons to be vertical, but when the screen is in landscape orientation (wide), the buttons should be aligned horizontally. To change the layout depending on the orientation, here you can define two different layouts and apply the appropriate qualifier to each layout's directory name. Then, the system automatically applies the appropriate layout depending on the current device orientation. So if you rotate a smartphone by 90 degrees, your image will change from portrait to landscape or conversely [21].

2.11.1 Internal Application Organization An Android application is organized into four different components Activity, Service, BroadcastReceiver and ContentProvider (Figure 2.4). Not all applications have all the four components together, but there has to be at least an Activity. The purpose for services, and broadcast receivers, is to let the application achieve certain tasks in the background. In terms of the time period, the broadcast receiver can be provoked by events and they execute only for a limited time; on the other hand a service continues for a maximum time [20].

2.11.2 Activity Life Cycle of an Android Application and its States In Android, the main state or component is its activities. Once the state changes, the processes related to the application also get manipulated. When a particular application starts, it also starts the individual component and also the activity linked to that application. It has the following order: onCreate (), onStart (), onResume () (Figure 2.5 [15]).

2.12 NATIVE APPLICATION INTERFACE Applications running in an android device require a certain functional level that can be partitioned other than what the Dalvik Virtual Machine proposes. The application runs in two parts: one remains in the Dalvik Virtual Machine that maintains the UI of the application and the other part executes as native code.

20

Figure 2.4. Application internals.

In an android application, native codes are in the shared libraries combined with the Java Native Interface (JNI). These libraries have to be a part of the .apk of the application (Android Application Package file or Android form of .exe file). The native library code is then linked to the address space of the application’s VM.

2.13 DALVIK VIRTUAL MACHINE All the android applications are developed in Java. But in the place of using a standard Java virtual machine, android uses its own Virtual Machine. This virtual machine is similar to the standard Java virtual machine (JVM), but it is improved for small android systems. The requisite byte code interpreter that is used by the VM is called Dalvik. Android uses the byte code format that is executed by Dalvik Virtual Machine, which gets modified according to the android target. This byte codes are packed together (compressed) and the system ultimately generates .dex files that are smaller in size than the usual Java byte code. [22, 23]. The DVM is specifically designed to run on android devices with least total memory of 64 MB of RAM. The actual application has only 20 MB left from the total of 64 MB of RAM. The two areas that needs to be considered for reducing the memory usage in the application are that space for the app must be small in size, and should optimize the memory allocation. For general file optimization, in place of wrapping and bundling the .jar files, they can be transformed into .dex (Dalvik Executable files) with the help of the dx tool. These

21

Figure 2.5. Life cycle of an activity. Source: Anddev.org. LifeCycle of an Activitiy, 2007. http://www.anddev.org/novice-tutorials-f8/lifecycle-of-an-activity-t81.html, accessed Nov. 2012.

22

files include the Dalvik byte code of the applications. The .dex files contain some unique data and many class files; all of them share the same string with one existence in the .dex file and multiple times it points to one string [22, 23] (See Figure 2.6 [20]).

Figure 2.6. Dex file structure. Source: D. Bornstein. Dalvik VM Internals, 2008. http://sites.google.com/site/io/dalvik-vm-internals, accessed Nov. 2012.

Memory allocation and optimization of Dalvik VM can be categorized into four kinds that are clean or dirty and shared or private. For application specific files like .dex files and libraries, data usually resides in either shared or private clean memory.

23

2.14 GARBAGE COLLECTION In Android, the application has a separate VM and so the garbage collector runs separately in each of the VM’s independently. As is the case with Java, a heap is used for dynamically allocated memory. To differentiate between allocated and free areas of the heap, certain mark bits are employed. The entire zygote process compels the garbage collection data structures (“mark bits”) to be kept separate on the heap. But if the mark bits lie next to the object on the heap, it converts the shared dirty memory into private dirty memory. So in order to reduce this process of private dirty memory, these marked bites are shared before a garbage collector runs and afterwards they are freed. The Dalvik Virtual Machine was basically designed with a simple interpreter, which did not have the capability to use the Just In Time (JIT) compiler. JIT was not seen in Android 1.0, due to lot of memory consumption. But the later versions came with JIT for ARM processors with low memory mark and improved performance. In just in time compilers, two types of JIT are: “method based”, which compiles the complete native code, whereas “trace based” only compiles one class path.

2.15 POWER MANAGEMENT Android uses Linux kernel version 2.6, which is modified to improve the android system needs. The Linux kernel is further extended by android drivers, power management requirement and accommodates the limited capacity of the android system. The most crucial capability is power management, where most modification is needed. As we know that android is open source, similarly the kernel is freely available through the Android source repository. There are kernels such as an architecture unspecific common kernel and an experimental kernel; these are found in the kernel repository. Many changes are made in the kernel mainline, which can be ranked into: fixing the bugs, expanding the user space (these include binder, ashmem, logger, lowmemorykiller, etc.), and wake locks. The future prospective is to merge the Android kernel and the mainline Linux kernel, but the entire process is slow.

2.16 APPLICATION FRAMEWORK Android provides a high level of application framework API’s to specific areas such as multimedia, graphic user interface, networking, and power management and storage

24 access. Now when the application is in use, the libraries in the application framework, which are written, in Java run in front of the core libraries of the Android Runtime (see Figure 2.3). This application framework allocates work to different managers like the power manager, window manager and resource handler. Now the services of these managers are used by the application and not by the libraries. Then is up to the manager if the application is allowed to perform a certain activity or not [14].

25

CHAPTER 3

APPLICATION DESIGN

3.1 INTRODUCTION The application design is about developing an Android e-Book reader application using which the user can do the following things.  Change the font size.  Change the book page background.  Change the mode (Day/Night Mode) in which the page is being displayed.  Search for some content in the book using keywords.  Auto Scrolling of the book content.  Save a favorite book title as a bookmark.  Get the voice form of the book content.  Share the content of a book on a Facebook wall.  Set an alarm as a remainder to read a particular book in the future.

3.2 SOFTWARE DEVELOPMENT MODEL: (WATER FALL MODEL) The waterfall model is a popular version of the systems development life cycle model for software engineering. Often considered the classic approach to the systems development life cycle, the waterfall model describes a development method that is linear and sequential. Waterfall development has distinct goals for each phase of development. Imagine a waterfall on the cliff of a steep mountain. Once the water has flowed over the edge of the cliff, gravity is in control, and water cannot run uphill. It is the same with waterfall development. Once a phase of development is completed, the development proceeds to the next phase and there no or little interplay between phases [12, 24] (Figure 3.1[24]).

3.2.1 Requirements This is the first phase of the software development life cycle. Here we gather all the requirements that have to be fulfilled by the developed software Application [12].

26

Figure 3.1. Definitions of different phases of the water fall model. Source: CrackMBA. Waterfall Model, 2011. http://crackmba.com/ waterfall-model/, accessed Nov. 2012.

3.2.2 Design After gathering the requirements we will design this particular project. Here we will design the system according to the requirements we gathered in the first phase. We use UML to document aspects of the design of the system [12].

3.2.3 Construction Here the code is implemented. This is the phase where we implement the actual system according to the design. This phase is also called the coding phase [12].

3.2.4 Testing We will test, after coding part is finished. In this testing phase, we will test the coding part by using different testing methods. We will execute the code with a variety of tests and

27

use cases until there are no errors. Once integration is done, we have to again test the system for proper functionality [12].

3.2.5 Installation After testing the application we have to deploy or install the software or application in the real time environment to make use of it. In this deployment process the customer is involved. He is seeing all the coding, testing and executing part. If he wants any changes, again it will be modified [12].

3.2.6 Maintenance If we have any issues, when we are using the software/application, we will handle them in the maintenance phase. After deployment process, if they are not satisfied with that particular project, again it will be modified. So the project team is maintaining all these phases, in consultation with the customers [12].

3.3 FRONT END OR USER INTERFACE DESIGN User Interfaces (UI) in Android can be built in two ways, by defining XML-Code or by writing Java-Code. Defining the GUI structure in XML is highly preferable, because one knows from the Model-Viewer-Control principle that the UI (view) should always be separated from the back end and business logic. Additionally adapting a program from one screen-resolution to another is a lot easier. Defining a UI in XML is very similar to creating a common HTML document, where you have a simple file: Page Title The content of the body element. It is the same with Android’s XML-Layouts.

28

Everything is well structured and can be expressed by tree-structures:

3.4 ABOUT JAVA PROGRAMMING LANGUAGE Initially the language was called “Oak” but it was renamed “Java” in 1995. Java is a programming language originally developed by James Gosling at Sun Microsystems. Originally, the primary motivation of this language was the need for a platform-independent language that could be used to create software to be embedded in various consumer electronic devices [23].  Java is cohesive and consistent.  Except for those constraints imposed by the Internet environment, Java gives the programmer, full control.  Finally, Java is good for Internet programming or almost any kind of application, whereas C is good for system programming [23]. The following are some of the features of Java:

3.4.1 Platform Independent The concept of write-once-run-anywhere (known as platform independence) is one of the important key features of the java language. No language ignores this goal, but java is perhaps closest to it. The programs written on one platform can run on any platform, provided the platform must have the JVM [23].

29

3.4.2 Simple There are various features that make the java language a simple language. Programs are easy to write and debug because java does not use the pointers explicitly. It is much harder to write java programs that can crash the system, but we cannot say that so easily about other programming languages. Java provides a nearly bug free system due to the strong memory management. It also has the automatic memory allocation and deallocation systems [23].

3.4.3 Object Oriented Java was not designed to be source-code compatible with any other language. This allowed the Java team the freedom to design with a blank slate. One outcome of this was a clean usable, pragmatic approach to objects. The object model in Java is simple and easy to extend, while simple types, such as integers, are kept as high-performance non-objects [23].

3.4.4 Robust Java has a strong memory allocation and automatic garbage collection mechanism. It provides a powerful exception handling and type checking mechanisms as compared to other programming languages. The compiler checks the program for syntax errors and the interpreter checks any run time error and makes the system secure from a crash. All of the above features make the java language robust and reliable [23].

3.4.5 Distributed The widely used protocols like HTTP and FTP are developed in java. Internet programmers can call functions on these protocols and can get access to the files from any remote machine on the Internet rather than writing codes on their local system [23].

3.4.6 Portable The feature write-once-run-anywhere makes the java language portable provided that the system has an interpreter for the JVM. Java also has standard data size irrespective of operating system or the processor. These features help make the java a very portable language [23].

30

3.4.7 Dynamic While executing the java program the user can get the required files dynamically from a local drive or from a computer, thousands of miles away from the user just by connecting with the Internet [23].

3.4.8 Secure Java does not use memory pointers explicitly. All the programs in java are run under an area known as the sand box. Security manager determines the accessibility options of a class like reading and writing a file to the local disk. Java uses the public key encryption system to allow the java applications to transmit over the Internet in the secure encrypted form. The byte code Verifier checks the classes after loading [23].

3.4.9 Interpreted We all know that Java is an interpreted language as well. With an interpreted language such as Java, programs run directly from the source code. The interpreter program reads the source code and translates it on the fly into computations. Thus, Java as an interpreted language depends on an interpreter program. The versatility of being platform independent allows Java to outshine many other languages. The source code to be written and distributed is platform independent. Another advantage of Java as an interpreted language is its error debugging quality. Due to this any error occurring in the program gets traced. This is how it is different to work with Java [23].

3.4.10 Architecture Neutral The term architectural neutral seems obscure, but yes Java is an architectural neutral language as well, since that is another way of looking at portability. The growing popularity of networks makes developers think distributed. In the world of networks it is essential that the applications must be able to migrate easily to different computer systems, and not only to computer systems but to a wide variety of hardware architecture and operating system architectures as well. The Java compiler does this by generating byte code instructions, to be easily interpreted on any machine and to be easily translated into native machine code on the fly. The compiler generates an architecture-neutral object file format to enable a Java application to execute anywhere on the network and then the compiled code is executed on

31

many processors, given the presence of the Java runtime system. Hence Java’s design supports applications on networks [23].

3.4.11 Multithreaded Java is also a multithreaded programming language. Multithreading means a single program having different threads executing independently at the same time. Multiple threads execute instructions according to the program code in a process or a program [23]. Multithreading programming is a very interesting concept in Java. In multithreaded programs, not even a single thread disturbs the execution of other thread. Threads are obtained from the pool of available ready to run threads and they run on the system CPUs. This is how Multithreading works in Java, and many competing languages lack this important feature [23].

3.4.12 The Byte code The key that allows Java to solve the security and portability problems is that the output of a Java compiler is Byte code. Byte code is a highly optimized set of instructions designed to be executed by the Java run-time system, which is called the Java Virtual Machine (JVM). That is, in its standard form, the JVM is an interpreter for byte code [23]. Translating a Java program into byte code helps makes it much easier to run a program in a wide variety of environments. The reason is, once the run-time package exists for a given system, any Java program can run on it [23]. Even though Java was designed for interpretation, there is technically nothing about Java that prevents on-the-fly compilation of byte code into native code. Sun has just completed its Just In Time (JIT) compiler for Android byte code. When the JIT compiler is a part of JVM, it compiles byte code into executable code in real time, on a piece-by-piece, demand basis. It is not possible to compile an entire Java program into executable code all at once, because Java performs various run-time checks that can be done only at run time. The JIT compiles code, as it is needed, during execution [23].

3.4.13 Java Virtual Machine (JVM) Overall Description:

32

Java programming produces byte codes and executes them. The first box indicates that the Java source code is located in a. Java file that is processed with a Java compiler called javac. The Java compiler produces a file called a .class file, which contains the byte code. The .class file is then loaded across the network or loaded locally on your machine into the execution environment is the Java virtual machine, which interprets and executes the byte code [23] (Figure 3.2).

Figure 3.2. Development process of JAVA program.

3.5 UML DIAGRAMS These are the different UML diagrams:

3.5.1 Use Case Diagram A use case diagram is a graph of actors, a set of use cases enclosed by a system boundary, and includes communication (participation) associations between the actors and users and generalization among use cases. The use case model defines the outside (actors) and inside (use case) of the system’s behavior [25] (Figure 3.3).

3.5.2 Activity Diagram An activity diagram is normally a flowchart, showing flow of control from activity to activity. Unlike a traditional flowchart, an activity diagram shows concurrency as well as branches of control. For the most part, this involves modeling the sequential (and possibly concurrent) steps in a computational process [25] (Figure 3.4).

3.5.3 State Chart Diagram A state diagram is used to show control flow from one state to another within a single component. We use state diagrams to model the dynamic aspects of a system. In most of the cases, this involves modeling the behavior of objects that react to computational changes. A “reactive” object is thus one whose behavior is best characterized by its response to events

33

Figure 3.3. Usecase diagram.

dispatched from outside its context. A reactive object has a clear lifetime whose current behavior is affected by its past [25] (Figure 3.5).

3.5.4 Deployment Diagram The deployment diagram specifies a set of constructs that can be used to define the execution architecture of systems that represent the assignment of software artifacts to nodes.

34

Figure 3.4. Activity diagram.

35

Figure 3.5. Statechart diagram for bookshelf.

Nodes are connected through communication paths to create network systems of arbitrary complexity. Nodes are typically defined in a nested manner, and represent either hardware devices or software execution environments. Artifacts represent concrete elements in the physical world that are the result of a development process [25] (Figure 3.6).

3.6 DATA DICTIONARY A Data Dictionary is a collection of metadata, that is, data about data. In addition to storing catalog information about schemas and constraints, the data dictionary stores other information, such as design decisions, usage standards, application program descriptions, and user information. This term is common in databases, but can be applied to any collection of data.

3.6.1 User details Purpose: Table 3.1 stores full profile details of all the users.

36

Figure 3.6. Deployment diagram for bookshelf.

Table 3.1. Profile Details S.No Column Name Type Size Constraints 1 User_id Varchar 30 PRIMARY KEY 2 Name Varchar 30 NOT NULL 3 Pwd Varchar 30 NOT NULL 4 Address Varchar 30 NOT NULL 5 Phone Varchar 30 NOT NULL 6 Mailid Varchar 30 NOT NULL 7 Status Varchar 30 NOT NULL

37

3.6.2 Bookmark details Purpose: Table 3.2 stores book details and to click an title, have a specific page load.

Table 3.2. Book Details S.No Column Name Type Size Constraints 1 User_id Varchar 30 FOREIGN KEY 2 Title Varchar 30 NOT NULL

My Android application “CUSTOMIZATION FOR MOBILE EBOOK READERS” design will look like as follows:

3.7 APPLICATION DESIGN The Starting Page of my application customizable bookshelf (Figure 3.7).

Figure 3.7. Welcome page.

38

Here click the “Proceed to next step” image button, the app will load the login page as follows This is the Login Screen of my application. Here the user has two options. First one is if the user is already registered with the application he can directly log in into the system by giving proper login credentials (Figure 3.8).

Figure 3.8. Login page.

Second one is if the user is new to the application i.e. he is not registered himself with the application previously, now he has to register in order to work on or use the application. To register with the application, click on the “New User…? Register Here” option in the Login Screen. It will take the user to the registration page as follows (Figure 3.9).

39

Figure 3.9. Registration page.

3.7.1 Registration Page: Here in the registration page the user has to fill all the details with proper values and say submit, then it will give a successful registration message as in the following screen (Figure 3.10).

3.7.2 Registration Success Screen Here once the user clicks on the “Ok” button he will again be taken to the login screen for login and enter into the application. In the Login screen once the user enters the credentials and says “Submit”, if the credentials are wrong he will get the respective message as in the following screen (Figure 3.11).

40

Figure 3.10. Registration success page.

3.7.3 Wrong Credentials If the credentials are correct then the user will be taken to the home screen of the application as in the screen below (Figure 3.12).

3.7.4 Home Screen From this home screen only the user will carry out all his work related to eBooks like checking the list of available eBooks, reading the eBooks, checking list of bookmarks, setting alarm to read a particular book in the future, share content of a book on the User’s Facebook wall, etc. If the User selects the first option “Bookshelf” in the home screen, then the bookshelf screen will be displayed with a list of available books as follows (Figure 3.13).

41

Figure 3.11. Wrong credentials page.

3.7.5 Bookshelf Page After selecting a book from the list of books available (displayed), the first page of the book content will be displayed as in the following screen (Figure 3.14). First Page of a book with all the available options (Figure 3.14). From the above options, suppose a user selects “Change Mode” Option; the user will then see displayed the following screen (Figure 3.15).

3.7.6 Change Mode Options Page Now the mode of the book page will be displayed as in the following screen with different font and background properties (Figure 3.16). Mode changed (to night mode) (Figure 3.16).

42

Figure 3.12. Home page.

If the user selects the “Search Text Option”, then the user will be taken to the following screen with search option arrangements as follows (Figure 3.17).

3.7.7 Search Text Screen The text in red color is the word or phrase that is searched for. If the word or phrase for which search is done is not found then respective message will be displayed as shown in the screen below (Figure 3.18). Search (text not found) Page (Figure 3.18). If the user selects ‘other’, in the given options, the remaining options which are hidden will be displayed as in the following screen (Figure 3.19).

43

Figure 3.13. Bookshelf page

3.7.8 More Options Screen Here suppose the user selects “Add to Bookmarks” option; then the current book title will be added to bookmarks list of that particular user and respective acknowledgement will be given in the form of a message as follows (Figure 3.20). Title added to Bookmarks screen (Figure 3.20). From the Home Screen if the user selects bookmarks option, all the bookmarks of that particular user will be displayed as shown below (Figure 3.21). Bookmarks page (Figure 3.21). If the user selects the Set Alarm option in the Home Screen, the respective screen will be displayed as follows (Figure 3.22). Set alarm screen (Figure 3.22).

44

Figure 3.14. Page content.

If the user selects the Facebook option on the home screen, the following pages will be displayed (Figure 3.23).

3.7.9 Share on Facebook Wall Once the user enters the content to be shared on the Facebook wall, user has to click on “Post” and the Facebook Login screen will be displayed in which the user has to provide the credentials of a Facebook account in the following screen (Figure 3.24).

3.7.10 Log on to Facebook Once the user enters the correct credentials the given content will be posted on the respective Facebook wall.

45

Figure 3.15. Change mode page.

46

Figure 3.16. Book in night mode.

47

Figure 3.17. Search text word found page.

48

Figure 3.18. Text not found page.

49

Figure 3.19. More options page.

50

Figure 3.20. Title added to Bookmarks.

51

Figure 3.21. Bookmarks screen.

52

Figure 3.22. Set alarm screen.

53

Figure 3.23. Share on Facebook wall screen.

54

Figure 3.24. Facebook login screen.

55

CHAPTER 4

TESTING AND DEBUGGING

Testing is the process of detecting errors. Testing plays a vital and critical role for quality assurance and for ensuring the reliability of software. The results of testing are used later on during maintenance also [26].

4.1. TESTING OBJECTIVES The main objective of testing is to uncover a host of errors, systematically and with minimum effort and time. Stating it formally, we can say, [26].  Testing is a process of executing a program with the intent of finding an error.  A successful test is one that uncovers an as yet undiscovered error.  A good test case is one that has a high probability of finding error, if it exists.  The tests are inadequate to detect possibly present errors.  The software more or less confirms to the quality and reliable standards.

4.2. TESTING Software testing is a process of an exploration done to provide the end users with information about the eminence of the product or service under test. Software testing can also provide an objective, independent view of the software to allow the business to appreciate and understand the risks of software implementation. Testing strategies include the process of executing a program or application with the intent of finding software bugs (errors or other defects) [26]. Software testing can be stated as the process of validating and verifying that a software program/application/product:  Meets the requirements that guided its design and development.  Works as expected and  Can be implemented with the same characteristics. Software testing, depending on the testing method employed, can be implemented at any time in the development process. However, much of the test effort occurs after the

56

requirements have been defined and the coding process has been completed. Testing after code has been written is often called Quality Assurance, or QA

4.2.1 White-Box Testing White-box testing is when the tester has access to the internal data structures and algorithms including the code that implements these [26].

4.2.2 Black-Box Testing Black-box testing assumes the software as a "black box" i.e. it has no knowledge of internal implementation of the software to be tested. Black-box testing methods include: equivalence partitioning, boundary value analysis, all-pairs testing, fuzz testing, model-based testing, exploratory testing and specification-based testing [26]. Specification-based testing: Specification-based testing aims to test the functionality of software according to the applicable requirements. Thus, the tester inputs data into, and only sees the output from, the test object. This level of testing usually requires thorough test cases to be provided to the tester, who then can simply verify that for a given input, the output value (or behavior), either "is" or "is not" the same as the expected value specified in the test case [26]. Specification-based testing is necessary, but it is insufficient to guard against certain risks. Advantages and disadvantages: The black-box tester has no "bonds" with the code, and a tester's perception is very simple: a code must have bugs. Using the principle, "Ask and you shall receive," black-box testers find bugs where programmers do not. On the other hand, black box testing has been said to be "like a walk in a dark labyrinth without a flashlight," because the tester doesn't know how the software being tested was actually constructed. As a result, there are situations when a tester writes many test cases to check something that could have been tested by only one test case, and/or some parts of the back-end are not tested at all. While use cases can be programmer tested, independent QA testing is designed to try things only naïve users will inevitably do, and such things are often not anticipated by a programmer. Therefore, black box testing has the advantage of "an unaffiliated opinion", on the one hand, and the disadvantage of "blind exploring", on the other [26].

57

4.3 LOGIN TEST CASES These are the test cases used to develop an application (Table 4.1).

Table 4.1. Test Cases Test id Test Testing Description Expected Actual Pass/fail name methodology output output Ltc1 Functional Black box Username It Should It is Pass testing testing should not show the showing be empty error the error dialog dialog message. message Ltc2 Functional Black box Password It Should It is Pass testing testing should not show the showing be empty error the error dialog dialog message. message Ltc3 Functional Black box Incorrect Id It Should It is Pass testing testing and show the showing password in valid the in credentials valid message credentials message Ltc4 Functional Black box Correct Id It Should It is Pass testing testing and show the showing password User the User for User home Home page Page

4.4 TESTING APPLICATION FEATURES These are the application features, which are tested (Table 4.2). Along with the above test cases the following were also done as part of data validation.

4.5 USER REGISTRATION AUTHENTICATION The registration page for the developer can be authenticated more so that only those who are working on analyzing the issues are allowed to register rather than any other random user registration. As there are lots of important data that are viewed and modified and it would be a great loss once they are deleted.

58

Table 4.2. Application Features Test Test Testing Description Expected Actual Pass/Fail id Name methodology output output cmtc1 GUI Black box If the User List of List of books Pass testing wants to see books Displayed the list of should be books click displayed bookshelf option in the home page. cmtc2 GUI Black box If the User First page First Page of Pass testing Wants to of the the book open a book, books/The click on a books is not book in the ready list of books displayed cmtc3 GUI Black box If the User Give Audio Audio Pass testing wants to get version of version of the voice the book. the book is form of the played book, select Speech option (On) in Menu. cmtc4 GUI Black box If the User Books Content is Pass testing wants to the content being book to be should be scrolled autoscrolled, auto select scrolled autoscroll option (On) in Menu. cmtc5 GUI Black box If the User Content Content is Pass testing wants to share must be posted on some content posted on Facebook of any book Facebook Wall on his wall. Facebook wall, click on Facebook option in the home screen.

59

4.6 DATA FIELD VALIDATION All the data fields that are used in the complete process can be validated for more authentications.

60

CHAPTER 5

CONCLUSIONS AND OBSTACLES

This project document has discussed the development of an android mobile application titled “Customization for Mobile EBook Readers”. The objectives of this application were to develop a mobile application which can be used to read e-books with different advanced options like connecting to Facebook, voice form of book, autoscroll etc. All the objectives were met. By keeping track of the test results, this application was able to achieve all the proposed functionalities. Also, if the reader wants to read some book in the future at a particular point of time, using this app an alarm can be set to remind about that particular book. In implementing this application some advanced features like Text-To-Speech, Scroller, Facebook API, HTML text format, Notifications etc., are included in developing and fulfilling all the proposed functionalities. At the time of developing and testing, sometimes the voice rate is very high or very low when the user requested for voice form of the book. And another issue is connecting to Facebook feature has created some accessing issues which were later resolved by some research. These were the two major difficulties that were encountered as part of development, which troubled a bit, more than other issues like notifications, searching text etc. Finally it could be a great experience for e-book readers, while reading books using this app, as the app provides different advanced options at one place. My research includes the fundamentals of Android, its architecture, features of android with respect to different versions, different upgrade methods, debugging mechanism. It is also including some advanced features of android.

61

CHAPTER 6

FUTURE WORK

This Android Application titled “Customization for Mobile EBook Readers” is now compatible with only devices that run on Android operating systems. In the future it can be made available for the devices that run on other operating systems like iOS from Apple, Windows from Microsoft and Symbian from Nokia, etc. The User interface can also be upgraded with latest version of Android. Now using this application the reader can share the content using Facebook only. In the future it can also be connected to other Social networking applications like Twitter, LinkedIn, etc.

62

REFERENCES

[1] V. Koudounas and O. Iqbal. Mobile Computing: Past, Present and Future, n.d. http://www.doc.ic.ac.uk/~nd/surprise_96/journal/vol4/vk5/report.html, accessed June 2013. [2] B. Joan. Difference between GSM and 3G, 2011. http://www.differencebetween.net/ technology/difference-between-gsm-and-3g/, accessed June 2013. [3] J. Nyika. The Mobile Applications Ecosystem: A Primer, 2010. http://www.ppc.com /assets/pdf/white-papers/Mobile-Applications-Ecosystem.pdf, accessed June 2013. [4] Gartner, Inc. Gartner Identifies the Top 10 Consumer Mobile Applications for 2012, 2009. http://www.gartner.com/newsroom/id/1230413, accessed June 2013. [5] A. Anisimov, S. Andreev, A. Lokhanova, and A. Turlikov. Energy efficient operation of 3GPP LTE-advanced and IEEE 802.16m downlink channel. Proceedings of the 3rd International Congress on Ultra Modern Telecommunications and Control Systems and Workshops, Budapest, Hungary, 2011. [6] MobiThinking. Mobithink Mobile Statistics, 2010. http://mobithinking.com/mobile- marketing-tools/latest-mobile-stats, accessed Nov. 2012. [7] m-GovWorld. Mobile Application Market to Reach $9 billion by 2011, n.d. http://www.mgovworld.org/topstory/mobile-applications-market-toreach-9-billion-by- 2011, accessed Nov. 2012. [8] C. Foresman. Apple Responsible for 99.4% of Mobile App Sales in 2009 (Updated), 2010. http://arstechnica.com/apple/news/2010/01/apple-responsible-for- 994-of- mobile-app-sales-in-2009.ars, accessed Nov. 2012. [9] P. Finocchiaro. Apple to Lose in Market Share of Mobile App Downloads: Study, 2010. http://www.mobilecommercedaily.com/apple-to-lose-in-market-share-of-mobile- app-downloads-study/, accessed Nov. 2012 [10] Google Inc. Android Repository, 2010. http://android.git.kernel.org, accessed Nov. 2012. [11] Strategy Analytics. Understanding the Mobile Ecosystem, 2008. http://www.slideshare.net/Garry54/understanding-the-mobile-ecosystem, accessed June 2013. [12] Wikipedia. Waterfall Model, 2013. http://en.wikipedia.org/wiki/Waterfall_model, accessed Dec. 2012. [13] Open Handset Alliance. Industry Leaders Announce Open Platform for Mobile Devices, 2007. http://www.openhandsetalliance.com/press_110507.html, accessed Nov. 2012.

63

[14] Android.com. Android SDK, n.d. http://developer.android.com/sdk/index.html, accessed Nov. 2012. [15] Anddev.org. LifeCycle of an Activitiy, 2007. http://www.anddev.org/novice-tutorials- f8/lifecycle-of-an-activity-t81.html, accessed Nov. 2012. [16] Android.com. Android Developers, n.d. http://developer.android.com, accessed Nov. 2012. [17] Android.com. Android NDK, n.d. http://developer.android.com/tools/sdk/ ndk/index.html, accessed Nov. 2012. [18] Wikipedia. Android (operating system), 2013. http://en.wikipedia.org/wiki/ Android_(operating_system), accessed Nov. 2012. [19] Open Handset Alliance. Homepage, n.d. http://www.openhandsetalliance.com, accessed Nov. 2012. [20] D. Bornstein. Dalvik VM Internals, 2008. http://sites.google.com/site/io/dalvik-vm- internals, accessed Nov. 2012. [21] B. Cheng and B. Buzbee. A JIT Compiler for Android’s Dalvik VM, 2010. http://code.google.com/events/io/2010/sessions/jit-compiler-androids-dalvik-vm.html, accessed Nov. 2012. [22] S. Brahler. Analysis of the Android Architecture, 2010. http://os.ibds.kit.edu/ downloads/sa_2010_braehler-stefan_android-architecture.pdf, accessed June 2013. [23] Wikipedia. Java (programming language), 2013. http://en.wikipedia.org/wiki/ Java_(programming_language), accessed Nov. 2012. [24] CrackMBA. Waterfall Model, 2011. http://crackmba.com/waterfall-model/, accessed Nov. 2012. [25] Wikipedia. Unified Modeling Language, 2013. http://en.wikipedia.org/wiki/ Unified_Modeling_Language , accessed Nov. 2012. [26] Wikipedia. Software Testing, 2013. http://en.wikipedia.org/wiki/Software_testing, accessed Nov. 2012.