Professional Documents
Culture Documents
Chapter 1
INTRODUCTION
Mobile phones are one of the most ubiquitous electronic devices. Mobile Devices are multifunctional, portable, wireless connectivity, relatively limited resources and have longer power back up. In India there are about 300 million phones available. Each phone will have many features like calling, SMS, Bluetooth, internet, media players etc. Of all the modes of communication SMS happens to be the most widely used because of cost and ease of sending.SMS traffic in India is huge and considering an average user the SMS traffic will be at least 50 messages.
1.1 Overview
There are many types of Mobile Devices and we can classify them based on the market segment and device type. Mobile Devices based on Market Segments include devices for Business use, Personal and consumer use, Multi-purpose. Mobile Devices based on Device types include Smart phones, Table PC, Notebooks and single purpose devices such as mp3 players and navigation system.
Dr.SMCE/Dept of CSE/2011-12
Mobile Inbox Search Tool Android devices are phones, allowing your software to initiate calls, send and receive SMS messages, and everything else you expect from a modern bit of telephony technology. This tool allows searching for messages in which the user is interested and also allows the user to search depending upon some special criteria.
Functional Supported:
Search by Sender. Search by Number. Search by Date. Displaying all the unread messages.
Dr.SMCE/Dept of CSE/2011-12
Chapter 2
LITERATURE SURVEY
Various researchers all over the world are involved themselves in finding out various aspects related to android. A selected bunch of references are discussed hereunder.
Dr.SMCE/Dept of CSE/2011-12
Company / developer Programmed in Working state Source model Initial release Latest stable release
Open Handset Alliance C[1] Current Free and open source software 21 October 2008; Tablets: 3.1(Honeycomb)[2] Phones: 2.3.4 (Gingerbread) / 24 February 2011; 2 months ago[2]
Supported platforms Kernel type Default user interface License Official website
ARM, MIPS, Power Architecture, x86 Monolithic (modified Linux kernel) Graphical Apache 2.0 and GPLv2[3] android.com
Dr.SMCE/Dept of CSE/2011-12
At Google, the team led by Rubin developed a mobile device platform powered by the Linux kernel which they marketed to handset makers and carriers on the premise of providing a flexible, upgradeable system. It was reported that Google had already lined up a series of hardware component and software partners and signaled to carriers that it was open to various degrees of cooperation on their part. More speculation that Google would be entering the mobile-phone market came in December 2006. Reports from the BBC and The Wall Street Journal noted that Google wanted its search and applications on mobile phones and it was working hard to deliver that. Print and online media outlets soon reported rumors that Google was developing a Google-branded handset. More speculation followed reporting that as Google was defining technical specifications, it was showing prototypes to cell phone manufacturers and network operators. InformationWeek covered an Evalueserve study reporting that Google had filed several patent applications in the area of mobile telephony. Dr.SMCE/Dept of CSE/2011-12 5
Mobile Inbox Search Tool Open Handset Alliance The Open Handset Alliance, a consortium of several companies which include Texas Instruments, Broadcom Corporation, Google, HTC, Intel, LG, Marvell Technology Group, Motorola, Nvidia, Qualcomm, Samsung Electronics, Sprint Nextel and T-Mobile was unveiled with the goal to develop open standards for mobile devices. Along with the formation of the Open Handset Alliance, the OHA also unveiled their first product, Android, a mobile device platform built on the Linux kernel version 2.6. it was announced that 14 new members would be joining the Android project, including ARM Holdings, Atheros Communications, Asustek Computer Inc, Garmin Ltd, Softbank, Sony Ericsson, Toshiba Corp, and Vodafone Group Plc. Licensing With the exception of brief update periods, Android has been available as open source since 21 October 2008. Google opened the entire source code (including network and telephony stacks) under an Apache License.With the Apache License, vendors can add proprietary extensions without submitting those back to the open source community. Update history Android has seen a number of updates since its original release. These updates to the base Operating System typically fix bugs and add new features
Dr.SMCE/Dept of CSE/2011-12
2.3 Features
Current features and specifications
Handset layouts
The platform is adaptable to larger, VGA, 2D graphics library, 3D graphics library based on OpenGL ES 2.0 specifications, and traditional Smartphone layouts.
Storage Connectivity
The Database Software SQLite is used for data storage purposes Android supports connectivity technologies including GSM/EDGE, IDEN,CDMA, EV-DO, UMTS, Bluetooth, Wi-Fi, and WiMAX.
Messaging
SMS and MMS are available forms of messaging including threaded text messaging.
Web browser
The web browser available in Android is based on the open-source WebKit application framework. The browser scores a 93/100 on the Acid3 Test.
Java support
Software written in Java can be compiled to be executed in the Dalvik virtual machine, which is a specialized VM implementation designed for mobile device use, although not technically a standard Java Virtual Machine. Android does not support J2ME, like some other mobile operating systems.
Media support
Android supports the following audio/video/still media formats: H.263, H.264 (in 3GP or MP4 container), MPEG-4 SP, AMR, AMR-WB (in 3GP container), AAC, HE-AAC (in MP4 or 3GP container), MP3, MIDI, Ogg Vorbis, WAV, JPEG, PNG, GIF, BMP.
Additional hardware
Android can use video/still cameras, touch screens, GPS, accelerometers, magnetometers, accelerated 2D bit blits (with hardware orientation, 7
Dr.SMCE/Dept of CSE/2011-12
Mobile Inbox Search Tool support Development environment Market scaling, pixel format conversion) and accelerated 3D graphics. Includes a device emulator, tools for debugging, memory and performance profiling, and a plug-in for the Eclipse IDE. Like many phone-based application stores, the Android Market is a catalog of applications that can be downloaded and installed to target hardware over-the-air, without the use of a PC. Originally only free applications were supported. Paid-for applications have been available on the Android Market in the United States since 19 February 2009. The Android Market has been expanding rapidly. As of April 30, 2010, it had over 50,000 Android applications for download. Multi-touch Android has native support for multi-touch which was initially made available in handsets such as the HTC Hero. The feature was initially disabled at the kernel level (possibly to avoid infringing Apple's patents on touch-screen technology). Google has since released an update for the Nexus One and the Motorola Droid which enables multi-touch natively. Bluetooth Video calling Support for sending files over Bluetooth was added in version 2.0. Android does not support video calling. However, it is possible if the phone runs an additional UI. This is proved on the HTC Eva 4G, which runs Sense and can support video calling.
Mobile Inbox Search Tool tracking system. (Google announced an issue tracker on 18 January 2008.) In December 2007, Merge Lab mobile startup founder Adam MacBeth stated, "Functionality is not there, is poorly documented or just doesn't work... It's clearly not ready for prime time." Despite this, Android-targeted applications began to appear the week after the platform was announced. The first publicly available application was the Snake game. The Android Dev Phone is a SIM-unlocked and hardware-unlocked device that is designed for advanced developers.
While developers can use regular consumer devices purchased at retail to test and use their applications, some developers may choose not to use a retail device, preferring an unlocked or no-contract device. 2.5.1 Software development kit The Android SDK includes a comprehensive set of development tools. These include a debugger, libraries, a handset emulator (based on QEMU), documentation, sample code, and tutorials. Currently supported development platforms include x86-architecture computers running Linux (any modern desktop Linux distribution), Mac OS X 10.4.8 or later, Windows XP or Vista. Requirements also include Java Development Kit, Apache Ant, and Python 2.2 or later. The officially supported integrated development environment (IDE) is Eclipse (3.2 or later) using the Android Development Tools (ADT) Plug-in, though developers may use any text editor to edit Java and XML files then use command line tools to create, build and debug Dr.SMCE/Dept of CSE/2011-12 9
Mobile Inbox Search Tool Android applications as well as control attached Android devices (e.g., triggering a reboot, installing software package(s) remotely). A preview release of the Android software development kit (SDK) was released on 12 November 2007. On 15 July 2008, the Android Developer Challenge Team accidentally sent an email to all entrants in the Android Developer Challenge announcing that a new release of the SDK was available in a "private" download area. The email was intended for winners of the first round of the Android Developer Challenge. The revelation that Google was supplying new SDK releases to some developers and not others (and keeping this arrangement private) has led to widely reported frustration within the Android developer community. Android Applications are packaged in .apk format and stored under /data/app folder on the Android OS. The user can run the command adb root to access this folder as only the root has permissions to access this folder. 2.5.2 Android Developer Challenge The Android Developer Challenge was a competition for the most innovative application for Android. Google offered prizes totaling 10 million US dollars, distributed between ADC I and ADC II. ADC I accepted submissions from 2 January to 14 April 2008. The 50 most promising entries, announced on 12 May 2008, each received a $25,000 award to fund further development. It ended in early September with the announcement of ten teams that received $275,000 each, and ten teams that received $100,000 each. ADC II was announced on 27 May 2009. The first round of the ADC II closed on 6 October 2009. The first-round winners of ADC II comprising the top 200 applications were announced on 5 November 2009. 2.5.3 Google applications Google has also participated in the Android Market by offering several applications for its services. These applications include Google Voice for the Google Voice service, Sky Map for watching stars, Finance for their finance service, Maps Editor for their MyMaps service, Places Directory for their Local Search, Google Goggles that searches by image, Google Translate, Listen for podcasts and My Tracks, a jogging application.
Dr.SMCE/Dept of CSE/2011-12
10
Mobile Inbox Search Tool 2.5.4 Third party applications With the growing number of Android handsets, there has also been a growing interest by third party developers to port their applications to the Android operating system.Famous applications that have been converted to the Android operating system include Shazam, Backgrounds, and Weather Bug. The Android operating system has also been considered important enough by a lot of the most popular internet sites and services to create native android applications. These include MySpace and Face book. The release of Mozilla Firefox browser for Android is planned for late 2010. According to an interview with Mozilla's vice president of mobile, Jay Sullivan, conducted by TechRadar on February 17, 2010, part of the delay with the porting of Firefox over to Android has been because Firefox Mobile is built on C and C++ code, but that the new Native Development Kit makes it easier to port Firefox Mobile. 2.5.5 Native code Libraries written in C and other languages can be compiled to ARM native code and installed using the Android Native Development Kit. Native classes can be called from Java code running under the Dalvik VM using the System.loadLibrary call, which is part of the standard Android Java classes. Complete applications can be compiled and installed using traditional development tools. The ADB debugger gives a root shell under the Android Emulator which allows native ARM code to be uploaded and executed. ARM code can be compiled using GCC on a standard PC. Running native code is complicated by the fact that Android uses a non-standard C library (known as Bionic). The underlying graphics device is available as a framebuffer at /dev/graphics/fb0. The graphics library that Android uses to arbitrate and control access to this device is called the Skia Graphics Library (SGL), and it has been released under an open source license. Skia has backends for both win32 and Cairo, allowing the development of cross-platform applications, and it is the graphics engine underlying the Google Chrome web browser. 2.5.6 Community-based firmware There is a community of open-source enthusiasts that build and share Android-based firmware with a number of customizations and additional features, such as FLAC lossless Dr.SMCE/Dept of CSE/2011-12 11
Mobile Inbox Search Tool audio support and the ability to store downloaded applications on the microSD card. This usually involves rooting the device. Rooting lets users load modified firmwares allowing users of older phones to use applications available only on newer releases. Those firmware packages are updated frequently, incorporate elements of Android functionality that haven't yet been officially released within a carrier-sanctioned firmware, and tend to have fewer limitations. CyanogenMod is one such firmware. On 24 September 2009, Google issued a cease and desist letter to the modder Cyanogen, citing issues with the re-distribution of Google's closed-source applications within the custom firmware. Even though Android OS is open source, phones come packaged with closed-source Google applications for functionality such as the application store and GPS navigation. Google has asserted that these applications can only be provided through approved distribution channels by licensed distributors. Cyanogen has complied with Google's wishes and is continuing to distribute this mod without the proprietary software. He has provided a method to back up licensed Google applications during the mod's install process and restore them when it is complete.
2.6 Marketing
2.6.1 Logos Android uses the Droid font family made by Ascender Corporation. Fig 2.6 shows the logo. Android Green is the color of the Android Robot that represents the Android operating system.
The print color is PMS 376C and the online hex color is #A4C639, as specified by the Android Brand Guidelines. 2.6.2 Market share Dr.SMCE/Dept of CSE/2011-12 12
Mobile Inbox Search Tool Research company Canalys estimated in Q2 2009 that Android had a 2.8% share of worldwide smart phone shipments. By Q4 2010 this had grown to 33% of the market, becoming the top-selling smart phone platform. This estimate includes the Tapas and OMS variants of Android. In February 2010 ComScore said the Android platform had 9.0% of the U.S. smartphone market, as measured by current mobile subscribers. This figure was up from an earlier estimate of 5.2% in November 2009. By the end of Q3 2010 Android's U.S. market share had grown to 21.4 percent. In May 2010, Android's first quarter U.S. sales surpassed that of the rival iPhone platform. According to a report by the NPD group, Android achieved 25% smartphone sales in the US market, up 8% from the December quarter. In the second quarter, Apple's iOS was up by 11%, indicating that Android is taking market share mainly from RIM, and still has to compete with heavy consumer demand for new competitor offerings. Furthermore, analysts pointed to advantages that Android has as a multi-channel, multi-carrier OS, which allowed it to duplicate the quick success of Microsoft's Windows Mobile. In early October 2010, Google added 20 countries to its list of approved submitters. By mid-October, purchasing apps will be available in a total of 32 countries. For a complete list of countries that are allowed to sell apps and those able to buy them see Android Market. As of December 2010 Google said over 300,000 Android phones were being activated daily, up from 100,000 per day in May 2010.In February 2011, during the 2011 Mobile World Congress, Eric Schmidt announced that Android has reached 350,000 activations per day.At Google I/O, May 10, 2011, Google announced that 400,000 new Android devices are activated every day and more than 100 million have been activate.
Mobile Inbox Search Tool Google no longer maintains the Android code they previously contributed to the Linux kernel, effectively branching kernel code in their own tree, separating their code from Linux. The code which is no longer maintained was deleted in January 2010 from the Linux codebase. However, Google announced in April 2010, that they will hire two coders to work with kernel.org. 2.7.2 Issues concerning application development Android does not use established Java standards, i.e. Java SE and ME. This prevents compatibility among Java applications written for those platforms and those for the Android platform. Android only reuses the Java language syntax, but does not provide the full-class libraries and APIs bundled with Java SE or ME. However, Myriad's J2Android, launched on 19th March, 2010, allows seamless conversion of Java MIDlets into Android applications. Developers have reported that it is difficult to maintain applications working on different versions of Android, because of various compatibility issues between versions 1.5 and 1.6, specifically concerning the different resolution ratios of the various Android phones. Such problems were specifically encountered during the ADC2 contest. Garbage collection will slow down programs that make too many memory allocations allowing Dalvik to keep a pool of free memory. This may noticeably affect responsiveness. Android does not readily support Bluetooth file exchange, video call or native Java ME, as do other mobile operating systems, such as Symbian OS and Windows Mobile, however some of this is still possible: Bluetooth file exchange is possible on rooted devices. Apps like Qik allow live broadcasting (but not receiving) and
KnockingLiveVideo for the iPhone is set to make an Android appearance. Third-party XMPP clients such as BEEM could support the Jingle protocol soon. Java ME apps can be converted with a MIDP runner that converts them to android apk's to be installed like normal apps. 2.7.3 Issues for specific applications Unlike other mobile closed platforms like Apple's phone OS, Google tracks issues and feature requests at Google Code's site. The following outstanding issues have been highly debated or voted for by the user community: Dr.SMCE/Dept of CSE/2011-12 14
A source of criticism has been the lack of standards-based iCalendar/CalDAV functionality in the Android calendar client. Currently, the Android calendar is restricted to synchronization with Google Calendar service.
As of January 2010, the most requested ("starred") feature is the support for Bidirectional text (right-to-left) such as Arabic, Persian and Hebrew.
Bluetooth voice dialing is also not supported. This feature in particular has caused some surprise; many older phones have had this feature for several years.
Android does not support animated GIF files. It only shows the first frame. Android does not support encrypted sending (SMTP+TLS) and receiving (IMAP+SSL) of e-mail over self-signed certificates.
Because of potential security issues, Android does not officially allow applications to be installed on, nor run from, an SD card. Current Android products such as the HTC Dream and Magic have limited onboard memory and many users feel restricted by this lack of functionality. However, several unsupported modifications exist to give the user this capability.
Dr.SMCE/Dept of CSE/2011-12
15
Dr.SMCE/Dept of CSE/2011-12
16
Mobile Inbox Search Tool Search by Date This feature allows us to search and display messages which have arrived on a particular day or until a particular time. When Search by date is chosen, the user is allowed to enter a date and all the messages that have arrived on that day are displayed. Unread Messages This feature will display all the unread messages.
Values
Eclipse 3.2 or higher versions JDK 5 or JDK 6 Android Development Tools plug-in Android SDK for windows is 2.2 Windows operating system.
Dr.SMCE/Dept of CSE/2011-12
17
The Android SDK requires disk storage for all of the components that you choose to install. The table below provides a rough idea of the disk-space requirements to expect, based on the components that you plan to use.
Component type SDK Tools SDK Platform-tools Android platform (each) SDK Add-on (each) USB Driver for Windows Samples (per platform) Offline documentation
Dr.SMCE/Dept of CSE/2011-12
18
Chapter 4
SYSTEM ANALYSIS
After exploring existing mobile city guides and scenarios, I list the functionalities in different priorities. The priorities are given according to the importance of functions for a city guide. For example, the function of showing map is very important for a city guide. The priorities are divided into three different levels: High (H), Medium (M), and Low (L). H is considered the most important for a city guide and implemented firstly, M is less important and implemented after H, L is the least important and considered to implement after the high and medium. Normally, city guide should have basic functions: showing map and showing points of interest (POIs) on map, providing some information about sights or events (e.g. when the museum is open). In addition to them, we can add telephone function, the function of adding review, the function of making tour plan, the function of event reminder and so on. As well, I explore implementation of functionalities as many as possible based on the features of powerful Android platform since investigating realization of a tailorable City Guide application on the Android platform is the main purpose in the project.
8 Dr.SMCE/Dept of CSE/2011-12
M 19
Mobile Inbox Search Tool the points of interest users are interested in Information Retrieval ID 9 Requirement The city guide can retrieve information of points of interest The city guide can retrieve information of events, which will happen right now. The city guide can retrieve information about reviews of points of interest Users can select what kind of POIs to show on map (i.e. different classifications. e.g. hotels, museums, restaurants events, and so on). Priority H
10
11
12
Communication ID 13 Requirement Priority The city guide can M support communication between users in the same group through telephone or short message.
Review ID 14
Requirement Priority Users can add review M about points of interest. Requirement Priority The city guide can H support event reminder like lunch time Fig 4.1 Functional requirements
ID 15
Dr.SMCE/Dept of CSE/2011-12
20
Dr.SMCE/Dept of CSE/2011-12
21
Chapter 5
SYSTEM DESIGN
5.1 Development Methods
1. The development method that we are using for the development of our application is the Evolutionary Development Model also known as Iterative Development Model. 2. This approach interleaves the activities of specification, development and validation. An initial system is rapidly developed from the abstract specifications. This is then refined with customer input to produce the system that satisfies the customers needs. 3. We chose this method to develop our application because this is a utility based application .In this we have a initial set of requirements which is going to aid the user. 4. Once each of these utilities are developed it is going to be validated to see if it is fulfilling the customer requirements and in case it is not it is modified to work as intended.
Dr.SMCE/Dept of CSE/2011-12
22
Mobile Inbox Search Tool Future plans for extending or enhancing the software We are currently developing this as an independent application and hope to integrate it into the default message inbox provided by android. We are developing this on Android and in future hope to extend this to other platforms like Symbian (used by Nokia). User interface paradigms In Android user interfaces can be designed using one of the two methods Procedural and Declarative.Procedural involves writing code in java to create and manipulate user interface objects.Declarative design doesnt involve any code. This makes use of Markup language based on XML. In our project we make use of both of the methods as and when required. Hardware and/or software interface paradigms Eclipse with ADT Plug-in and android SDK provides us with the emulators and interfaces required for development. Management of resources Android uses Linux for its Memory management, networking, process management and other operating system services. External databases and/or data storage management and persistence Android framework provides SQLite libraries for data storage management. Communication mechanisms Intents are system messages, running around the inside of the device, notifying applications of various events, from hardware state changes (e.g., an SD card was inserted), to incoming data (e.g., an SMS message arrived), to application events (e.g., your activity was launched from the devices main menu).
Dr.SMCE/Dept of CSE/2011-12
23
Figure 5.1 Android System Architecture Android system architecture consists of four layers and their functionalities are as follows: 1. Linux Kernel Linux provides the hardware abstraction layer for Android, allowing Android to be ported to a wide variety of platforms in future. And it is also responsible for memory management,process management and other operating system services. 2. Native Libraries These libraries are all written in C or C++,compiled for particular hardware architecture used by phones, and preinstalled by the phone vendor. Some of the most important native libraries are surface manager, SQL database, browser engine etc. 3. Application Framework This layer provides the high-level building blocks we use to create our applications. Most important parts of framework are activity manager, content providers, resource manager, location manager etc. 4. Applications And Widgets Applications are programs that can take over the whole screen and interact with the user. On the other hand, Widgets also called gadgets only operate in a small rectangle of the Home screen application. Some of the standard system applications which come prepackaged with the android phone arePhone dialer,email,contacts,web browser,android market etc. Dr.SMCE/Dept of CSE/2011-12 24
User
Figure 5.2 Basic data flow Level 0, broadly explains the main entities involved. The user provides the type of the search and data to be searched .The search operation is performed and the results are displayed to the user. DFD Level 1 Level 1 DFD represents elaboration of the single process in Level 0 into sub processes. Level 1 DFD is as shown in the figure.The entities of the MIST tool are represented in above diagram. Search criteria & data
1.0.1
USER
Input Processing
Result
USER
1.0.2
Database
Dr.SMCE/Dept of CSE/2011-12
25
Mobile Inbox Search Tool DFD level 2 Level 2 DFD as shown in below figure. Level 2 elaborates Level 1 DFD in more detail.
1.0.1.1
Search By Sender
1.0.3.1 Cursor
1.0.1.2 USER Search By Number 1.0.3.2 1.0.2.2 SQLite Database 1.0.1.3 Search By Date 1.0.3.3 Array adapter 1.0.2.3 Cursor management
Accessing cursor data
Input processing unit allows the user to select the type of search to be performed. The user may select any of the four types namely Search By Number , Search By Sender, Search By date. The database unit is responsible for taking search data from the user and performing Dr.SMCE/Dept of CSE/2011-12 26
Mobile Inbox Search Tool the search .It comprises of 3 units namely Query Handler, SQLite database and Cursor Management. The query handler converts the search criteria into a SQLite query to perform the search.The query generated is run on the database to obtain the results and these results are managed by a Cursor Object.The cursor manager helps us to access the data within a cursor like moving to next row etc. The View Management is responsible taking the search results and displaying it to the user in the required format.The various components which help us do this are shown in the figure below. Finally the Cursor containing the search results is obtained and the data in it is accessed and the required data is put into an array adapter and this data is displayed into the ListView view.In this section, we have identified the individual modules that comprise the building blocks of our system and have presented a complete design for them. The details of the design process for each module contains of the following elements:
The purpose of the module: A description of its functionality using an algorithm. A description of the types and number of inputs it accepts. A description of the types and number of outputs it generates. A discussion of the relationship it shares with any other components. An overall view of the structure of the system is presented below it shows the interactions between each file, and at what level each file runs at.
5.5 Classification
In section 3.3.1, a Data flow diagram shows the various processes involved in identifying the type of request and responding to that particular type of request. In this section certain modules are described to carry out the implementation of those various processes. There are four main modules and each module have sub components. The main modules are: 1. Search by Sender module. 2. Search by Number module. 3. Search by Date module. Dr.SMCE/Dept of CSE/2011-12 27
Mobile Inbox Search Tool 4. Display Unread messages modules Flow Chart i/p Module
Display Sub-Module
Delete Module
Array Adapter
Dr.SMCE/Dept of CSE/2011-12
28
Mobile Inbox Search Tool The name of the sender must be present in the phone book i.e. messages from unknown numbers cannot be filtered. Composition The various modules of this subsystem are described below:
1. Input module
Classification This is a module of the subsystem Search by Sender. Definition It is responsible for taking input from the user. Responsibilities This module provides a edit text box with TextWatcherlistener attached to it which calls a callback whenever the input in the edit text box changes.
Constraints Valid input must be given. Uses/Interactions Android by default provides a virtual QWERTY key board which the user can use to enter the input.
2. Populate list
Classification This is a module of the subsystem Search by Sender. Definition It is responsible for processing the user input and displaying the results in ListView. Responsibilities Extracts the user input entered in the edit text box and generates a suitable query, queries the SMS database and displays the result. Composition This consists of four sub-modules which are as follows Dr.SMCE/Dept of CSE/2011-12 29
Mobile Inbox Search Tool 1. Input Query 2. Query SMS database 3. Display sub-module 4. Interface/Exports Interface/Exports This module is called by the TextWatcher callback. It is also called when we wish to populate or refresh the list.
3. Delete module
Classification This is a module present in the Search by Sender subsystem. Definitions This module handles the deletion of selected messages when invoked. Responsibilities This module is invoked when the delete button is selected through menu options. The module checks for the messages which have been checked by the user and deletes those messages by finding out their unique IDs. Also this module returns the number of messages deleted. Uses/Interactions This module is used by the Search by Sender subsystem whenever the user wants to delete a message or messages by a particular Sender. Resources This module uses Hash Table as a resource for retrieving the unique IDs of user selected messages for deletion.
4. Array Adapter
Classification This is a class used by the Search by Sender subsystem. Definition This class is responsible for providing a customized View for displaying the results. Dr.SMCE/Dept of CSE/2011-12 30
Mobile Inbox Search Tool Responsibilities It generates a customized View for displaying the results obtained by Search by Sender subsystem. Uses/Interactions It is a custom view used by populate list to display the results in a ListView. Resources Contacts cursor which contains all the contacts present in the phonebook which satisfy the user mentioned criteria. SMS cursor containing all the messages present in the database.
Constraints The input to the tool must be a phone number and not the name. Composition The various modules of this subsystem are described below:
1. Input module
Classification This is a module of the subsystem Search by Number. Definition It is responsible for taking input from the user. Responsibilities This module provides a edit text box with TextWatcherlistener attached to it which calls a callback whenever the input in the edit text box changes. Dr.SMCE/Dept of CSE/2011-12 31
Mobile Inbox Search Tool Constraints The input to the search tool must be number. Uses/Interactions Android by default provides a virtual QWERTY key board which the user can use to enter the input.
2. Populate list
Classification This is a module of the subsystem Search by Number. Definition It is responsible for processing the user input and displaying the results in ListView. Responsibilities Extracts the user input entered in the edit text box and generates a suitable query, queries the database and displays the result.
Composition This consists of four sub-modules which are as follows 1. Input Query 2. Query SMS database 3. Display sub-module 4. Interface/Exports
3. Delete Module
Classification This is a module present in the Search By Number subsystem. Definition This module handles the deletion of selected messages when invoked. Responsibilities This module is invoked when the delete button is selected through menu options. Themodulechecks for the messages which have been checked by the user and deletes
Dr.SMCE/Dept of CSE/2011-12
32
Mobile Inbox Search Tool those messages by finding out their unique IDs. Also this module returns the numberof messages deleted. Uses/Interactions This module is used by the Search by Number subsystem whenever the user wants to delete a message or messages by a particular Number. Resources This module uses HashTable as a resource for retrieving the unique IDs of user selected messages for deletion.
4. ArrayAdapter
Classification This is a class used by the Search by Number subsystem. Definition This class is responsible for providing a customized View for displaying the results. Responsibilities It generates a customized View for displaying the results obtained by Search by Sender subsystem. Constraints Accepts only Strings. Data other than String type data must be converted into String type. Uses/Interactions It is a custom view used by populate list to display the results in a ListView. Resources SMS cursor containing all the messages present in the database.
Mobile Inbox Search Tool This subsystem allows the user to search messages sent on a particular day or on a particular day and until particular time. i.e. the user can just input the date and perform searching or he can even input time along with the date and perform searching. Constraints This subsystem will not allow the user to perform searching based only on the Date Composition The various modules of this subsystem are described below:
1. Input module
Classification This is a module of the subsystem Search by Date. Definition It is responsible for taking input from the user. Responsibilities This module allows the user to set the date by providing the DatePicker dialog . The user can clear the already set date by using the Reset button provided by the input module. Uses/Interactions Android by default provides a DatePicker dialog to set the date which are the callbacks called when the user selects those dialogs to set the date
2. Populate list
Classification This is a module of the subsystem Search by Date. Definition It is responsible for processing the user input and displaying the results in ListView. Responsibilities Extracts the user input entered through DatePicker dialog. If the user sets only the date, the query is generated to extract the messages sent only on that particular date by default is taken as the interval between 00:00 to 23:59. If the user sets date. After extracting the input this module queries the database and displays the result.
Dr.SMCE/Dept of CSE/2011-12
34
Mobile Inbox Search Tool Composition This consists of four sub-modules which are as follows 1. Input Query 2. Query SMS database 3. Display sub-module 4. Interface/Exports
3. Delete Module
Classification This is a module present in the Search By Date subsystem. Definition This module handles the deletion of selected messages when invoked. Responsibilities This module is invoked when the delete button is selected through menu options. The module checks for the messages which have been checked by the user and deletes those messages by finding out their unique IDs. Also this module returns the number of messages deleted.
Uses/Interactions This module is used by the Search by Date subsystem whenever the user wants to delete a message or messages by different senders. Resources This module uses HashTable as a resource for retrieving the unique IDs of user selected messages for deletion.
4. ArrayAdapter
Classification This is a class used by the Search by Date subsystem. Definition This class is responsible for providing a customized View for displaying the results. Responsibilities Dr.SMCE/Dept of CSE/2011-12 35
Mobile Inbox Search Tool It generates a customized View for displaying the results obtained by Search by Date subsystem. Constraints Accepts only Strings. Data other than String type data must be converted into String type. Uses/Interactions It is a custom view used by populate list to display the results in a ListView. Resources Contacts cursor which contains all the contacts present in the phonebook which satisfy the user mentioned criteria. SMS cursor containing all the messages present in the database.
1. Populate list
Classification This is a module of the subsystem Display Unread messages. Definition It is responsible for displaying all the Unread messages in a customized ListView. Responsibilities This module displays allthe Unread messages with the sender name and a part of the message content in a customized ListView. Dr.SMCE/Dept of CSE/2011-12 36
Composition This consists of four sub-modules which are as follows 1. Input Query 2. Query SMS database 3. Display sub-module 4. Interface/Exports
2. Delete module
Classification This is a module present in the Display Unread messages subsystem. Definition This module handles the deletion of selected messages when invoked. Responsibilities This module is invoked when the delete button is selected through menu options. The module checks for the messages which have been checked by the user and deletes those messages by finding out their unique IDs. Also this module returns the number of messages deleted.
Uses/Interactions This module is used by the Display Unread messages subsystem whenever the user wants to delete a message or messages by different senders. Resources This module uses HashTable as a resource for retrieving the unique IDs of user selected messages for deletion.
3. ArrayAdapter
Classification This is a class used by the Display Unread messages subsystem. Definition This class is responsible for providing a customized View for displaying the results. Responsibilities Dr.SMCE/Dept of CSE/2011-12 37
Mobile Inbox Search Tool It generates a customized View for displaying the results obtained by Display Unread messages subsystem. Constraints Accepts only Strings. Data other than String type data must be converted into String type. Uses/Interactions It is a custom view used by populate list to display the results in a ListView. Resources Contacts cursor which contains all the contacts present in the phonebook which satisfy the user mentioned criteria. SMS cursor containing all the messages present in the database.
Dr.SMCE/Dept of CSE/2011-12
38
Dr.SMCE/Dept of CSE/2011-12
39
Dr.SMCE/Dept of CSE/2011-12
40
Dr.SMCE/Dept of CSE/2011-12
41
Dr.SMCE/Dept of CSE/2011-12
42
Chapter 6
IMPLEMENTATION
The project we have undertaken involves searching mechanism which is used to solve searching problems in Message Inbox. It involves search by sender, search by number, search by date and time, display unread messages.
Supported Packages
The following standard packages are supported in Android. Consult the Java 2 Platform Standard Edition 5.0 API documentation for information on how to use them: java.awt.font: A few constants for Unicode and fonts Dr.SMCE/Dept of CSE/2011-12 43
Mobile Inbox Search Tool java.beans: A few classes and interfaces for JavaBeans property changes java.io: File and stream I/O and etc.
Additional Packages
In addition to the standard libraries listed earlier, the Android SDKcomes with a number of third-party libraries for your convenience: org.apache.http: HTTP authentication, cookies, methods, andprotocol org.json: JavaScript Object Notation org.xml.sax: XML parsing org.xmlpull.v1: XML parsing
A component-based architecture inspired by Internet mashups: Parts of one application can be used in another in ways not originally envisioned by the developer. You can even replace built-in components with your own improved versions. This will unleash new round of creativity in the mobile space. Tons of built-in services out of the box: Location-based services useGPS or cell tower triangulation to let you customize the user experience depending on where you are. A full-powered SQL database lets you harness the power of local storage for occasionally connected computing and synchronization. Automatic management of the application life cycle: Programs are isolated from each other by multiple layers of security, which willprovide a level of system stability not seen before in smart phones.The end user will no longer have to worry about what applicationsare active or close some programs so that others can run. Androidis optimized for low-power, low-memory devices in a fundamentalway that no previous platform has attempted. High-quality graphics and sound: Smooth, antialiased 2D vectorgraphics and animation inspired by Flash are melded with 3Daccelerated OpenGL graphics to enable new kinds of games andbusiness applications. Codecs for the most common industrystandard audio and video formats are built right in, includingH.264 (AVC), MP3, and AAC. Portability across a wide range of current and future hardware: All your programs are written in Java and executed by Androids Dalvik virtual machine, so your code will be portable acrossARM, x86, and other architectures. Support for a variety of inputmethods is included such as keyboard, touch, and trackball.User interfaces can be customized for any screen resolution and orientation. Android offers a fresh take on the way mobile applications interact withusers, along with the technical underpinnings to make it possible.
Dr.SMCE/Dept of CSE/2011-12
45
Dr.SMCE/Dept of CSE/2011-12
46
Chapter 7
2. Integration testing
3. User Interface testing
Mobile Inbox Search Tool Algorithm performing filtering Algorithm performing deleting Algorithm for opening message Algorithm performing mapping between sender number and name. Purpose of Testing
Dr.SMCE/Dept of CSE/2011-12
48
All messages from the corresponding sender All the messages from senders whose names begin with the character sequence entered by user
passed
passed
SBS deleting
Deleting algorithm
The selected messages have to be deleted from the list as well as the database
The selected messages have been deleted from the list as well as the database The conversation containing the messages corresponding to the particular sender should be opened Numbers passed passed passed
SBS opening
Opening algorithm
The conversation containing the messages corresponding to the particular sender should be opened
SBS Mapping
Mapping algorithm
of Numbers
SBS
Mapping
A sender
All numbers
Only primary
Failed
Dr.SMCE/Dept of CSE/2011-12
49
TEST RESULT: It happened because of wrong URI and was replaced by proper URI
Expected output
Actual output
Result
corresponding number 2 SBN filtering 2 Filtering algorithm Partial number All messages from senders whose numbers begin with the number sequence entered by user The selected
corresponding number
SBN deleting
Deleting algorithm
All the Passed messages from senders whose number begin with the number sequence entered by user The selected passed messages messages have been have to be deleted from the list as well deleted from as the the list as well database as database the
SBN opening
Opening algorithm
passed
Dr.SMCE/Dept of CSE/2011-12
50
TEST RESULT : To solve this, a constraint that only one activity of the type can be launched in a tab was introduced. Launching an already launched activity will launch it as a separate activity occupying the whole screen and will function independently will all respects compared to the one placed under a tab.
Purpose of Testing The main purpose of this testing is to see how seamlessly the different activities are called and placed within tabs.
Dr.SMCE/Dept of CSE/2011-12
51
Mobile Inbox Search Tool The test cases listed below contain the details of our considerations while testing the working of the user interface of the system.
Sl No of test case 1 UI 1 User Interfaces Pressing Menu Button and Selecting Delete Option Change in the layout of the list View to allow user to check mark multiple messages Changes as mentione d above occurs properly in all modules 2 UI 2 User Interfaces of search by date Click on 1.Set the date button 2.Reset button 1.DatePicker been Changed Passe d Passe d Name of the text Item/features Being test Sample Input Expected Output Actual Output Resul t
shown allowing the as user to set the date . mention After the date is set, above the text of the
original
buttons
changes to the set date 2.Previously set date should be cleared and the text of the buttons gets set to Set the date
Dr.SMCE/Dept of CSE/2011-12
52
Chapter 8
Mobile Inbox Search Tool The application is developed specifically for android and in future can be developed for other platforms like symbian, iPhone , blackberry etc as well.
Dr.SMCE/Dept of CSE/2011-12
54
1.DisplayUnread.java
//This program is responsible for listing unread messages. package com.ist.activity; import java.util.List; import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.View; import android.view.View.OnLongClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ListView;
Dr.SMCE/Dept of CSE/2011-12
55
Mobile Inbox Search Tool * IST * com.ist.activity.UnreadMessageListActivity */ public class UnreadMessageListActivity extends Activity {
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); unreadMessages = MessageUtil.GetSMSList(getContentResolver(), getApplicationContext(), "read=0"); setContentView(R.layout.unreadmessagelist); ListView lv = (ListView) findViewById(R.id.msgList); lv.setAdapter(new MessageAdapter(getApplicationContext(), unreadMessages)); lv.setTextFilterEnabled(true); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Intent msgIntent = new Intent(Intent.ACTION_VIEW); msgIntent.setData(Uri.parse("content://mmssms/conversations/" + id)); startActivity(msgIntent); } });
lv.setOnLongClickListener(new OnLongClickListener() {
Dr.SMCE/Dept of CSE/2011-12
56
public boolean onLongClick(View arg0) { // TODO Create Context Menu to OPEN, MARK READ, DELETE return false; } }); } }
2. SearchByNumber.java
//This program is responsible for filtering out the messages based on sender number. package com.ist.activity; import java.util.HashMap; import java.util.List; import com.ist.pojo.Message; import com.ist.util.MessageAdapter; import com.ist.util.MessageUtil; import com.ist.util.literals.IApplicationLiterals; import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; import android.view.View; import android.view.View.OnLongClickListener; import android.widget.AdapterView; Dr.SMCE/Dept of CSE/2011-12 57
Mobile Inbox Search Tool import android.widget.ListView; import android.widget.TextView; import android.widget.AdapterView.OnItemClickListener;
/** * * @author Sumit Anvekar * IST * com.ist.activity.ByNumberListActivity */ public class ByNumberListActivity extends Activity implements IApplicationLiterals{
@SuppressWarnings("unchecked") @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent intent = getIntent(); goldMap = (HashMap<String, Message>) intent.getSerializableExtra("goldMap"); messages = MessageUtil.getMessageList(goldMap, FORMAT_TYPE_NUMBER, null); setContentView(R.layout.searchbynumber); updateList();
public void onTextChanged(CharSequence s, int start, int before, int count) { messages = MessageUtil.getMessageList(goldMap, FORMAT_TYPE_NUMBER, s.toString()); updateList(); }
public void beforeTextChanged(CharSequence s, int start, int count, int after) { //TODO: Do Nothing } }); }
private void updateList(){ ListView lv = (ListView) findViewById(R.id.msgList); lv.setAdapter(new MessageAdapter(getApplicationContext(), messages)); lv.setTextFilterEnabled(true); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Intent msgIntent = new Intent(Intent.ACTION_VIEW); Dr.SMCE/Dept of CSE/2011-12 59
lv.setOnLongClickListener(new OnLongClickListener() {
public boolean onLongClick(View arg0) { // TODO Create Context Menu to OPEN, MARK READ, DELETE return false; } }); } }
3.SearchBySender.java
//This program is responsible for filtering out the messages based on sender name. package com.ist.activity; import java.util.HashMap; import java.util.List; import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.text.Editable; Dr.SMCE/Dept of CSE/2011-12 60
Mobile Inbox Search Tool import android.text.TextWatcher; import android.view.View; import android.view.View.OnLongClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ListView; import android.widget.TextView;
/** * * @author Sumit Anvekar * IST * com.ist.activity.ByNameListActivity */ public class ByNameListActivity extends Activity implements IApplicationLiterals{
private HashMap<String, Message> goldMap; List<Message> messages; Long selectedId; AlertDialog alert;
Mobile Inbox Search Tool @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent intent = getIntent(); goldMap = (HashMap<String, Message>) intent.getSerializableExtra("goldMap"); messages = MessageUtil.getMessageList(goldMap, FORMAT_TYPE_NAME, null); setContentView(R.layout.searchbyname); updateList(); createDialog();
public void onTextChanged(CharSequence s, int start, int before, int count) { messages = MessageUtil.getMessageList(goldMap, FORMAT_TYPE_NAME, s.toString()); updateList(); }
Dr.SMCE/Dept of CSE/2011-12
62
private void createDialog() { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle("Select an Action:"); builder.setItems(items, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int item) { Long itemId = null; Long threadId = null;
switch (item) { case 0: Intent msgIntent = new Intent(Intent.ACTION_VIEW); msgIntent.setData(Uri.parse("content://mmssms/conversations/" + threadId)); startActivity(msgIntent); break;
case 1:
break; } } }); }
private void updateList(){ ListView lv = (ListView) findViewById(R.id.msgList); lv.setAdapter(new MessageAdapter(getApplicationContext(), messages)); lv.setTextFilterEnabled(true); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Intent msgIntent = new Intent(Intent.ACTION_VIEW); msgIntent.setData(Uri.parse("content://mmssms/conversations/" + id)); startActivity(msgIntent); } });
lv.setOnLongClickListener(new OnLongClickListener() {
public boolean onLongClick(View arg0) { // TODO Create Context Menu to OPEN, MARK READ, DELETE alert.show(); return false; Dr.SMCE/Dept of CSE/2011-12 64
4.SearchByDate.java
//This program is responsible for filtering out the messages based on Date and Time or Only Date. package com.ist.activity; import java.util.Calendar; import java.util.HashMap; import java.util.List; import com.ist.pojo.Message; import com.ist.util.MessageAdapter; import com.ist.util.MessageUtil; import com.ist.util.literals.IApplicationLiterals; import android.app.Activity; import android.app.DatePickerDialog; import android.app.Dialog; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.View; import android.view.View.OnLongClickListener; import android.widget.AdapterView; import android.widget.DatePicker; import android.widget.ListView; Dr.SMCE/Dept of CSE/2011-12 65
/** * * @author Sumit Anvekar * IST * com.ist.activity.ByDateListActivity */ public class ByDateListActivity extends Activity implements IApplicationLiterals{
private TextView fromDate; private TextView toDate; private int mYear; private int mMonth; private int mDay; private boolean isToDate; private HashMap<String, Message> goldMap; List<Message> messages;
@SuppressWarnings("unchecked") protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.searchbydate); fromDate = (TextView) findViewById(R.id.fromDate); toDate = (TextView) findViewById(R.id.toDate);
Dr.SMCE/Dept of CSE/2011-12
66
Mobile Inbox Search Tool // add a click listener to the button fromDate.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { isToDate = false; showDialog(DATE_DIALOG_ID); } }); toDate.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { isToDate = true; showDialog(DATE_DIALOG_ID); } });
// get the current date final Calendar c = Calendar.getInstance(); mYear = c.get(Calendar.YEAR); mMonth = c.get(Calendar.MONTH); mDay = c.get(Calendar.DAY_OF_MONTH);
Intent intent = getIntent(); goldMap = (HashMap<String, Message>) intent.getSerializableExtra("goldMap"); messages = MessageUtil.getMessageList(goldMap, FORMAT_TYPE_DATE, fromDate.getText() + "~" + toDate.getText()); updateList(); }
Dr.SMCE/Dept of CSE/2011-12
67
Mobile Inbox Search Tool private void updateList(){ ListView lv = (ListView) findViewById(R.id.msgList); lv.setAdapter(new MessageAdapter(getApplicationContext(), messages)); lv.setTextFilterEnabled(true); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Intent msgIntent = new Intent(Intent.ACTION_VIEW); msgIntent.setData(Uri.parse("content://mmssms/conversations/" + id)); startActivity(msgIntent); } });
lv.setOnLongClickListener(new OnLongClickListener() {
public boolean onLongClick(View arg0) { // TODO Create Context Menu to OPEN, MARK READ, DELETE return false; } }); registerForContextMenu(lv); }
// updates the date in the TextView private void updateDisplay() { String textDate = new StringBuilder() Dr.SMCE/Dept of CSE/2011-12 68
Mobile Inbox Search Tool // Month is 0 based so add 1 .append(mMonth + 1).append("-") .append(mDay).append("-") .append(mYear).append(" ").toString(); if(isToDate){ toDate.setText(textDate); }else{ fromDate.setText(textDate); } messages = MessageUtil.getMessageList(goldMap, FORMAT_TYPE_DATE, fromDate.getText() + "~" + toDate.getText()); updateList(); }
private DatePickerDialog.OnDateSetListener mDateSetListener = new DatePickerDialog.OnDateSetListener() { public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { mYear = year; mMonth = monthOfYear; mDay = dayOfMonth; updateDisplay(); } };
protected Dialog onCreateDialog(int id) { switch (id) { case DATE_DIALOG_ID: Dr.SMCE/Dept of CSE/2011-12 69
Mobile Inbox Search Tool return new DatePickerDialog(this, mDateSetListener, mYear, mMonth, mDay); } return null; } }
Dr.SMCE/Dept of CSE/2011-12
70
APPENDIX-B SCREENSHOTS
Dr.SMCE/Dept of CSE/2011-12
71
Dr.SMCE/Dept of CSE/2011-12
72
REFERENCES
[1] http://www.android.com - Android Official Webpage [2] http://code.google.com/android/ - Official Android Google Code Webpage [3] http://www.openhandsetalliance.com/ - Open Handset Alliance Webpage [4] http://www.androidwiki.com Android Wiki [5] http://googleblog.blogspot.com/ - Official Google Blog [6] http://en.wikipedia.org/wiki/Android_(mobile_phone_platform)Wikipedia Information [7] http://en.wikipedia.org/wiki/SQLite [8] http://en.wikipedia.org/wiki/WebKit [9] http://en.wikipedia.org/wiki/Eclipse_(software) [10] DiMarzio [11] Sams Teach Yourself ANDROID APPLICATION DEVELOPMENT of Pearson edition by Lauren Darcey and Shane conder A PROGRAMMERS GUIDE of Tata Mcgraw-Hill edition by Jerome (J.F)
Dr.SMCE/Dept of CSE/2011-12
73