You are on page 1of 62

1.

INTRODUCTION
1.1 PURPOSE
You can block SMS (Short Message Service) based on contact number dynamically means if you can add contact number and name in database then you can block SMS of the numbers that are stored in database. The intention of this application is to facilitate the mobile users with a non disturbance and privacy maintained environment.

1.2 SCOPE
Though the application is supportable only for ANDROID operating system based mobile devices, with the proper refinement of the same, it can be made deployable on all mobile operating systems platforms. Android gives you a world-class platform for creating apps and game for Android users everywhere, as well as an open marketplace for distributing to them instantly. The purpose of choosing the Android environment is that this platform is open source platform. New applications or existing applications refinement can be done by any user and can be deployable at free of cost unlike the operating systems iOS or Windows Mobile operating systems.

1.3

DEFINITIONS,

ABBREVIATIONS

AND

MODEL

DIAGRAMS
1./bin: Contains the compiled java class (.class) files, the dalvikexecutables (.dex) files etc . 2. /gen: Contains the files generated by the android build tools (eg: R.java)

3. /lib: Contains third party libraries (jars) used by the application. 4. /res: Contains resources used by the application like icons, layouts, localized strings etc.. 5. /res/drawable: Contains images with further subfolders for high-

density/medium-density and low-density screens .6./res/layout: Contains xml files representing the UI layouts of your application.

7. /res/menu: Contains xml files representing the application menus


8. /res/values: Contains xml files representing externalized strings, colors, styles,

SMS BLOCK

dimensions.

9. /res/xml: Contains additional xml files need by the application.

10. /res/color: Contains additional color resources that adapt to view states.

MODEL DIAGRAMS

Figure 1.1: Model Diagram of SMS Block

1.4 OVERVIEW
Android powers hundreds of millions of mobile devices in more than 190 countries around the world. It's the largest installed base of any mobile platform and growing fast-every day another million users power up their Android devices for the first time and start looking for apps, games, and other digital content.

SMS BLOCK

2.TECHNOLOGIES USED
2.1. INTRODUCTION TO JAVA
Initially the language was called as oak but it was renamed as Java in 1995. The primary motivation of this language was the need for a platform-independent (i.e., architecture neutral) language that could be used to create software to be embedded in various consumer electronic devices. Java is a programmers language. 1. Java is cohesive and consistent. 2. Except for those constraints imposed by the Internet environment, Java gives the programmer, full control. 3. Finally, Java is to Internet programming where C was to system programming.

Importance of Java To The Internet


Java has had a profound effect on the Internet. This is because; Java expands the Universe of objects that can move about freely in Cyberspace. In a network, two categories of objects are transmitted between the Server and the Personal computer. They are: Passive information and Dynamic active programs. The Dynamic, Self-executing programs cause serious problems in the areas of Security and probability. But, Java addresses those concerns and by doing so, has opened the door to an exciting new form of program. Java Can be Used To Create Two Types of Programs: Applications and Applets: An application is a program that runs on our Computer under the operating system of that computer. It is more or less like one creating using C or C++. Javas ability to create Applets makes it important. An Applet is an application designed to be transmitted over the Internet and executed
SMS BLOCK 3

by a Java compatible web browser. An applet is actually a tiny Java program, dynamically downloaded across the network, just like an image. But the difference is, it is an intelligent program, not just a media file. It can react to the user input and dynamically change.

2.1.1Features Of Java Security


Every time you that you download a normal program; you are risking a viral infection. Prior to Java, most users did not download executable programs frequently, and those who did scan them for viruses prior to execution. Most users still worried about the possibility of infecting their systems with a virus. In addition, another type of malicious program exists that must be guarded against. This type of program can gather private information, such as credit card numbers, bank account balances, and passwords. Java answers both these concerns by providing a firewall between a network application and your computer. When you use a Java-compatible Web browser, you can safely download Java applets without fear of virus infection or malicious Portability For programs to be dynamically downloaded to all the various types of platforms connected to the Internet, some means of generating portable executable code is needed .As you will see, the same mechanism that helps ensure security also helps create portability. Indeed, Javas solution to these two problems is both elegant and efficient.
The Byte Code The key that allows the Java to solve the security and portability problems is that the

output of Java compiler is Byte code. Byte code is a highly optimized set of instructions designed to be executed by the Java run-time system, which is called the Java Virtual Machine (JVM). That is, in its standard form, the JVM is an interpreter for byte code. Translating a Java program into byte code helps makes it much easier to run a program in a wide variety of environments. The reason is, once the run-time package exists for a given system, any Java program can run on it.

SMS BLOCK

Although Java was designed for interpretation, there is technically nothing about Java that prevents on-the-fly compilation of byte code into native code. Sun has just completed its Just In Time (JIT) compiler for byte code. When the JIT compiler is a part of JVM, it compiles byte code into executable code in real time, on a piece-by-piece, demand basis. It is not possible to compile an entire Java program into executable code all at once, because Java performs various run-time checks that can be done only at run time. Java Virtual Machine Beyond the language, there is the Java virtual machine. The Java virtual machine is an important element of the Java technology. The virtual machine can be embedded within a web browser or an operating system. Once a piece of Java code is loaded onto a machine, it is verified. As part of the loading process, a class loader is invoked and does byte code verification makes sure that the code thats has been generated by the compiler will not corrupt the machine that its loaded on. Byte code verification takes place at the end of the compilation process to make sure that is all accurate and correct. So byte code verification is integral to the compiling and executing of Java code. OVERALL DESCRIPTION

Java

Java byte .Class code

Source Figure 2.1: Picture showing the development process of JAVA Program
Java programming uses to produce byte codes and executes them. The first box indicates that the Java source code is located in a. Java file that is processed with a Java compiler called javac. The Java compiler produces a file called a. class file, which contains the byte code. The Class file is then loaded across the network or loaded locally on your machine into the execution environment is the Java virtual machine, which interprets and executes the byte code. Java Architecture
SMS BLOCK 5

Java architecture provides a portable, robust, high performing environment for development. Java provides portability by compiling the byte codes for the Java Virtual Machine, which is then interpreted on each platform by the run-time environment. Java is a dynamic system, able to load code when needed from a machine in the same room or across the planet. Compilation Of Code When you compile the code, the Java compiler creates machine code (called byte code) for a hypothetical machine called Java Virtual Machine (JVM). The JVM is supposed to execute the byte code. The JVM is created for overcoming the issue of portability. The code is written and compiled for one machine and interpreted on all machines. This machine is called Java Virtual Machine. COMPILING AND INTERPRETING JAVA SOURCE CODE:

Java PC Compiler Java

Source Code .. ..
SPARC MacintoshCom piler

Interpreter(P C) JavaInterpret er (Macintosh) Java Interpreter(S pare)

Byte code (Platform Independent)

..

Compiler

Figure 2.2: compiling and interpreting java source code During run-time the Java interpreter tricks the byte code file into thinking that it is running on a Java Virtual Machine. In reality this could be a Intel Pentium Windows 95 or Sun SARC station running Solaris or Apple Macintosh running system and all could
SMS BLOCK 6

receive code from any computer through Internet and run the Applets. Simple Java was designed to be easy for the Professional programmer to learn and to use effectively. If you are an experienced C++ programmer, learning Java will be even easier. Because Java inherits the C/C++ syntax and many of the object oriented features of C++. Most of the confusing concepts from C++ are either left out of Java or implemented in a cleaner, more approachable manner. In Java there are a small number of clearly defined ways to accomplish a given task. ObjectOriented Java was not designed to be source-code compatible with any other language. This allowed the Java team the freedom to design with a blank slate. One outcome of this was a clean usable, pragmatic approach to objects. The object model in Java is simple and easy to extend, while simple types, such as integers, are kept as high-performance nonobjects. Robust The multi-platform environment of the Web places extraordinary demands on a program, because the program must execute reliably in a variety of systems. The ability to create robust programs was given a high priority in the design of Java. Java is strictly typed language; it checks your code at compile time and run time. Java virtually eliminates the problems of memory management and deallocation, which is completely automatic. In a well-written Java program, all run time errors can and should be managed by your program

2.2. INTRODUCTION TO ANDROID


Lot of advances can be seen these days in the field of smart phones. As the number of users is increasing day by day, facilities are also increasing. Starting with simple phones which were made just to make and receive calls. Now we have phones which can even access GPS , GPRS, Wifi, NFC. and lot of other cool and advanced features which you cannot even imagine.So in this Mobile world of this complication. Android is one of
SMS BLOCK 7

those operating system platforms which made it easy for manufacturers to design top class phones.

2.2.1 What Is Andriod?


You might have seen windows, Linux and mac operating systems which are made for computers. Windows is the most popular operating system on computers. So if you know about it then it is easy for you to get an answer for what is android. Android is also an operating system developed by Google. Basically it was started by some other company which was taken by Google. Google improved the operating system and made it a open source platform. It was widely adapted over the world. As it is open source it is so popular amongst the smart phones. Android OS can also be used on tablet PCs. Android is based on Linux and offers you a great deal of customization in widgets and over millions of apps. Most of them are free of cost and can be installed on your phone just by clicking on install tab of the respective app in the Google Play Store app. Which comes along with the android Phone. One of the most widely used mobile OS these days is ANDROID. Android is a software bunch comprising not only operating system but also middle ware and key applications. Android Inc was founded in Pa lo Alto of California, U.S. by Andy Rubin, Rich miner, Nick sears and Chris White in 2003. Later Android Inc. was acquired by Google in 2005. After original release there have been number of updates in the original version of Android. Which Phone Manufacturer Use Android? Android is a open source platform which can be used by any phone manufacturers on the world. Unlike other operating systems for mobile phones like i OS ( Operating system by apple for i Phone, i Pad and other i Devices.). Symbain is owned by Nokia and it comes only on Nokia Handsets. Android can be used by any manufacturer. So that if the latest research is to be believed over half of the smart phones in USA run on android. Android is one the hottest mobile operating systems available today. Samsung is the Largest Manufacturer of android phones and tablets. LG, HTC, Sony, are other top

SMS BLOCK

manufacturers of android phones and tablets. Some local manufacturers like Micro-max, Karbon, Hawaii, also use android Phones on their portable devices.

2.3. ANDROID VERSIONS


Android 1.0(API level 1) Android 1.1(API level 2) Android 1.5 Cupcake(API level 3) Android 1.6 Donut(API level 4) Android 2.0 Eclair(API level 5) Android 2.01 Eclair(API level 6) bAndroid 2.1 Eclair(API level 7) Android 2.2.x Froyo(API level 8) Android 2.3 to 2.3.2 Gingerbread(API level 9) Android 2.3.3 to 2.3.7 Gingerbread(API level 10) Android 3.0 Honeycomb(API level 11) Android 3.1 Honeycomb(API level 12) Android 3.2 Honeycomb(API level 13) Android 4.0 to 4.0.2 Ice Cream Sandwich(API level 14) Android 4.0.3 to 4.0.4 Ice Cream Sandwich(API level 15) Android 4.1 Jelly Bean(API level 16) Android 4.2 Jelly Bean(API level 17)

SMS BLOCK

Figure 2.3: Android versions

ANDROID 2.2.X FROYO (API LEVEL 8)


Release Date: 20 May 2010 Features Speed, memory, and performance optimizations Additional application speed improvements, implemented through JIT compilation Integration of Chrome's V8 JavaScript engine into the Browser application Support for the Android Cloud to Device Messaging (C2DM) service, enabling push notifications.
SMS BLOCK 10

Improved Microsoft Exchange support, including security policies, autodiscovery, lookup,calendar synchronization and remote wipe Improved application launcher with shortcuts to Phone and Browser applications USB tethering and Wi-Fi hotspot functionality Added an option to disable data access over mobile network Updated Market application with batch and automatic update features Quick switching between multiple keyboard languages and their dictionaries Voice dialing and contact sharing over Blue-tooth Support for Blue tooth-enabled car and desk docks Support for numeric and alphanumeric passwords Support for file upload fields in the Browser application

ANDROID 4.2 JELLY BEAN (API LEVEL 17) Release Date:13 November 2012 Features 1. "Photo Sphere" panorama photos 2. Keyboard with gesture typing 3. Lock screen improvements, including widget support and the ability to swipe directly to camera 4. Notification power controls 5. "Daydream" screensavers, showing information when idle or docked 6. Multiple user accounts (tablets only) 7. Support for wireless display (Miracast) 8. Accessibility improvements: triple-tap to magnify the entire screen, pan and zoom with two fingers. Speech output and Gesture Mode navigation for blind users 9. New clock app with built-in world clock, stop watch and timer 10. All devices now use the same interface layout, previously adapted from phones on 4.1 for smaller tablets (with centered software buttons, the system bar at the top of

SMS BLOCK

11

the screen, and a home screen with a dock and centered application menu), regardless of screen size 11. Increased number of extended notifications and Actionable Notifications for more apps, allowing the response to certain notifications within the notification bar and without launching the app directly 12. SELinux 13. Always-on VPN 14. Premium SMS confirmation Android 4.2.1: Release Date: 27 November 2012 Features: Fixed a bug in the People app where December was not displayed on the date selector when adding an event to a contact Added Blue-tooth game pads and joysticks as supported HID devices

Setting Up Development Environment In Eclipse


It is very easy to set up Android Development Environment on Eclipse. First of all you need to download the tools and software. You must download followings. 1. Java SE Development Kite (JDK 5 or newer) 2. Eclipse IDE for Java Developer 3. Android Software Development Kit

Setup Java To setup java in your computer you must download java from the oracle site here

is the download link http://www.oracle.com/technetwork/java/javase/downloads/index.html. Setup Eclipse IDE

SMS BLOCK

12

Download Eclipse IDE for Java Developer from the eclipse.org and extract the downloaded file. Eclipse is not require to installation, just run the Eclipse.exe

2.4 SETUP ANDROID SOFTWARE DEVELOPMENT KIT (SDK)


Download Android SDK from http://developer.android.com/sdk/index.html and extract the downloaded file and

run the SDK Manager. Figure 2.4 Step1 for Installation

SMS BLOCK

13

Figure 2.5: Step2 for Installation 1. Select Available packages from the left pane and then select any android sdk platform you wish to develop from the right pane, it will take time to complete. Click Install Selected 2. In the popup select Accept All and Click Install 3. In the popup select Accept All and Click Install

SMS BLOCK

14

Figure 2.6:Step3 for Installation

CREATE ANDROID VIRTUAL DEVICE (AVD) ON ANDROID SDK After installation complete select Virtual Device in the left pane and then click NEW in right pane

Figure 2.7 Step4 for Installation


SMS BLOCK 15

1. After installation complete select Virtual Device in the left pane and then click NEW in right pane. 2. Enter a name to your Android Virtual Device. 3. Select target Android version from the Target drop down box. 4. Give the size of SD card and then click Create AVD. 5. It will take time to create Android Virtual Device (AVD). Configure Installes Andriod with Eclipse: 1. Run the Eclipse...... 2. First run of Eclipse it will ask the default workplace, you must be mention the default workplace folder 3. Go to the Help -- Install New Software 4. Click Add button in install window to install Android Developer Tool 5. Name it as Android 6. Add Location as http://dl-ssl.google.com/android/eclipse/ and do OK 7. After click OK, in the next popup box Select Developer Tools and click Next and accept license agreement and finish it 8. Eclipse IDE will gives you a warning message saying Your installation software that contains unsigned content ...... just OK and restart your Eclipse IDE 9. Now you need to give the Android SDK location to the popup which will be display when Eclipse IDE restart 10. When the Eclipse IDE starts there will be a conFigureuration popup which will ask the Android SDK location 11. Select Use existing SDK and then browse the Android SDK location and finish. 12. Now your Android development Environment is ready for development. Start your First Android Application in Eclipse Hello world Android Example STEPS 1. Create Andriod Project In Eclipse, select File -> New -> Project., Android Application Project, and input your application detail like Name, Target etc. Eclipse will create all the necessary Android project files and configureuration then click next------Next------Next-------Next-SMS BLOCK 16

Finish 2. Hello World

Figure 2.8: Sample Hello World Program 3. Output Select Project---------In Menu Project-----------clean--------ok----------Right Click on Project----------Run-------Run an Android Application

2.5 APPLICATION STRUCTURE


Linux Kernel
The basic layer is the Linux kernel. The whole Android OS is built on top of the Linux 2.6 Kernel with some further architectural changes made by Google. It is this Linux that interacts with the hardware and contains all the essential hardware drivers. Drivers are programs that control and communicate with the hardware. For example, consider the Bluetooth function. All devices has a Bluetooth hardware in it. Therefore the kernel must include a Bluetooth driver to communicate with the Bluetooth hardware. The Linux kernel also acts as an abstraction layer between the hardware and other software layers. Android uses the Linux for its entire core functionality such as Memory management, process management, networking, security settings etc.
SMS BLOCK 17

Libraries
The next layer is the Androids native libraries. It is this layer that enables the device to handle different types of data. These libraries are written in c or c++ language and are specific for a particular hardware. Some of the important native libraries include the following Surface Manager: It is used for compositing window manager with off-screen buffering. Off-screen buffering means you cant directly draw into the screen, but your drawings go to the off-screen buffer. There it is combined with other drawings and form the final screen the user will see. This off screen buffer is the reason behind the transparency of windows. Media framework: Media framework provides different media codecs allowing the recording and playback of different media formats SQLite: SQLite is the database engine used in android for data storage purposes Web Kit: It is the browser engine used to display HTML content OpenGL: Used to render 2D or 3D graphics content to the screen

ANDROID RUNTIME
Android Runtime consists of Dalvik Virtual machine and Core Java libraries. Dalvik Virtual Machine It is a type of JVM used in android devices to run apps and is optimized for low processing power and low memory environments. Unlike the JVM, the Dalvik Virtual Machine doesnt run .class files, instead it runs .dex files. .dex files are built from .class file at the time of compilation and provideshifger efficiency in low resource environments. The Dalvik VM allows multiple instance of Virtual machine to be created simultaneously providing security, isolation, memory management and threading support. It is developed by Dan Bornstein of Google. Core Java Libraries These are different from Java SE and Java ME libraries. However these libraries provides
SMS BLOCK 18

of the functionalities defined in the Java SE libraries.

2.5.1 Application FrameWork


These are the blocks that our applications directly interacts with. These programs manage the basic functions of phone like resource management, voice call management etc. As a developer, you just consider these are some basic tools with which we are building our applications. Important blocks of Application framework are: Activity Manager: Manages the activity life cycle of applications Content Providers: Manage the data sharing between applications Telephony Manager: Manages all voice calls. We use telephony manager if we want to access voice calls in our application.

Location Manager: Location management, using GPS or cell tower Resource Manager: Manage the various types of resources we use in our Application

Applications
Applications are the top layer in the android architecture and this is where our applications are going to fit. Several standard applications come pre-installed with every device, such as: 1. SMS client app 2. Dialer 3. Web browser 4. Contact manager As a developer we are able to write an app which replaces any existing system app. That is, you are not limited in accessing any particular feature. You are practically limitless and can whatever you want to do with the android (as long as the user of your app permits it). Thus Android is opening endless opportunities to the developer.

SMS BLOCK

19

2.6 ANDROID USER INTERFACE COMPONENTS


The following description gives an overview of the most important user interface related component and parts of an Android application. Activity: An activity represents the visual representation of an Android application. activities use views, i.e. user interface widgets as for example buttons and fragments to create the user interface and to interact with the user.

An Android application can have several activities.


Fragments Fragments are components which run in the context of an activity. A fragment encapsulates application code so that it is easier to reuse it and to support different sized devices. Fragments are optional components which allow you to reuse user interface and non user interface components for different devices configureurations. Views and Layout Manager Views are user interface widgets, e.g. buttons or text fields. The base class for all views is the android.view.View class. Views have attributes which can be used to conFigureure their appearance and behavior. A layout manager is responsible for arranging other views. The base class for these layout managers is the android.view. ViewGroup class which extends the View class. Layout managers can be nestled to create complex layouts. You should avoid nestling them to deeply too deeply as this has a negative impact on the performance. Device Configureuration Specific Layouts The user interface for Activities is typically defined via XML files (layout files). It is possible to define defined layout file for different device conFigureuration, e.g. based on the available width of the actual device running the application. Other Android Components

SMS BLOCK

20

Android has several more components which can be used in your Android application.

Intents Intents are asynchronous messages which allow the application to request functionality from other Android components, e.g. from services or activities. An application can call a component directly (explicit Intent) or ask the Android system to evaluate registered components based on the intent data (implicit intents). For example the application could implement sharing of data via intent and all components which allow sharing of data would be available for the user to select. Applications register themselves to intent via an intent filter. Intents allow an Android application to start and to interact with components from other Android applications. Services: Services perform tasks without providing a user interface. They can communicate with other Android components and notify the user via the notification framework in Android. Content Provider A content provider provides a structured interface to application data. Via a content provider your application can share data with other applications. Android contains an SQLite database which is frequently used in conjunction with a content provider. The SQLite database would store the data, which would be accessed via the content provider. Broadcast Receiver Broadcast receivers can be registered to receive system messages and intents. A broadcast receiver gets notified by the Android system, if the specified event occurs. For example you can register broadcast receivers for the event that the Android system completed the boot processor or for the event that the state of the phone changes, e.g. someone is calling.

Home screen and lock screen widgets

SMS BLOCK

21

Widgets are interactive components which are primarily used on the Android home screen. They typically display some kind of data and allow the user to perform actions via them. For example a widget could display a short summary of new emails and if the user selects an email, it could start the email application with the selected email.

Live Wallpapers
Live wallpapers allow you to create animated backgrounds for the Android home screen.

2.7 SQLITE PROGRAMMING


What is SQLite?
SQLite is an Open Source Database which is embedded into Android. SQLite supports standard relational database features like SQL syntax, transactions and prepared statements. In addition it requires only little memory at runtime (approx. 250 Kbytes). SQLite supports the data types TEXT (similar to String in Java), INTEGER (similar to long in Java) and REAL (similar to double in Java). All other types must be converted into one of these fields before saving them in the database. SQLite itself does not validate if the types written to the columns are actually of the defined type, e.g. you can write an integer into a string column and vice versa.

SQLite in Android
SQLite is available on every Android device. Using a SQLite database in Android does not require any database setup or administration. You only have to define the SQL statements for creating and updating the database. Afterwards the database is automatically managed for you by the Android platform. Access to an SQLite database involves accessing the file system. This can be slow. Therefore it is recommended to perform database operations asynchronously, for example inside the AsyncTask class. If your application creates a database, this database is by default saved in the directory DATA/data/APP_NAME/databases/FILENAME.

SMS BLOCK

22

The parts of the above directory are constructed based on the following rules. DATA is the path which the Environment.getDataDirectory () method returns. APP_NAME is your application name. FILENAME is the name you specify in your application code for the database.

2.7.1 SQLite Architecture


Packages The package android database contains all general classes for working with databases. Android.database.sqlite contains the SQLite specific classes. SQLiteOpenHelper To create and upgrade a database in your Android application you usually subclass SQLiteOpenHelper. In the constructor of your subclass you call the super( ) method of SQLiteOpenHelper, specifying the database name and the current database version. In this class you need to override the onCreate( ) and onUpgrade( ) methods. onCreate( ) is called by the framework, if the database does not exists.onUpgrade( ) is called, if the database version is increased in your application code. This method allows you to update the database schema. Both methods receive a SQLiteDatabase object as parameter which represents the database. SQLiteOpenHelper provides the methods getReadableDatabase( ) and

getWriteableDatabase( ) to get access to a SQLiteDatabase object; either in read or write mode. The database tables should use the identifier _id for the primary key of the table. Several Android functions rely on this standard. It is best practice to create a separate class per table. This class defines static onCreate( ) and onUpgrade() methods. These methods are called in the corresponding methods of SQLiteOpenHelper. This way your implementation of SQLiteOpenHelper will stay readable, even if you have several tables. SQLiteDatabase SQLiteDatabase is the base class for working with a SQLite database in Android and provides methods to open, query, update and close the database. More specifically SQLiteDatabase provides the insert( ), update( ) and delete( ) methods. In addition it provides the execSQL( ) method, which allows to execute an SQL
SMS BLOCK 23

statement directly. The object Content Values allows to define key/values. The "key" represents the table column identifier and the "value" represents the content for the table record in this column. Content Values can be used for inserts and updates of database entries. Queries can be created via the rawQuery( ) and query( ) methods or via the SQLiteQueryBuilder class. rawQuery() directly accepts an SQL select statement as input. query() provides a structured interface for specifying the SQL query. SQLiteQueryBuilder is a convenience class that helps to build SQL queries.

3. SYSTEM ANALYSIS
Understanding the properties and requirements of a new system is more difficult and requires creative thinking and understanding of existing running system is also difficult, improper understanding of present system can lead diversion from solution.

3.1 SECTION OVERVIEW


After analyzing the requirements of the task to be performed, the next step is to analyze the problem and understand its context. The first activity in the phase is studying the existing system and other is to understand the requirements and domain of the new system. Both the activities are equally important, but the first activity serves as a basis of giving the functional specifications and then successful design of the proposed system. Understanding the properties and requirements of a new system is more difficult and requires creative thinking and understanding of existing running system is also difficult, improper understanding of present system can lead diversion from solution. The activities are equally important, but the first activity serves as a basis of giving the functional specifications and then successful design of the proposed system.

SMS BLOCK

24

3.2 EXISTING SYSTEM


There is no existing application available like this to block a SMS without giving any notification to the particular phone number of user.

Functionalities of existing system:


If the user enables the SMS blocking then the message is blocked. When a user receives a message, he gets a notification that his message is being blocked. Its up to the user to enable or disable the SMS blocking.

Disadvantages:
There is no automatic blocking. It intimates the user that his messsage is being blocked.

3.3 PROBLEM STATEMENT


The SMS Block is playing a vital role in case of user wants a particular phno message is to be blocked. Even in case of disturbing the user while he is performing the task and message is used for unrelated matters to know the information about the persons working in the community. The present blocking system provides But there is no system that provides SMS blocking without any notification to the user.

3.4 PROPOSED SYSTEM


By considering the problems in the existing system we need to develop the new blocked system providing the user different interface. The project aims in implementing a system that does it provide user, which is not provide any notifications to the users that it is blocked.
SMS BLOCK

Functionalities of proposed system:


Application runs hidden in Android phone. Application start automatically when phone start. Block the message of particular user number which is activated in SMS
25

Block, when mobile

receives a SMS & the blocked message has

extension of file name(.txt) The blocked message is automatically delete from memory.

Advantages:
The user doesnt get any notification. The output file format is supported in all mobiles.

SMS BLOCK

26

4. SYSTEM DESIGN
4.1 SYSTEM SPECIFICATIONS
Software design sits at the technical kernel of the software engineering process and is applied regardless of the development paradigm and area of application. Design is the first step in the development phase for any engineered product or system. The designers goal is to produce a model or representation of an entity that will later be built. Beginning, once system requirement have been specified and analyzed, system design is the first of the three technical activities -design, code and test that is required to build and verify software. The importance can be stated with a single word Quality. Design is the place where quality is fostered in software development. Design provides us with representations of software that can assess for quality. Design is the only way that we can accurately translate a customers view into a finished software product or system. Software design serves as a foundation for all the software engineering steps that follow. Without a strong design we risk building an unstable system one that will be difficult to test, one whose quality cannot be assessed until the last stage.

4.2. SYSTEM COMPONENTS


The system components consists of three modules which involved in it so, the system can be enchancement

4.2.1 Modules Involved


User Interface Module: By using this module we can design the screen according to your requirements. Set up Buttons Module: This module used to create buttons and provide actions based on ids.Set up Database Module: By using this module we can store name of contact and number of contact. Block SMS Module: This module is used to block SMS using contact numbers.

SMS BLOCK

27

UN Block SMS Module: This module is used to delete contact numbers from block-list. Archiving and backup Module: Allows Admin users to Archive/backup old data system

4.3 UNIFIED MODELLING LANGUAGE DIAGRAMS


The Unified Modeling Language allows the software engineer to express an analysis model using the modeling notation that is governed by a set of syntactic semantic and pragmatic rules. A UML system is represented using five different views that describe the system from distinctly different perspective. Each view is defined by a set of diagram, which is as follows. User Model View: This view represents the system from the users perspective. The analysis representation describes a usage scenario from the end-users perspective. Structural model view: In this model the data and functionality are arrived from inside the system. This model view models the static structures. Behavior Model View: It represents the dynamic of behavioral as parts of the system, depicting the interactions of collection between various structural elements described in the user model and structural model view. Implementation Model View: In this the structural and behavioral as parts of the system are represented as they are to be built Environmental Model View: In this the structural and behavioral aspects of the environment in which the system is to be implemented are represented Use case Diagrams represent the functionality of the system from a users point of view. Use cases are used during requirements elicitation and analysis to represent
SMS BLOCK 28

the functionality of the system. Use cases focus on the behavior of the system from external point of view. Actors areexternal entities that interact with the system. Examples of actors include users like administrator, bank customer etc., or another system like central database.

4.3.1.Class Diagram

SMS BLOCK

29

Figure 4.1 Class Diagram for SMS Block

4.3.2 Use case Diagram


SMS BLOCK 30

Figure 4.2 Use Case Diagram for SMS Block

SMS BLOCK

31

4.3.3 Sequence Diagram

Figure 4.3 Sequence Diagram for SMS Block

SMS BLOCK

32

4.3.4 Collaboration Diagram`

Figure 4.4 Collaboration Diagram for SMS Block

SMS BLOCK

33

5. SYSTEM REQUIRMENTS SPECIFICATION


Requirements Specification plays an important role in creating quality software solutions. Specification is basically a representation process. Requirements are represented in a manner that ultimately leads to successful software implementation. Each requirement must be consistent with the overall objective. The development of this project deals with the following requirement. Hardware requirement Software requirements

5.1 SOFTWARE REQUIRMENTS


The software requirements specification is produced at the culmination of the analysis task. The function and performance allocated to the software as a part of system engineering are refined by establishing a complete information description, a detailed functional and behavioral description, and indication of performance requirements and design constraints, appropriate validation criteria and other data pertinent to requirements. Table: 5.1 Software Requirements
Content OS Database Technologies Software Description Android,linux/windowsxp/7 SQLite Core Java, Android Adt-plugin

SMS BLOCK

34

5.2 HARDWARE REQUIREMENTS:


The selection of hardware is very important in the existence and proper working of any software. In the selection of hardware, the size and the capacity requirements are also important.

Table: 5.2 Processor RAM Device Requirements P-IV with 2 GHz 1GB (minimum) Android compatible Handset Hardware

SMS BLOCK

35

6. IMPLEMENTATION
Implementation literally means to put into effect or carry out. The system implementation phase if the software deals with the translation of the design specifications into the source code.

6.1 INTRODUCTION
The ultimate goal of the implementation is to write the source code and the internal documentation so that it can be verified easily. The code and documentation should be written in a manner that eases debugging, testing and modification. System flow charts, sample run on packages, sample output etc., is part of implementation. Clarity and simplicity of the code. Minimization of hard coding. Minimization of amount of memory used. Through phased implementation we can use our proposed system.

6.2 SAMPLE CODE


SMS RECEIVER:
packagecom.example.sbti; importjava.util.List; importandroid.annotation.SuppressLint; importandroid.content.BroadcastReceiver; importandroid.content.Context;
SMS BLOCK 36

importandroid.content.Intent; importandroid.os.Bundle; importandroid.telephony.SmsMessage; importandroid.widget.Toast; public class SmsReceiver extends BroadcastReceiver { // String specificPhoneNumber = "15555215556"; DBAdapterdb; public String TAG = "SmsReceiver"; private static final String ACTION = "android.provider.Telephony.SEND_SMS"; public static int MSG_TPE=0; @SuppressLint("NewApi") public void onReceive(Context context, Intent intent) { System.out.println("on recive1 method"); db =new DBAdapter(context); System.out.println("after db"); String MSG_TYPE=intent.getAction(); if(MSG_TYPE.equals("android.provider.Telephony.SMS_RECEIVED")) { System.out.println("if black"); // Toast toast = Toast.makeText(context,"SMS Received: "+MSG_TYPE ,

Toast.LENGTH_LONG); // toast.show();

Bundle bundle = intent.getExtras(); Object messages[] = (Object[]) bundle.get("pdus"); SmsMessagesmsMessage[] = new SmsMessage[messages.length];

for (int n = 0; n <messages.length; n++) { System.out.println("for loop");


SMS BLOCK 37

smsMessage[n] = SmsMessage.createFromPdu((byte[]) messages[n]); } System.out.println("outer for loop"); String phNum=smsMessage[0].getOriginatingAddress(); System.out.println("phonenumber is ::"+phNum); phNum=phNum.substring(7); // phNum=phNum.substring(phNum.length()-10);//for testing in real mobile device System.out.println("phNum :: "+phNum); List<String>specificPhoneNumber = db.getMessage1(); System.out.println("blocked number issssssssss"+specificPhoneNumber); intaruna=0; for(inti=0;i<specificPhoneNumber.size();i++) { if (specificPhoneNumber.get(i).equals(phNum)) { aruna=1; } } if (aruna==1) {

// show first message Toast toast = Toast.makeText(context,"BLOCKED Received SMS: " + smsMessage[0].getMessageBody(), Toast.LENGTH_LONG); toast.show(); abortBroadcast(); for(inti=0;i<8;i++) { System.out.println("Blocking SMS **********************"); }

SMS BLOCK

38

} else if(MSG_TYPE.equals("android.provider.Telephony.SEND_SMS")) { Toast toast = Toast.makeText(context,"SMS SENT: "+MSG_TYPE , Toast.LENGTH_LONG); toast.show(); abortBroadcast(); for(inti=0;i<8;i++) { System.out.println("Blocking SMS **********************"); } } else { Toast toast = Toast.makeText(context,"SIN ELSE: "+MSG_TYPE , Toast.LENGTH_LONG); toast.show(); // abortBroadcast(); for(inti=0;i<8;i++) { System.out.println("Blocking SMS **********************"); } } } } }

SMS BLOCK

39

SMS BLOCK DAO:


packagecom.example.sbti; public class smsblockDao { //private variables int _id; String _name; String _number; // Empty constructor publicsmsblockDao(){ } // constructor publicsmsblockDao(int id, String name, String number){ this._id = id; this._name = name; this._number = number; } // constructor publicsmsblockDao(String name, String number){ this._name = name; this._number = number; } // getting ID
SMS BLOCK 40

publicintgetID(){ returnthis._id; } // setting id public void setID(int id){ this._id = id; } public String get_name() { return _name; } public void set_name(String _name) { this._name = _name; } public String get_number() { return _number; } public void set_number(String _number) { this._number = _number; } }

SMS BLOCK ACTIVITY:


packagecom.example.sbti; importandroid.app.Activity; importandroid.os.Bundle; importandroid.view.View; importandroid.view.View.OnClickListener; importandroid.widget.Button; importandroid.widget.EditText; public class SmsBlockActivity extends Activity implements OnClickListener {
SMS BLOCK 41

Button b1,b2; EditText e1,e2; DBAdapterdb=new DBAdapter(this); @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.smsblock); b1=(Button)findViewById(R.id.button1); b2=(Button)findViewById(R.id.button2); e1=(EditText)findViewById(R.id.editText1); e2=(EditText)findViewById(R.id.editText2); b1.setOnClickListener(this); b2.setOnClickListener(this); } @Override public void onClick(View v) { // TODO Auto-generated method stub switch (v.getId()) { case R.id.button1: String str=e1.getText().toString(); String str1=e2.getText().toString(); db.addmessage(str,str1); break; case R.id.button2: finish(); break; default: break; } }
SMS BLOCK 42

MAIN SCREEN ACTIVITY:


packagecom.example.sbti; importandroid.app.Activity; importandroid.content.Intent; importandroid.os.Bundle; importandroid.view.View; importandroid.view.View.OnClickListener; importandroid.widget.Button; importandroid.widget.EditText; public class MainScreenActivity extends Activity implements OnClickListener { Button b1; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.main_screenactivity); b1=(Button)findViewById(R.id.button1); b1.setOnClickListener(this); } @Override public void onClick(View v) { // TODO Auto-generated method stub
SMS BLOCK 43

switch (v.getId()) { case R.id.button1: Intent i2=new Intent(MainScreenActivity.this, SmsBlockActivity.class); startActivity(i2); break; default: break;

7. SYSTEM TESTING
Testing is one of the most important phases in the software development activity. In software development life cycle (SDLC), the main aim of testing process is the quality; the developed software is tested against attaining the required functionality and performance.

7.1 SECTION OVERVIEW


During the testing process the software is worked with some particular test cases and the output of the test cases are analyzed whether the software is working according to the expectations or not. The success of the testing process in determining the errors is mostly depends upon the test case criteria, for testing any software we need to have a description of the expected behavior of the system and method of determining whether the observed behavior confirmed to the expected behavior.

7.2 LEVELS OF TESTING


Since the errors in the software can be injured at any stage. So, we have to carry out the testing process at different levels during the development. The basic levels of testing are Unit, Integration, System and Acceptance Testing. The Unit Testing is carried out on coding. Here different modules are tested against the specifications produced during design for the modules. In case of integration testing different tested modules are combined into sub systems and tested in case of the
SMS BLOCK 44

system testing the full software is tested and in the next level of testing the system is tested with user requirement document prepared during SRS. Functional Testing In Functional Testing test cases are decided solely on the basis of requirements of the program or module and the internals of the program or modules are not

considered for selection of test cases. This is also called Black Box Testing

Structural Testing In Structural Testing test cases are generated on actual code of the program or

module to be tested. This is called White Box Testing.

7.3 TESTING PROCESS


A number of activities must be performed for testing software. Testing starts with test plan. Test plan identifies all testing related activities that need to be performed along with the schedule and guide lines for testing. The plan also specifies the levels of testing that need to be done, by identifying the different testing units. For each unit specified in the plan first the test cases and reports are produced. These reports are analyzed. Test Plan Test plan is a general document for entire project, which defines the scope, approach to be taken and the personal responsible for different activities of testing. The inputs for forming test plans are Project plan Requirements document System design

Test Case Specification

SMS BLOCK

45

Although there is one test plan for entire project test cases have to be specified separately for each test case. Test case specification gives for each item to be tested. All test cases and outputs expected for those test cases. Test Case Execution and Analysis The steps to be performed for executing the test cases are specified in separate document called test procedure specification. This document specify any specify requirements that exist for setting the test environment and describes the methods and formats for reporting the results of testing.

Unit Testing Unit testing mainly focused first in the smallest and low level modules, proceeding one at a time. Bottom-up testing was performed on each module. As developing a driver program, that tests modules by developed or used. But for the purpose of testing, modules themselves were used as stubs. After the lower level modules were tested, the modules that in the next higher level those make use of the lower modules were tested. Each module was tested against required functionally and test cases were developed to test the boundary values. Integrating Testing Integration testing is a systematic technique for constructing the program structure, while at the same time conducting tests to uncover errors associated with interfacing. As the system consists of the number of modules the interfaces to be tested were between the edges of the two modules. The software tested under this was incremental bottom-up approach. Bottom-up approach integration strategy was implemented with the following steps. Low level modules were combined into clusters that perform specific software functions

System Testing
SMS BLOCK 46

System testing is a series of different tests whose primary purpose is to fully exercise the computer-based system. It also tests to find discrepancies between the system and its original objective, current specifications

SMS BLOCK

47

7.4 TEST CASES


Table 7.1 Test Case for receiving SMS Test Case#:1 Test Objective: To check receiving a SMS Test Description: SMS is checked Requirements Verified: User have verified message received in inbox Test Environments: Android Emulator Test setup: user initiates any control mechanism like Msg sending Actions SMS Sending Expected Results User need to enter the text SMS. Actual Results SMS sent. Priority (H, L): High

SMS receiving

User need to check the inbox.

SMS received.

Pass: Yes

Conditional pass:

Fail:

SMS BLOCK

48

Table 7.2 Test Case for blocked SMS


Test Case#:2 Priority (H, L): High

Test Objective: To Check the blocked SMS Test Description: enter number , .txt extension Requirements Verified: Phno, message type Test Environments: Android Compatable Handset Test setup: SMS block need to be activated and check the inbox of phone memory Actions Phno blocked SMS The SMS need to be saved with .txt extension and .txt need to be portable in any device Pass: Yes Conditional pass: Fail: The message is blocked with .txt extension and portable in all the machines. and Expected Results Number of the message not received Actual Results Message Blocked with correct no.

SMS BLOCK

49

7.5 DISCUSSION OF RESULTS

Figure 7.1 SMS Block application 1. The above screen shows us the SMS block application. 2. It consists of SMS block .apk file which should be installed for application to run.

SMS BLOCK

50

SMS BLOCK

51

Figure 7.2 Verifying the application 1. The above screen shows us the verifying process of the application. 2. It consists of a package installer and verify and install for SMS block application to get installed.

SMS BLOCK

52

Figure 7.3 Requesting to install application 1. The above screen shows us the request for installing application. 2. The above options need to be selected for installing the app.

SMS BLOCK

53

Figure 7.4 Application installed 1. The above screen tells us that the application is installed. 2. For successful installation press done or else open it

SMS BLOCK

54

Figure 7.5 Application overview 1. The screen gives us the overview of the application. 2. The app consists of SMS block button.

SMS BLOCK

55

Figure 7.6 Entries fields 1. The above screen shows the entry fields in the application. 2. It consists of one entry field for name and one entry field for number.

SMS BLOCK

56

Figure 7.7 Enter phone number and save it 1. The above screen shows us the details filled in the entry field. 2. After the details are filled the save button is pressed for the execution of application.

SMS BLOCK

57

Figure 7.8 Receiving the sample message 1. The above screen shows us a sample message received.

SMS BLOCK

58

Figure 7.9 SMS Blocked 1. The above screen shows the blocked SMS. 2. The message which is blocked is displayed on the screen only once.

SMS BLOCK

59

SMS BLOCK

60

8. CONCLUSION AND FUTURE ENHANCEMENTS


8.1 CONCLUSION
The SMS blocking system is an application developed as a special application and a unique feature that can be utilizable on mobile devices, with which the user feels comfortable Because of the development of the front end of the application using familiar languages, the options provided in the form of menus are easy to use for the user and hence can become very friendly.

8.2 FUTURE ENHANCEMENTS


As it is developed on ANROID operating system which is an open source operating system, it can be installed at free of cost and several modifications can be made by any user according to his/her requirements and as ANDROID is based on JAVA platform, it can be modified and refined and can be upgraded to meet and support the upcoming versions o the current operating system. The application can be enhanced to deal with all sorts of message blockings such as multimedia, flash messages etc.

SMS BLOCK

61

9. REFERENCES
Java Technologies
JAVA Complete Reference Java Script Programming by Yehuda Shiran

Android Technology
http://developer.android.com http://www.vogella.com http://android.programmerguru.com

SMS BLOCK

62