quite sleep

83
1. INTRODUCTION QuiteSleep is an Android application that controls which people can interrupt your sleep, or any other activity defined by start and end times. In addition to muting calls, it can send an SMS and email with predefined text to advise callers that you are sleeping or busy. 1.1 Purpose of the project: Quiet Sleep monitors incoming calls. Quiet Sleep can also send an SMS to the silenced caller explaining why you have not picked up their call (SMS content can be customized). If the same caller calls several times in a defined amount of time the sound will automatically be turned up so you can answer the important call (the mentioned factors can be adjusted in the preferences). The home screen widget lets you turn the app on and off very quickly before and after you go to sleep. 1.2Existing System: QuiteSleep is an application that may or may not be used in the earlier systems, but now for the first time this application is implemented in the Android mobile. This Android operating system is an open source operating system developed especially for the mobile users. 1.3 Proposed System: 1

Upload: naveednad2003556

Post on 09-Nov-2015

219 views

Category:

Documents


0 download

DESCRIPTION

aishf HOIHfasc

TRANSCRIPT

1. INTRODUCTION

QuiteSleep is an Android application that controls which people can interrupt your sleep, or any other activity defined by start and end times. In addition to muting calls, it can send an SMS and email with predefined text to advise callers that you are sleeping or busy.

1.1 Purpose of the project:Quiet Sleep monitors incoming calls. Quiet Sleep can also send an SMS to the silenced caller explaining why you have not picked up their call (SMS content can be customized). If the same caller calls several times in a defined amount of time the sound will automatically be turned up so you can answer the important call (the mentioned factors can be adjusted in the preferences). The home screen widget lets you turn the app on and off very quickly before and after you go to sleep.1.2Existing System:QuiteSleep is an application that may or may not be used in the earlier systems, but now for the first time this application is implemented in the Android mobile. This Android operating system is an open source operating system developed especially for the mobile users. 1.3 Proposed System:Using our product do not disturb application in android device, we can keep specific numbers to not disturb and SMS or mail will be sent automatically to the particular member. In this there are four different ways to allow who can call you, this include 1.block all. 2. Block only blocked contacts. 3. Block unknown 4. Block unknown and blocked contacts. Two different ways to block an incoming call:1. Block by silent the incoming call.2. Block by hang up the incoming call.ACRONYMS API: Application program interface APK: Android package ADB: Android Delay Bridge DDMS: Dalvik Debug Monitor Service DEX:Dalvik Executable J2SE- Java 2 Standard Edition SDK- Software Development Kit XML: Extensible Markup Language

1.4 Feasibility Study:All projects are feasible if they have unlimited resources and infinite time. But the development of software is plagued by the scarcity of resources and difficult delivery rates. It is necessary and prudent to evaluate the feasibility of a project at the earliest possible time. The three considerations are involved in the feasibility analysis.

1.4.1 Economic feasibility:This procedure is to determine the benefits and savings that are expected form a candidate system and compare with cost. If benefits outweigh cost then the decision is made to design and implement the system. Otherwise further justification or alterations in proposed system that has to be made if it is having a change of being approved. This is an ongoing effort that improves in accuracy of each phase of the system lifecycle. For my project am not expecting any feasibility costs spent on this project because here am using open sources environments.

1.4.2 Technical feasibility:Technical feasibility centers on the existing mobile system (hardware, software etc) and to what extent it can support the proposed addition if the budget is a serious constraint, then the project is judged not feasible. The technical feasibilities are important role in my project because here am using android operating system.1.4.3 Operational feasibility:People are inherently resistant to change and mobiles have been known to facilitate change. In my project a technical people require to configure the software and technical background is necessary to work on the sensors.

1.5 Intended Developers:

2. SCOPE OF THE PROJECT

The scope of this project is to develop an Android based Do not disturb application to manage incoming calls. QuiteSleep is an application for Android devices which manages your incoming calls when you are busy, sleeping, or doing anything between two time slots in any day of the week. QuiteSleep can block a list of callers or even others different incoming calls and send an SMS or e-mail with a predefined text to notify you are busy, sleeping, etc. QuiteSleep will make your rest much better without worry of your phone disturb you. Using our product do not disturb application in android device, we can keep specific numbers to not disturb and SMS or mail will be sent automatically to the particular member. In this there are four different ways to allow who can call you, this include 1.block all. 2. Block only blocked contacts. 3. Block unknown 4. Block unknown and blocked contacts. Two different ways to block an incoming call:1. Block by silent the incoming call.2. Block by hang up the incoming call.Hence it becomes an easy access to the user to manage the incoming calls. This project is aimed to develop the Do not disturb application on an Android Mobile phone.

3. PRODUCT PERSPECTIVES

This research is on the latest open source mobile development platform called, Android and to implement a map based technologies for different requirements.

PRODUCT FEATURES: Android is openness. The promise is that developers can produce applications without any interference. The fact is that Android is an advanced, open source operating system which is important to the development community, but customers dont buy operating systems. The interface is flexible. The android platform provides a rich security model that allows developers to request the capabilities, or access, needed by their applications and to define new capabilities that other applications can request. Developers have full access to the same framework APIs used by the core applications.

4. ASSUMPTIONS AND DEPENDENCIES

Having only hardware is not sufficient, to access application software is must.\ Assumption is made in such a way that the mobile is charged with enough battery The battery should be in a working mode The one who using the mobile must have a minimum knowledge of URLs which he wants to know the updated feeds by using the parsing.

5. SYSTEM REQUIREMENTS SPECIFICATIONS

5.1 FUNCTIONAL REQUIREMENTS: Android APIs will be available on every Android phone, but there are a few APIS which have special concerns: the optional APIs. The application must have permission to the internet. These are optional in the sense that a given handset may not support them fully, or even at all. For instance, a given handset may not have connectivity to the web access. In this case the APIs for accessing these features will still be present, but hey may not work in the same way.

5.2 NON-FUNCTIONAL REQUIREMENTS:Safety Requirements: Never use an unapproved battery since this could damage the phone and for battery and could cause the battery to explored. Do not dispose your battery by fire or with hazardous or flammable materials. Make sure that no sharp edged items such as animals nails come into contact with battery. There is a risk of these causing a tire.

Security Requirements: Android is a multi-process system, where each application (and parts of the system) runs in its own process. Most security between applications and the system is enforced at the process level through standard Linux facilities, such as user and group IDs that are assigned to applications. Additional finer-grained security features are provided through a permission mechanism that enforces restrictions on the specific operations that a particular process can perform, and per-URI permissions for granting ad-hoc access to specific pieces of data. A central design point of the Android security architecture is that no application, by default, has permission to perform any operations that would adversely impact other applications, the operating system or the user. This includes reading or writing the users private data(such as contacts or e-mails), reading or writing another applications files , performing network access , keeping the device awake, etc.

5.3 SOFTWARE REQUIREMENTS: Software: JAVA 1.6, Mobile IDE plug-in (Eclipse IDE 3.4 with android plug-in) Operating System: Android, Windows XP Web services Development Tools: Android SDK rc-15, Eclipse 3.4 Connections: Web Service.

5.4 HARDWARE REQUIREMENTS: 40GB Hard disk space Android Phone (optional) Pentium IV with 2GHZ 1GB RAM

6 .PROJECT ANALYSIS

RSS is an acronym for Really Simple Syndication and Rich Site Summary. RSS is an XML-based format for content distribution. Webmasters create an RSS file containing headlines and descriptions of specific information. While the majority of RSS feeds currently contain news headlines or breaking information the long term uses of RSS are broad.

RSS was first invented by Netscape. They wanted to use an XML format to distribute news, stories and information. Netscape refined the version of rss and then dropped it. User land Software to control of the specification and continued to develop it releasing a newer version. A non-commercial group picked up RSS at the same time and based on their interpretation of the Netscape's original concept of RSS they too released a new version. User Land was not happy with the non-commercial version and continued development of their own version of RSS (Really Simple Syndication), eventually User Land released RSS v2.

All RSS feeds must conform to XML v1 standards so lets take a quick look at XML Basics. Extensible Mark-up Language or XML is a specification developed by the W3C. XML is a pared-down version of SGML or Standard Generalized Mark-Up Language, designed especially for Web documents. XML uses tags that describe the contents of the field. It is very similar to html but unlike html it allows designers to create their own customized tags, enabling the definition, transmission, validation, and interpretation of data between applications and between organizations.

RSS Feeds:RSS also known as rich site summary or real simply syndication, arrived on the scene a number of years ago, but was only recently embraced by webmasters as a means to effectively syndicate content. RSS Feeds provide webmasters and content providers an avenue to provide concise summaries to prospective readers. Thousands of commercial web sites and blogs now publish content summaries in an RSS feed. Each item in the feed typically contains a headline; article summary and link back to the online article.Benefit to the Webmaster: As the web has become more crowded webmasters have been striving to provide fresh and up to date content for their website visitors. Many webmasters have discovered they can easily utilize the information in RSS feeds to provide fresh web content. RSS feeds are composed in XML, which is a very simple markup language. Similar to HTML, XML uses tags to identify fields. Webmasters can easily parse the RSS feed and dynamically create web pages that contain headlines and summaries. The feeds will continuously update, supplying a steady stream of automatically generated fresh content. RSS allows webmasters to:1.) Provide fresh and relevant content on their website, which encourages users to return. 2.) Constantly changing content means that search engine spiders will visit more frequently. 3.) Automate content delivery. The benefits of RSS feeds are not limited to webmasters, surfers too benefit from the technology as well.

Benefit to Web Surfers: The beauty of RSS is that readers can quickly scan headlines (titles) and read articles of interest. Because the information is condensed and provided in a single location users can generally review more information in a shorter time frame. Additional information is only a click away. Best of all readers choose the feeds they wish to see, there is no spam with RSS. If you are not completely thrilled with the content appearing in a feed simply remove it from the newsreader. The technology is a pull technology rather than push technology, meaning the content is not forced on the consumers, who pull the content they want to see.

RSS allows for users to: Easily locate information. Read condensed information or 'soundbytes' with clearly marked and dated topic material. Classify and categorize information in an easy to navigate manner. Maximize their time without having to deal with spam.

RSS feeds can be viewed in a news aggregator or reader, which constantly updates and shows unread feeds. I found the functionality of the newsreaders to be similar to a simple email client. Consumers generally enter the URL of any RSS feeds that interest them. Topics with a common theme can be segregated into related groups. I highly recommend Feed Demon http://www.feeddemon.com by BradSoft as a newsreader. FeedDemon is extremely easy to use and allows for quick scanning and indexing of topics. FeedDemon allows users to quickly scan, sort and scroll through headline and article summaries, while viewing the actual content in a split screen web browser.

Finding Topic Specific Relevant Feeds:In order to find feeds that provide niche information users can search Feedster. Feedster http://www.feedster.com is a rapidly growing news search engine that indexes information contained within RSS feeds. Searches for topic specific feeds can be conducted and feeds can be retrieved for syndication.

Benefit to Content Developer:While the benefits to users and webmasters are clear the distribution opportunities made available to content developers should not be overlooked. Information contained in the RSS feed can be easily syndicated, increasing content distribution and reach. RSS allows for content developers to: Increase exposure in niche markets. Communicate with user bases and reach potential customers via an alternate communication method. Disseminate relevant information. Define themselves as an industry expert. Automate content delivery. RSS has effectively standardized the format for content delivery and has effectively defined the accepted standard for content distribution and syndication. RSS will likely rival email as a means of content distribution in another few years. The shear simplicity makes the technology very appealing.The distribution potential, while albeit difficult to measure, is still attractive to all parties making the likelihood that RSS popularity will only continue to grow.

RSS Feeds to Try:Feeds exist for almost any topic considers trying these feeds out by entering the url in your feed reader: Small Business Feed: small business tips and news http://www.small-business-software.net/blog-feed.xml

SMS, Wireless Messaging Related News: news related to telecom, wireless industry and Note Pages softwarehttp://www.notepage.net/blog-feed.xml Free Content Articles:collection of free content articles, updates when new article is released.http://www.small-business-software.net/article-feed.xml

Software Marketing News: cCreating RSS Feeds - step by step walk through of creating an RSS feed. RSS feed creators provide content without forcing it on consumers. Everyday more and more websites, news services and blogs are adding RSS content. RSS is a method of syndicating content. The concept of aggregating content in one central location or repository is very appealing. Consumers have become tired of push technology; RSS allows users the flexibility to regain control of their content. RSS feed creators provide content without forcing it on consumers. In fact with RSS consumers are able to choose the content they wish to view.

6.1 MODULES XML-PARSING USING SAX PARSERDefines the API that wraps an XMLReader implementation class. In JAXP 1.0, this class wrapped the Parser interface, however this interface was replaced by the XMLReader. For ease of transition, this class continues to support the same name and interface as well as supporting new methods. An instance of this class can be obtained from the newSAXParser() method. Once an instance of this class is obtained, XML can be parsed from a variety of input sources. These input sources are Input Streams, Files, URLs, and SAX InputSources. This static method creates a new factory instance based on a system property setting or uses the platform default if no property has been defined. The system property that controls which Factory implementation to create is named "javax.xml.parsers.SAXParserFactory". This property names a class that is a concrete subclass of this abstract class. If no property is defined, a platform default will be used.As the content is parsed by the underlying parser, methods of the given HandlerBase or the DefaultHandler are called. Implementations of this class which wrap an underlying implementation can consider using the ParserAdapter class to initially adapt their SAX1 implementation to work under this revised class.

7. PROJECT DESIGN

What is UML?The unified modeling language (UML) is a standard language for specifying, visualizing, constructing, and documenting the artifacts of software systems, as well as for business modeling and other non0software systems. The UML represents a collection of best engineering practices that have proven successful in the modeling of large and complex systems. The UML is a very important part of developing objects oriented software and the software development process. The UML uses mostly graphical notations to express the designing of software projects. Explore potential designs, and validate the architectural design of the software.

Goals of UML:The primary goals in the design of the UML were: Provide users with a ready-to-use, expressive visual modeling language so they can develop and exchange meaningful models. Provide extensibility and specialization mechanisms to extend the core concepts. Be independent of particular programming languages and development processes. Provide a formal basis for understanding the modeling language. Encourage the growth of the OO tools market. Support higher-level development concepts such as collaborations, frameworks, pattern and components. Integrate best practices.

Why Use UML?As the strategic value of software increases for many companies, the industry looks for techniques to automate he production of software and to improve quality and reduce cost and time-to market. These techniques include component technology, visual programming patterns and frameworks. Businesses also seek techniques to manage the complexity of systems as they increase in scope and scale. In particular, they recognize the need to solve recurring architectural problems, such as physical distribution, concurrency, replication, security, load balancing and fault tolerance. The unified modeling language (UML) was designed to respond to these needs.

UML Diagram:UML diagram is designed to let developers and customers view a software system from a different perspective and in varying degrees of abstraction. UML diagrams commonly created in visual modeling tools include.

1. Use Case Diagram:In its simplest form, a use case can be described as specific way of using the system from a users (actors) perspective. A more detailed description might characterize a use case as: A pattern of behavior the system exhibits A sequence of related transactions performed by the actor and the system Delivering something of value to the actor

Use cases provide a means to: Capture system requirements Communicate with the end users and domain experts Test the system Use cases are best discovered by examining the actors and defining what the actor will be able to do with the system. Since all the needs of a system typically cannot be covered in one use case, it is usual to have a collection of use cases. Together this use case collection specifies all the ways of using the system.

Graphical Depiction:The basic shape of a use case in ellipse.

Naming:A use case may have a name, although it is typically not a simple name, it is often written as an informal text description of the actors and the sequences of events between objects. Use case names often start with verb. For example, names of possible use cases for an ATM machine might include Dispense Cash or Transfer Funds.

Relation Ships: You can draw an association relationship from a use case to an actor. You can draw a generalize relationship between tow use cases.

2. Class Diagram:A class diagram is a picture for describing generic descriptions of possible systems. Class diagrams and collaboration diagrams are alternate representations of object models. Class diagrams contain classes and object diagrams contain objects, but it is possible to mix classes and objects when dealing with various kinds of metadata so the separations are not rigid. Class diagrams are more prevalent than object diagrams. Normally you will build class diagrams plus occasional object diagrams illustrating complicated data structures or messages-passing structures. Class diagrams contain icons representing classes, interfaces, and their relationships. You can also create one or more class diagrams to depict classes contained by each package in your model; such class diagrams are themselves contained by the package enclosing the classes they depict; the icons representing logical packages and classes in class diagrams. You can change properties or relationships by editing the specification r modifying the icon on the diagram. The associated diagrams or specifications are automatically updated. During analysis class diagram show common roles and responsibilities of the entities that provide the systems behavior.

3. Sequence Diagram:A sequence diagram is a graphical view of a scenario that shows object interaction in a time-based sequence what happens first, what happens next. Sequence diagrams establish the roles of tobjects and help provide essential information to determine class responsibilities and interfaces. Sequence diagrams are normally associated with use case. Sequence diagrams are closely related to collaboration diagrams and both are alternate representations of and interaction. There are two main differences between sequence and collaboration diagrams: sequence diagrams show time0bsed object interaction while collaboration diagrams show how objects associate with each other. A sequence diagram has two dimensions: typically, vertical placement represents time and horizontal placement represents different objects. The following tools located on the sequence diagram toolbox enable you to model sequence diagrams:

Object Message icons Focus of control Message to self Note Note anchor

4. Activity Diagram:Activity diagrams provide a way to model the workflow of a business process. You can also use activity diagrams to model code-specific information such as a class operation. Activity diagrams are very similar to a flow chart because you can model a workflow from activity to activity. An activity diagram is basically a special case of a state machine in which most of the states are activities and most of the transitions are implicitly triggered by completion of the actions in the source activities. The main difference between activity diagrams and state charts is activity diagrams are activity centric, while state charts are state centric. And activity diagram is typically used for modeling the sequence of activities in a process, whereas a state chart is better suited to model the discrete stages of an objects lifetime.

Using activity diagrams:Activity diagrams can model many different types of workflows. And accounting firm could use activity diagrams to model any number of financial transactions. A software company could use activity diagrams to model software development process.

Understanding workflows:Each activity represents the performance of a group of actions in a workflow. Once the activity is complete, the flow of control moves to the next activity or state through a transition, if an outgoing transition is not clearly triggered by an event, then it is triggered by the completion of the contained actions inside the activity. a unique activity diagram feature is a swim lane that defines who or what is responsible for carrying out the activity or state. The workflow stops when a transition reaches an end state.

Activity diagram tools:You can use the following tools on the activity diagram toolbox to model activity diagrams Activities Decisions End state Object Object flow Start state states Swim lanes Synchronizations Transitions

8. CODE IMPLEMENTATION

Android:The Android platform is a software stack for mobile devices including an operating system, middleware and key applications. Developers can create applications for the platform using the Android SDK. Applications are written using the Java programming language and run on Dalvik, a custom virtual machine designed for embedded use, which runs on top of a Linux kernel.

Android Architecture:The following diagram shows the major components of the Android operating system. Each section is described in more detail below.

Applications:Android will ship with a set of core applications including an email client, SMS program calendar, maps, browser, contact, and other. All applications are written using the Java programming language.

Application Framework:Developers have full access to the same framework APIs used by the core applications. The application architecture is designed to simplify the reuse of components. An=y application can publish its capabilities and any other application may then make use of those capabilities (subject to security constraints enforced by the framework). This same mechanism allows components to be replaced by the user.

Libraries:Android includes a set of C/C++ libraries used by various components of the Android system. These capabilities are exposed to developers through the Android application framework. Some of the core libraries are listed below: System C library a BSD derived implementation of the standard C system library (libc), tuned for embedded Linux-based devices. Media Libraries based on Packet Videos Open CORE; the libraries support playback and recording of many popular audio and video formats, as well as static image files, including MPEG4, H.264, MP3, AAC, AMR, JPG and PNG. Surface Manager manages access to the display subsystem and seamlessly composites 2D and 3D graphic layers from multiple applications. LibWebCore a modern web browser engine which powers both the Android browser and an embeddable web view. SGL the underlying 2D graphics engine. 3D libraries an implementation based on OpenGL ES 1.0 APIs; the libraries use either hardware 3D acceleration (where available) or the included, highly optimized 3D software rasterizer. FreeType bitmap and vector font rendering. SQLite a powerful and lightweight relational database engine available to all applications.

Android Runtime:Android includes a set of core libraries that provides most of the functionality available in the core libraries of the Java programming language. Every Android application 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 VMs efficiently. The Dalvik VM executes files in the Dalvik Executable (.dex) format which is optimized for minimal memory footprint. The VM is register-based. And runs classes compiled by a Java language compiler that have been transformed into the .dex format by the included dx tool. The Dalvik VM relies on the Linux kernel for underlying functionality such as threading and low-level memory management.

Linux Kernel:Android relies on Linux version 2.6 for core system services such as security, memory management, process management, network stack, and driver model. The kernel also acts as an abstraction layer between the hardware and the rest of the software stack.

Eclipes3.4:An open-source Java IDE and platform for rich client applications Eclipse is an open source platform independent software framework for delivering what the project calls or is known as rich-client applications (as opposed to thin clients , this means the clients perform heavy-duty work on the host. So far this frame work has typically been used to develop IDEs (Integrated Development Environments), such as the highly-regarded Java IDE called Java Development Toolkit (JDT) compiler that come as part of Eclipse ( and which are also used to develop Eclipse itself). However, it can be used for other types of client application as well, see the popular Bit Torrent client for example.

Java:Overview of JavaComputers connected to the net are from many different manufacturers, running on different operating systems and they differ in architecture, computing power and capacity. By considering this point SUN Microsystems Corporation felt the need for a new= programming language suitable for this heterogeneous Environment and java was the solution. This breaks barriers between different computers, chips and operating systems.

The main properties of the Java, which made Java so popular, are as follows:

Simple Secure Portable Object-Oriented Robust Multithreaded Interpreted High performance

Android SDK:Android 2.0 is a major platform release deployable to android-powered handsets starting in November 2009. The release includes new features for users and developers, as well as changes in the Android framework API.For developers; the Android 2.0 platform is available as a downloadable component for the Android SDK. The downloadable platform includes a fully compliant Android library and system image, as well as a asset of emulator skins, sample applications, and more. The downloadable platform is fully compliant and includes no external libraries. To get started developing or testing against the Android 2.0 platform, use the Android SDK and AVD Manager tool to download the platform into your Android 1.6 or later SDK.

Installing the ADT Plug-in:ADT is a plug-in for the Eclipse IDE. Before installing or using ADT, a compatible version of Eclipse must be installed on the development computer. Additionally, before configuring or using ADT, the Android SDK starter package must be installed. Specifically a compatible version of the Android SDK tools and at least one development platform are needed. Emulator:The Android SDK includes a mobile device emulator-- a virtual mobile device that runs on your computer. The emulator lets you prototype, develop, and test Android applications without using a physical device. The Android emulator mimics all of the typical hardware and software features of a typical mobile device, except that it can not receive or place actual phone calls. It provides a variety of navigation and control keys, which you can press using your mouse or keyboard to generate events for your application. It also provides a screen in which your application is displayed, together with any other Android applications running. To let you model and test your application more easily, the emulator supports Android Virtual Device (AVD) configurations. AVDs let you specify the Android platform that you want to run on the emulator as well as the hardware options and emulator skin files that you want to use. Once your application is running on the emulator, it can use the services of the Android platform to invoke other applications, access the network, play audio and video, store and retrieve data notify the user, and render graphical transitions and themes. The emulator also includes a variety of debug capabilities, such as, console from which you can kernel output, simulate application interrupts (such as arriving SMS messages or phone calls), and simulate latency effects and dropouts on the data channel.

RssMainActivity.javapackage com.mad;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.Menu;import android.view.MenuItem;import android.view.SubMenu;public class RssMainActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.rss_main); } @Override public boolean onCreateOptionsMenu(Menu menu) {SubMenu English = menu.addSubMenu("English");SubMenu Dutch= menu.addSubMenu("Dutch");SubMenu Spanish= menu.addSubMenu("Spanish");SubMenu French= menu.addSubMenu("French");English.add(1,1,1,"Add");English.add(1,2,2,"View");English.add(1,3,3,"Remove");Dutch.add(2,1,1,"Add");Dutch.add(2,2,2,"View");Dutch.add(2,3,3,"Remove");Spanish.add(3,1,1,"Add");Spanish.add(3,2,2,"View");Spanish.add(3,3,3,"Remove");French.add(4,1,1,"Add");French.add(4,2,2,"View");French.add(4,3,3,"Remove");return true; } @Overridepublic boolean onPrepareOptionsMenu(Menu menu) { return true; } @Override public boolean onOptionsItemSelected(MenuItem item) {switch(item.getGroupId()) {case 1:if(item.getItemId()==2){finish();}if(item.getItemId()==1){Intent i=new Intent(this, MainActivity.class);startActivity(i);} break;case 2: finish(); break;case 3:finish(); break;case 4:finish(); break; }return false;}}

RSSReader.javapackage com.mad;import java.net.URL;import javax.xml.parsers.SAXParser;import javax.xml.parsers.SAXParserFactory;import org.xml.sax.InputSource;import org.xml.sax.XMLReader;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.util.Log;import android.view.View;import android.widget.AdapterView;import android.widget.AdapterView.OnItemClickListener;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.TextView;

public class RSSReader extends Activity implements OnItemClickListener {

public final String tag = "RSSReader";private RSSFeed feed = null;

/** Called when the activity is first created. */

@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);String RSSFEEDOFCHOICE;Bundle bun = this.getIntent().getExtras();RSSFEEDOFCHOICE = bun.getString("url");feed = getFeed(RSSFEEDOFCHOICE);

// display UI

UpdateDisplay();

}

private RSSFeed getFeed(String urlToRssFeed) {try {

// setup the urlURL url = new URL(urlToRssFeed);

// create the factorySAXParserFactory factory = SAXParserFactory.newInstance();// create a parserSAXParser parser = factory.newSAXParser();

// create the reader (scanner)XMLReader xmlreader = parser.getXMLReader();// instantiate our handlerRSSHandler theRssHandler = new RSSHandler();// assign our handlerxmlreader.setContentHandler(theRssHandler);// get our data via the url classInputSource is = new InputSource(url.openStream());// perform the synchronous parsexmlreader.parse(is);// get the results - should be a fully populated RSSFeed instance,// or null on errorreturn theRssHandler.getFeed();} catch (Exception ee) {// if we have a problem, simply return nullreturn null;}}

/* * public boolean onCreateOptionsMenu(Menu menu) { * super.onCreateOptionsMenu(menu); * * menu.add(0,0,0, "Choose RSS Feed"); menu.add(0,1,0, "Refresh"); * Log.i(tag,"onCreateOptionsMenu"); return true; } * * public boolean onOptionsItemSelected(MenuItem item){ switch * (item.getItemId()) { case 0: * * Log.i(tag,"Set RSS Feed"); return true; case 1: * Log.i(tag,"Refreshing RSS Feed"); return true; } return false; } */

private void UpdateDisplay() {TextView feedtitle = (TextView) findViewById(R.id.feedtitle);TextView feedpubdate = (TextView) findViewById(R.id.feedpubdate);ListView itemlist = (ListView) findViewById(R.id.itemlist);

if (feed == null) {feedtitle.setText("No RSS Feed Available");return;}

feedtitle.setText(feed.getTitle());feedpubdate.setText(feed.getPubDate());

ArrayAdapter adapter = new ArrayAdapter(this,android.R.layout.simple_list_item_1, feed.getAllItems());

itemlist.setAdapter(adapter);

itemlist.setOnItemClickListener(this);

itemlist.setSelection(0);

}

@Overridepublic void onItemClick(AdapterView parent, View v, int position, long id) {Log.i(tag, "item clicked! [" + feed.getItem(position).getTitle() + "]");

Intent itemintent = new Intent(this, ShowDescription.class);

Bundle b = new Bundle();b.putString("title", feed.getItem(position).getTitle());b.putString("description", feed.getItem(position).getDescription());b.putString("link", feed.getItem(position).getLink());b.putString("pubdate", feed.getItem(position).getPubdate());

itemintent.putExtra("android.intent.extra.INTENT", b);

startActivity(itemintent);}

}

DataBaseAdaptor.javapackage com.mad;import android.content.ContentValues;import android.content.Context;import android.database.Cursor;import android.database.SQLException;import android.database.sqlite.SQLiteDatabase;

public class D_A {public static final String DB_NAME = "rssreader2.db";public static final String FEEDS_TABLE = "feeds";public static final String ITEMS_TABLE = "items";public static final int DB_VERSION = 1;public static final String KEY_ROWID = "feedid";public static final String TITLE = "title";public static final String PUB_DATE = "pubDate";public static final String LINK = "link";public static final String DESCRIPTION = "description";

private D_H dbHelper = null;private SQLiteDatabase db = null;Context context;

public D_A(Context context) {

this.context = context;}

public void open() throws SQLException {dbHelper = new D_H(context);db = dbHelper.getWritableDatabase();}

public void close() {dbHelper.close();}

public long insertFEEDS(RSSFeed feed) {ContentValues values = new ContentValues();

values.put("title", feed.getTitle());values.put("pubDate", feed.getPubDate());

return db.insert("feeds", null, values);}

public long insertRSSItem(RSSItem item) {ContentValues values = new ContentValues();

values.put("title", item.getTitle());values.put("link", item.getLink());values.put("description", item.getDescription());values.put("pubDate", item.getPubdate());

return db.insert("items", null, values);}

public boolean UpdateRSSFeeds(long rowId, String title, String pubDate) {ContentValues updateValues = createContentValues(title, pubDate);

return db.update("RSSFeeds", updateValues, KEY_ROWID + "=" + rowId,null) > 0;}

public boolean UpdateRSSItems(long rowId, String title, String description,String link, String pubDate) {ContentValues updateValues = createContentValues2(title, description,link, pubDate);

return db.update("RSSFeeds", updateValues, KEY_ROWID + "=" + rowId,null) > 0;}

private ContentValues createContentValues2(String title,String description, String link, String pubDate) {ContentValues values = new ContentValues();values.put(TITLE, "title");values.put(DESCRIPTION, "description");values.put(LINK, "link");values.put(PUB_DATE, "pubDate");

return values;}

public boolean DeleteFeeds(long rowId) {return db.delete("RSSFeeds", KEY_ROWID + "=" + rowId, null) > 0;}

public Cursor getFEEDS(String link) {return db.query("feeds", new String[] { "title", "pubDate",

}, "link" + " = '" + link + "'", null, null, null, null);}

public Cursor getRssFeeds(long rowId) throws SQLException {Cursor mCursor = db.query(true, "RSSFeeds", new String[] { KEY_ROWID,TITLE, PUB_DATE }, KEY_ROWID + "=" + rowId, null, null, null,null, null);if (mCursor != null) {mCursor.moveToFirst();}return mCursor;}

public Cursor getFEEDS() {return db.query("feeds", new String[] { "title", "pubDate" }, null,null, null, null, null);}

public long getFEEDIdFromLink(String link) {long id = 0;Cursor cursor = getFEEDS(link);

if (cursor.getCount() > 0) {cursor.moveToFirst();

id = cursor.getInt(cursor.getColumnIndex("feedid"));}

cursor.close();

return id;}

public Cursor getRssItems(long feedid) {return db.query("items", new String[] { "title", "link", "description","pubDate" }, "itemid" + " = " + "feedid", null, null, null,null);}

public Cursor getRssItem(String link) {return db.query("items", new String[] { "itemid", "title", "link","description", "pubDate" }, "link" + " = '" + link + "'", null,null, null, null);}

private ContentValues createContentValues(String title, String pubDate) {ContentValues values = new ContentValues();values.put(TITLE, "title");values.put(PUB_DATE, "pubDate");

return values;}}

MainActivity.javapackage com.mad;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.EditText;

public class MainActivity extends Activity {EditText linkE;Bundle bun;

@Overridepublic void onCreate(Bundle icicle) {super.onCreate(icicle);

setContentView(R.layout.main4);

Button b = (Button) findViewById(R.id.fetch);

b.setOnClickListener(new View.OnClickListener() {

@Overridepublic void onClick(View v) {linkE = (EditText) findViewById(R.id.url);

bun = new Bundle();bun.putString("url", linkE.getText().toString());Intent i = new Intent(getApplicationContext(), RSSReader.class);i.putExtras(bun);

startActivity(i);}});}}rssmain.xml

showdescription.xmlLinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent">

main.xml

add.xml

9. TESITING

What is testing? The process of executing a program with the explicit intention of finding errors , that is making the program fail. Testing is the process of detecting errors. Testing performs a very critical role for qualify assurance and for ensuring the reliability of software. The results of testing are used later on during maintenances also.

Psychology of TestingThe aim of testing is often to demonstrate that a program works by showing that it has no errors. The basic purpose of testing phase is to detect the errors that may be present in the program. Hence one should not start testing it the intent of showing that a program works but the intent should be to show that a program does not work. Testing is the process of executing a program with the intent of finding errors.

Testing Objectives:The main objective of testing is to uncover a host of errors, systematically and with minimum effort and time. Stating formally, we can say, 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 discovered 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.

Software Testing:Defect detection. It is the process of testing the functionality and correctness of a software by running it. A good test case is the one that has a high probability of finding an as yet undiscovered error. A successful test is one that uncovers an as yet undiscovered error. Software testing is usually performed for one of the two reasons. Defect Detection Reliability estimation.

Black Box Testing:Black Box Testing is not a type of testing; it instead is a testing strategy, which does not need any knowledge of internal design or code etc. As the name black box suggests ,no knowledge of internal logic or code structure is required. The types of testing under this strategy are totally based/focused on the testing for requirements and functionality of the work product/ software application. Black box testing is sometimes also called as OpaqueTesting, Functional/Behavioral testing and Closed Box Testing.The base of the Black box testing strategy lies in the selection of appropriate data as per functionality and testing it against the functional specification In order to check for normal and abnormal behavior of the system. Now a days, it is becoming common to route the Testing work to a third patty as the developer of the developer of the system knows too much of the internal logic and coding of the system, which makes it unfit to test the application by the developer. In order to implement Black Box Testing Strategy, the tester is needed to be through with the requirement specifications of the system and as a user, should know, how the system should behave in response to the particular action.

White Box Testing:White box testing is a security testing method that can be used to validate whether code implementation follows intended design, to validate implemented security functionality, and to uncover exploitable vulnerabilities White box testing is performed based on the knowledge of how the system is implemented. White box testing includes analyzing data flow, control flow, information flow, coding practices, and exception and error handling within the system to test the intended and unintended software behavior. White box testing and be performed to validate whether code implementation follows intended design, to validate implemented security functionality, and to uncover exploitable vulnerabilities. White box testing requires access to the source code. Though white box testing can be performed any time in the life cycle after the code is developed, it is a good practice to perform white box testing during the unit testing phase. White box testing requires knowing what makes software secure or insecure, how to think like an attacker, and how to use different testing tools and techniques. The first step in white box testing is to comprehend and analyze source code, so knowing what makes software secure is a fundamental requirement. Second, to create tests that exploit software, a tester must think like an attacker. Third, to perform testing effectively, testers need to know the different tools and techniques available for white box testing. The three requirements do not work in isolation, but together.

Levels of Testing:In order to uncover the errors present in different phases we have the concept of levels of testing. The basic levels of testing are Client need Acceptance Testing Requirements System Testing Design Integration Testing Code Unit TestingSoftware Testing Strategies:A strategy for software testing will begin in the following order. Unit Testing Integration Testing Validation Testing System Testing

Unit Testing:It concentrates on each unit of the software as implemented in source code and is a white box oriented. Using the component level design description as a guide, important control paths are tested to uncover errors within the boundary of the module. In the unit testing, the steps can be conducted in parallel for multiple components in my project I tested all the modules individually related to main function codes and attacks also.

Integration Testing:Here focus is on design and construction of the software architecture. Integration testing is a systematic technique for constructing the program structure while at the same time conducting tests to uncover errors associated with interfacing. The objective is to make unit tested components and build a program structure that has been dictated by design; the goal here is to see if modules can be integrated properly, the emphasis being on testing interfaces between modules. This testing activity can be considered as testing the design and hence the emphasis on testing module interactions. In this project the main system is formed by integrating all the modules. When integrating all the modules I have checked whether the integration effects working of any of the services by giving different combinations of inputs with which the two services run perfectly before integration.

Validation Testing:In this, requirements established as part of software requirement analysis are validated against the software that has been constructed i.e., validation succeeds when software functions in a manner that can reasonably expected by the customer.

System Testing:System testing of software or hardware is testing conducted on a complete, integrated system to evaluate the systems compliance with its specified requirements. System testing falls within the scope of black testing, and as such , should require no knowledge of the inner design of the code or logic. Here the entire software system is tested. The reference document for this process is the requirements document, and the goal is to see if software meets its requirements. A test case in software engineering is a set of conditions or variables under which a tester will determine whether an application or software system meets specifications. The mechanism for test oracle. In some settings an oracle could be requirements or use case. It may take many test cases to determine that a software program or system is functioning correctly.Test cases are often referred to as test scripts, particularly when written. Written test cases are usually collected into test suites. 10. TEST CASES

A test case in software engineering is a set of conditions or variables under which a tester will determine whether an application or software system meets its specifications. The mechanism for determining whether a software program or system has passed or failed such a test is known as a test oracle. In some settings an oracle could be a requirement or use case. It may take many test cases to determine that a software program or system is functioning correctly. Test cases are often referred to as test scripts, particularly when written. Written test cases are usually collected into test suites.What are positive and negative test cases? A positive test case is when the test is designed to return what is expected according to the requirement. Negative test case is when the test is designed to determine the response of the product outside of what is defined.

12. FUTURE SCOPE OF THE PROJECT

Currently the application only supports showing the updated feeds of the required url given by the user. But, if doesnt show the images and videos of the sites updates. It also doesnt have any reading facility of the updated feeds. So hope fully well see some unique and innovative uses in the near future.

13. CONCLUSION

RSS is an application that gives you a great way to make your mobile computing experience even more interesting. This will really provide the users with a great tinge to view these feeds on Android mobile phone. Many real time applications can be developed using this project.

14. BIBILIOGRAPHY

Books Referred:Professional android application development ---wrox publications Android SDK rc15Android a Programmers Guide --- McGraw-HillWebsite Browsed:www.rationalrose.netwww.android.comwww.android-developers.blogspot.com.www.code.google.com

15. APPENDIX

The following terms are used in this document..apk extension:The extension for an android package file, which typically contains all of the tiles related to a single android application. The file itself is a compressed collection of an androdimanifest.xml file, application code (.dex files), resources tiles, and other files. A project is compiled in to a single .apk file.

.dex extension:Android programs are compiled into .dex files, which are in turn zipped into single .apk file on the device. .dex files can be created by automatically translating compiled applications written in the java programming language.

Action:A description of something that an intent sender wants done. And action is a string value assigned to intent. Action strings can be defined by android or by a third party developer.

Activity:A single screen in an application, with supporting java code, derived from the activity class.

Adb:Android debug bridge, a command-line debugging application shipped with the SDK. It provides tools to browse the device, copy tools on the device, and forward ports for debugging.

Application:A collection of one o r more activities, services, listeners, and intent receivers. And application has single manifest, and is compiled into a single.apk file on the device.

Content provider:Class built on content provider that handles content query strings of a specific format to return data in a specific format.

Dalvik:The dalvik VM is an interpreter-only virtual machine that executes files in the dalvik executable (.dex) format, a format that is optimized for efficient storage and memory- mappable execution. The virtual machine is register-based, and it can run classes compiled by a java language compiler that have been transformed in to iits native format using the included ex tool. The VM runs on top of Posix-compliant operating systems, which it relies on for underlying functionality. The dalvik core class library is intended to provide a familiar development base or those used to programming with java standard edition, but it is geared specifically to needs of a small mobile device.

DDMS:Dalvik debug monitor service, a GUI debugging application shipped with the SDK. It provides screen capture, log dump, and process examination capabilities.

Dawable:Compiled visual resource that can be used as a background, title, or other part of the screen. it is compiled into an android. Graphics.drwawable subclass. Intent:A class that contains several fields describing what a caller would like to do. The caller sends this intent to androids intent resolver, which looks through the intent filters of all applications to find the activity most suited to handle this intent. Intent fields include the desired action, a category, a data string the MIME type of the data, handling class and other restrictions.Intent filter: Activities and intent receivers include one or more filters in their manifest to describe what kinds of intents or messages they can handle or want to receive. And intent filter lists a set of requirements. Such as data types action requested, and URI format that the intent or message must fulfill. For activities, android searches for the activity with the most closely matching valid match between the intent and the activity filter. For messages, android will forward a message to all receivers with matching intent filters.

Intent receiver:In application class that listens for messages broadcast by calling context.sendBroadcast ().

Layout resource:An XML file that describe the layout of an activity screen

Manifest:An XML file associated with each application that describes the various activities, intent filters services, and other items that It exposes.

URIs:Android uses URI strings both for requesting fdata(e.g., a list of contact) and for requesting actions(e.g., opening a web page in browser). Both are valid URI strings, but have different values. All requests for data must start with the string content://. Acton strings are valid URIs URI starting with http:// will be handled by the browser.

2