Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
210 views65 pages

Android SMS Blocking Guide

It is android app supported from any versions.........in this the interface is different with other which may leads to different access to it.

Uploaded by

bhagathchethan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
210 views65 pages

Android SMS Blocking Guide

It is android app supported from any versions.........in this the interface is different with other which may leads to different access to it.

Uploaded by

bhagathchethan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 65

1.

INTRODUCTION

SMS BLOCK

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 A !"#$! 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. ew applications or e'isting applications refinement can be done by any user and can be deployable at free of cost unlike the operating systems i#S or (indows Mobile operating systems.

1.3

DEFINITIONS,

ABBREVIATIONS

AND

MODEL

DIAGRAMS
)./bin: *ontains the compiled +ava class (.class) files% the dalvike'ecutables (.de') files etc . ,. /gen: *ontains the files generated by the android build tools (eg- ".+ava) .. / ib: *ontains third party libraries (+ars) used by the application. /. /!e": *ontains resources used by the application like icons% layouts% locali0ed strings etc.. 1. /!e"/#!$%$b e: *ontains images with further subfolders for

high&density2medium&density and low&density screens .3./!e"/ $&'(): *ontains 'ml files representing the 4$ layouts of your application.

5. /!e"/*en(: *ontains 'ml files representing the application menus


6. /!e"/+$ (e": *ontains 'ml files representing e'ternali0ed strings% colors% styles%

SMS BLOCK

dimensions.

7. /!e"/,* : *ontains additional 'ml files need by the application.

)8. /!e"/-' '!: *ontains additional color resources that adapt to view states.

MODEL DIAGRAMS

9igure ).)- Model !iagram of SMS :lock

1.. OVERVIE/
Android powers hundreds of millions of mobile devices in more than )78 countries around the world. $t;s the largest installed base of any mobile platform and growing fast&&every day another million user<s power up their Android devices for the first time and start looking for apps% games% and other digital content.

SMS BLOCK

SMS BLOCK

2.TEC0NOLOGIES USED
2.1. INTRODUCTION TO JAVA
$nitially the language was called as =oak> but it was renamed as =?ava> in )771. 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. ?ava is a programmer<s language. ). ?ava is cohesive and consistent. ,. @'cept for those constraints imposed by the $nternet environment% ?ava gives the programmer% full control. .. 9inally% ?ava is to $nternet programming where * was to system programming.

I*1'!)$n-e '2 3$+$ T' T4e In)e!ne)


?ava has had a profound effect on the $nternet. This is becauseA ?ava e'pands the 4niverse of ob+ects that can move about freely in *yberspace. $n a network% two categories of ob+ects are transmitted between the Server and the Bersonal computer. They are- Bassive information and !ynamic active programs. The !ynamic% Self&e'ecuting programs cause serious problems in the areas of Security and probability. :ut% ?ava addresses those concerns and by doing so% has opened the door to an e'citing new form of program. 3$+$ C$n be U"e# T' C!e$)e T%' T&1e" '2 P!'g!$*": A11 i-$)i'n" $n# A11 e)"- An application is a program that runs on our *omputer under the operating system of that computer. $t is more or less like one creating using * or *CC. ?ava<s ability to create Applets makes it important. An Applet is an application designed to be transmitted over the $nternet and e'ecuted by a ?ava Dcompatible web browser. An applet is actually a tiny ?ava program% dynamically downloaded across the network% +ust like an image. :ut the
SMS BLOCK 5

difference is% it is an intelligent program% not +ust a media file. $t can react to the user input and dynamically change.

2.1.1Fe$)(!e" O2 3$+$ Se-(!i)&


@very time you that you download a =normal> programA you are risking a viral infection. Brior to ?ava% most users did not download e'ecutable programs freEuently% and those who did scan them for viruses prior to e'ecution. Most users still worried about the possibility of infecting their systems with a virus. $n addition% another type of malicious program e'ists that must be guarded against. This type of program can gather private information% such as credit card numbers% bank account balances% and passwords. ?ava answers both these concerns by providing a =firewall> between a network application and your computer. (hen you use a ?ava&compatible (eb browser% you can safely download ?ava applets without fear of virus infection or malicious P'!)$bi i)& 9or programs to be dynamically downloaded to all the various types of platforms connected to the $nternet% some means of generating portable e'ecutable code is needed .As you will see% the same mechanism that helps ensure security also helps create portability. $ndeed% ?ava<s solution to these two problems is both elegant and efficient.
T4e B&)e C'#e The key that allows the ?ava to solve the security and portability problems is that the

output of ?ava compiler is :yte code. :yte code is a highly optimi0ed set of instructions designed to be e'ecuted by the ?ava run&time system% which is called the ?ava Firtual Machine (?FM). That is% in its standard form% the ?FM is an interpreter for byte code. Translating a ?ava 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 e'ists for a given system% any ?ava program can run on it. Although ?ava was designed for interpretation% there is technically nothing about ?ava that prevents on&the&fly compilation of byte code into native code. Sun has +ust
SMS BLOCK 6

completed its ?ust $n Time (?$T) compiler for byte code. (hen the ?$T compiler is a part of ?FM% it compiles byte code into e'ecutable code in real time% on a piece&by&piece% demand basis. $t is not possible to compile an entire ?ava program into e'ecutable code all at once% because ?ava performs various run&time checks that can be done only at run time. 3$+$ Vi!)($ M$-4ine :eyond the language% there is the ?ava virtual machine. The ?ava virtual machine is an important element of the ?ava technology. The virtual machine can be embedded within a web browser or an operating system. #nce a piece of ?ava 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 that<s has been generated by the compiler will not corrupt the machine that it<s loaded on. :yte 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 e'ecuting of ?ava code. OVERALL DESCRIPTION

Source
Java

Java byte code


.Class

9igure ,.)- Bicture showing the development process of ?AFA Brogram ?ava programming uses to produce byte codes and e'ecutes them. The first bo' indicates that the ?ava source code is located in a. ?ava file that is processed with a ?ava compiler called +avac. The ?ava compiler produces a file called a. class file% which contains the byte code. The *lass file is then loaded across the network or loaded locally on your machine into the e'ecution environment is the ?ava virtual machine% which interprets and e'ecutes the byte code. 3$+$ A!-4i)e-)(!e ?ava architecture provides a portable% robust% high performing environment for development. ?ava provides portability by compiling the byte codes for the ?ava Firtual
SMS BLOCK 7

Machine% which is then interpreted on each platform by the run&time environment. ?ava is a dynamic system% able to load code when needed from a machine in the same room or across the planet. C'*1i $)i'n O2 C'#e (hen you compile the code% the ?ava compiler creates machine code (called byte code) for a hypothetical machine called ?ava Firtual Machine (?FM). The ?FM is supposed to e'ecute the byte code. The ?FM 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 ?ava Firtual Machine. COMPILING AND INTERPRETING 3AVA SOURCE CODE:

Source Code .. .. ..

PC Compiler Java Macintos Co!"i#er %yte code &$#at'or! Inde"en( dent)

Java Inter"reter&$C)

Java JavaInter"reter Inter"reter&S"are) &Macintos )

S$ARC

Co!"i#er

9igure ,.,- compiling and interpreting +ava source code !uring run&time the ?ava interpreter tricks the byte code file into thinking that it is running on a ?ava Firtual Machine. $n reality this could be a $ntel Bentium (indows 71 or Sun SA"* station running Solaris or Apple Macintosh running system and all could receive code from any computer through $nternet and run the Applets.

SMS BLOCK

Si*1 e ?ava was designed to be easy for the Brofessional programmer to learn and to use effectively. $f you are an e'perienced *CC programmer% learning ?ava will be even easier. :ecause ?ava inherits the *2*CC synta' and many of the ob+ect oriented features of *CC. Most of the confusing concepts from *CC are either left out of ?ava or implemented in a cleaner% more approachable manner. $n ?ava there are a small number of clearly defined ways to accomplish a given task. Ob5e-)6O!ien)e# ?ava was not designed to be source&code compatible with any other language. This allowed the ?ava team the freedom to design with a blank slate. #ne outcome of this was a clean usable% pragmatic approach to ob+ects. The ob+ect model in ?ava is simple and easy to e'tend% while simple types% such as integers% are kept as high&performance non&ob+ects. R'b(") The multi&platform environment of the (eb places e'traordinary demands on a program% because the program must e'ecute reliably in a variety of systems. The ability to create robust programs was given a high priority in the design of ?ava. ?ava is strictly typed languageA it checks your code at compile time and run time. ?ava virtually eliminates the problems of memory management and deallocation% which is completely automatic. $n a well&written ?ava program% all run time errors can and should be managed by your program

2.2. INTRODUCTION TO ANDROID


Got 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 +ust to make and receive calls. access HBS % HB"S% (ifi% ow we have phones which can even 9*. and lot of other cool and advanced features which you

cannot even in this Mobile world of this complication. Android is one of those operating system platforms which made it easy for manufacturers to design top class phones.
SMS BLOCK

2.2.1 /4$) I" An#!i'#7


You might have seen windows% Ginu' and mac operating systems which are made for computers. (indows 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 Hoogle. :asically it was started by some other company which was taken by Hoogle. Hoogle improved the operating system and made it a open source platform. $t was widely adapted over the world. As it is open source it is so popular amongst the smart phones. Android #S can also be used on tablet B*s. Android is based on Ginu' and offers you a great deal of customi0ation in widgets and over millions of apps. Most of them are free of cost and can be installed on your phone +ust by clicking on install tab of the respective app in the Hoogle Blay Store app. (hich comes along with the android Bhone. #ne of the most widely used mobile #S these days is A !"#$!. Android is a software bunch comprising not only operating system but also middle ware and key applications. Android $nc was founded in Ba lo Alto of *alifornia% 4.S. by Andy "ubin% "ich miner% ick sears and *hris (hite in ,88.. Gater Android $nc. was acEuired by Hoogle in ,881. After original release there have been number of updates in the original version of Android. /4i-4 P4'ne M$n(2$-)(!e! U"e An#!'i#7 Android is a open source platform which can be used by any phone manufacturers on the world. 4nlike other operating systems for mobile phones like i #S ( #perating system by apple for i Bhone% i Bad and other i !evices.). Symbain is owned by okia and it comes only on okia Iandsets. Android can be used by any manufacturer. So that if the latest research is to be believed over half of the smart phones in 4SA run on android. Android is one the hottest mobile operating systems available today. Samsung is the Gargest Manufacturer of android phones and tablets. GH% IT*% Sony% are other top manufacturers of android phones and tablets. Some local manufacturers like Micro&ma'% Jarbon% Iawaii% also use android Bhones on their portable devices.

SMS BLOCK

1!

2.3. ANDROID VERSIONS


Android ).8(AB$ level )) Android ).)(AB$ level ,) Android ).1 *upcake(AB$ level .) Android ).3 !onut(AB$ level /) Android ,.8 @clair(AB$ level 1) Android ,.8) @clair(AB$ level 3) bAndroid ,.) @clair(AB$ level 5) Android ,.,.' 9royo(AB$ level 6) Android ,.. to ,..., Hingerbread(AB$ level 7) Android ,.... to ,...5 Hingerbread(AB$ level )8) Android ..8 Ioneycomb(AB$ level ))) Android ..) Ioneycomb(AB$ level ),) Android .., Ioneycomb(AB$ level ).) Android /.8 to /.8., $ce *ream Sandwich(AB$ level )/) Android /.8.. to /.8./ $ce *ream Sandwich(AB$ level )1) Android /.) ?elly :ean(AB$ level )3) Android /., ?elly :ean(AB$ level )5)

SMS BLOCK

11

9igure ,..- Android versions

ANDROID 2.2.8 FRO9O :API LEVEL ;<


Re e$"e D$)e: ,8 May ,8)8 Fe$)(!e" Speed% memory% and performance optimi0ations Additional application speed improvements% implemented through ?$T compilation $ntegration of *hrome;s F6 ?avaScript engine into the :rowser application Support for the Android *loud to !evice Messaging (*,!M) service% enabling push notifications.
SMS BLOCK 12

$mproved Microsoft @'change support% including security policies% auto&discovery% lookup%calendar synchroni0ation and remote wipe $mproved application launcher with shortcuts to Bhone and :rowser applications 4S: tethering and (i&9i hotspot functionality Added an option to disable data access over mobile network 4pdated Market application with batch and automatic update features Kuick switching between multiple keyboard languages and their dictionaries Foice dialing and contact sharing over :lue&tooth Support for :lue tooth&enabled car and desk docks Support for numeric and alphanumeric passwords Support for file upload fields in the :rowser application

ANDROID ..2 3ELL9 BEAN :API LEVEL 1=< Re e$"e D$)e:). ovember ,8), Fe$)(!e" ). LBhoto SphereL panorama photos ,. Jeyboard with gesture typing .. Gock screen improvements% including widget support and the ability to swipe directly to camera /. otification power controls 1. L!aydreamL screensavers% showing information when idle or docked 3. Multiple user accounts (tablets only) 5. Support for wireless display (Miracast) 6. Accessibility improvements- triple&tap to magnify the entire screen% pan and 0oom with two fingers. Speech output and Hesture Mode navigation for blind users 7. ew clock app with built&in world clock% stop watch and timer /.) for smaller tablets (with centered software buttons% the system bar at the top of
SMS BLOCK 13

)8. All devices now use the same interface layout% previously adapted from phones on

the screen% and a home screen with a dock and centered application menu)% regardless of screen si0e )). $ncreased number of e'tended notifications and Actionable without launching the app directly ),. S@Ginu' ).. Always&on FB )/. Bremium SMS confirmation An#!'i# ..2.1: Re e$"e D$)e: ,5 ovember ,8), Fe$)(!e": 9i'ed a bug in the Beople app where !ecember was not displayed on the date selector when adding an event to a contact Added :lue&tooth game pads and +oysticks as supported I$! devices otifications for more apps% allowing the response to certain notifications within the notification bar and

Se))ing U1 De+e '1*en) En+i!'n*en) In E- i1"e


$t is very easy to set up Android !evelopment @nvironment on @clipse. 9irst of all you need to download the tools and software. You must download followings. ). ?ava S@ !evelopment Jite (?!J 1 or newer) ,. @clipse $!@ for ?ava !eveloper .. Android Software !evelopment Jit Se)(1 3$+$ To setup +ava in your computer you must download +ava from the oracle site here is the download link http-22www.oracle.com2technetwork2+ava2+avase2downloads2inde'.html.

Se)(1 E- i1"e IDE !ownload @clipse $!@ for ?ava !eveloper from the eclipse.org and e'tract the

downloaded file. @clipse is not reEuire to installation% +ust run the @clipse.e'e

SMS BLOCK

14

2.. SETUP ANDROID SOFT/ARE DEVELOPMENT >IT :SD><


!ownload Android S!J from http-22developer.android.com2sdk2inde'.html and e'tract the downloaded file and

run the S!J Manager. 9igure ,./ Step) for $nstallation

SMS BLOCK

15

9igure ,.1- Step, for $nstallation

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. *lick $nstall Selected ,. $n the popup select Accept All and *lick $nstall .. $n the popup select Accept All and *lick $nstall

SMS BLOCK

16

9igure ,.3-Step. for $nstallation CREATE ANDROID VIRTUAL DEVICE :AVD< ON ANDROID SD> After installation complete select Firtual !evice in the left pane and then click @( in right pane

9igure ,.5 Step/ for $nstallation

SMS BLOCK

17

). After installation complete select Firtual !evice in the left pane and then click @( in right pane.

,. @nter a name to your Android Firtual !evice. .. Select target Android version from the Target drop down bo'. /. Hive the si0e of S! card and then click *reate AF!. 1. $t will take time to create Android Firtual !evice (AF!). C'n2ig(!e In")$ e" An#!i'# %i)4 E- i1"e: ). "un the @clipse...... ,. 9irst run of @clipse it will ask the default workplace% you must be mention the default workplace folder .. Ho to the Ielp && $nstall ew Software /. *lick Add button in install window to install Android !eveloper Tool 1. ame it as Android 3. Add Gocation as http-22dl&ssl.google.com2android2eclipse2 and do #J 5. After click #J% in the ne't popup bo' Select !eveloper Tools and click e't and accept license agreement and finish it 6. @clipse $!@ will gives you a warning message saying Your installation software that contains unsigned content ...... +ust #J and restart your @clipse $!@ 7. ow you need to give the Android S!J location to the popup which will be display when @clipse $!@ restart )8. (hen the @clipse $!@ starts there will be a con9igureuration popup which will ask the Android S!J location )). Select 4se e'isting S!J and then browse the Android S!J location and finish. ),. ow your Android development @nvironment is ready for development. Start your 9irst Android Application in @clipse Iello world Android @'ample STEPS ). C!e$)e An#!i'# P!'5e-) $n @clipse% select =9ile &M ew &M Bro+ectN.>% =Android Application Bro+ect>% and input your application detail like ame% Target etc. @clipse will create all the necessary Android pro+ect files then click ne't&&&&&& e't&&&&&& e't&&&&&&& e'tOfinish
SMS BLOCK 18

,. 0e ' /'! #

9igure ,.6- Sample Iello (orld Brogram .. O()1() Select Bro+ect&&&&&&&&&$n Menu Bro+ect&&&&&&&&&&&clean&&&&&&&&ok&&&&&&&&&&"ight *lick on Bro+ect&&&&&&&&&&"un&&&&&&&"un an Android Application

2.? APPLICATION STRUCTURE


Ginu' Jernel
The basic layer is the Ginu' kernel. The whole Android #S is built on top of the Ginu' ,.3 Jernel with some further architectural changes made by Hoogle. $t is this Ginu' that interacts with the hardware and contains all the essential hardware drivers. !rivers are programs that control and communicate with the hardware. 9or e'ample% consider the :luetooth function. All devices has a :luetooth hardware in it. Therefore the kernel must include a :luetooth driver to communicate with the :luetooth hardware. The Ginu' kernel also acts as an abstraction layer between the hardware and other software layers. Android uses the Ginu' for its entire core functionality such as Memory management% process management% networking% security settings etc.

SMS BLOCK

Lib!$!ie"
The ne't layer is the Android<s native libraries. $t is this layer that enables the device to handle different types of data. These libraries are written in c or cCC language and are specific for a particular hardware. Some of the important native libraries include the following

S(!2$-e M$n$ge!: $t is used for compositing window manager with off&screen buffering. #ff&screen buffering means you can<t 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.

Me#i$ 2!$*e%'!@: Media framework provides different media codec<s allowing the recording and playback of different media formats SALi)e: SKGite is the database engine used in android for data storage purposes /eb >i): $t is the browser engine used to display ITMG content O1enGL: 4sed to render ,! or .! graphics content to the screen

ANDROID RUNTIME
Android "untime consists of !alvik Firtual machine and *ore ?ava libraries.

D$ +i@ Vi!)($ M$-4ine $t is a type of ?FM used in android devices to run apps and is optimi0ed

for low processing power and low memory environments. 4nlike the ?FM% the !alvik Firtual Machine doesn<t run .class files% instead it runs .de' files. .de' files are built from .class file at the time of compilation and provideshifger efficiency in low resource environments. The !alvik FM allows multiple instance of Firtual machine to be created simultaneously providing security% isolation% memory management and threading support. $t is developed by !an :ornstein of Hoogle.

C'!e 3$+$ Lib!$!ie" These are different from ?ava S@ and ?ava M@ libraries. Iowever these libraries

provides of the functionalities defined in the ?ava S@ libraries.


SMS BLOCK 2!

,.1.) Application 9rame(ork


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 +ust consider these are some basic tools with which we are building our applications. $mportant blocks of Application framework are A-)i+i)& M$n$ge!- Manages the activity life cycle of applications C'n)en) P!'+i#e!"- Manage the data sharing between applications Te e14'n& M$n$ge!- Manages all voice calls. (e use telephony manager if we

want to access voice calls in our application. L'-$)i'n M$n$ge!- Gocation management% using HBS or cell tower Re"'(!-e M$n$ge!- 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 as1. SMS client app 2. !ialer 3. (eb browser 4. *ontact manager

As a developer we are able to write an app which replaces any e'isting 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.

2.B ANDROID USER INTERFACE COMPONENTS

SMS BLOCK

21

The following description gives an overview of the most important user interface related component and parts of an Android application. A-)i+i)&: An activity represents the visual representation of an Android application. activities use views% i.e. user interface widgets as for e'ample buttons and fragments to create the user interface and to interact with the user.

An An#!'i# $11 i-$)i'n -$n 4$+e "e+e!$ $-)i+i)ie".


F!$g*en)" 9ragments are components which run in the conte't of an activity. A fragment encapsulates application code so that it is easier to reuse it and to support different si0ed devices. 9ragments are optional components which allow you to reuse user interface and non user interface components for different devices configureurations. Vie%" $n# L$&'() M$n$ge! Fiews are user interface widgets% e.g. buttons or te't fields. The base class for all views is the android.view.Fiew class. Fiews have attributes which can be used to con9igureure their appearance and behavior. A layout manager is responsible for arranging other views. The base class for these layout managers is the android.view. FiewHroup class which e'tends the Fiew class. Gayout managers can be nestled to create comple' layouts. You should avoid nestling them to deeply too deeply as this has a negative impact on the performance. De+i-e C'n2ig(!e(!$)i'n S1e-i2i- L$&'()" The user interface for Activities is typically defined via PMG files (layout files). $t is possible to define defined layout file for different device con9igureuration% e.g. based on the available width of the actual device running the application. O)4e! An#!'i# C'*1'nen)" Android has several more components which can be used in your Android application.

In)en)"

SMS BLOCK

22

$ntents are asynchronous messages which allow the application to reEuest functionality from other Android components% e.g. from services or activities. An application can call a component directly (e'plicit $ntent) or ask the Android system to evaluate registered components based on the intent data (implicit intents). 9or e'ample 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. $ntents allow an Android application to start and to interact with components from other Android applications. Se!+i-e": 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. C'n)en) P!'+i#e! A content provider provides a structured interface to application data. Fia a content provider your application can share data with other applications. Android contains an SKGite database which is freEuently used in con+unction with a content provider. The SKGite database would store the data% which would be accessed via the content provider. B!'$#-$") Re-ei+e! :roadcast receivers can be registered to receive system messages and intents. A broadcast receiver gets notified by the Android system% if the specified event occurs. 9or e'ample 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.

0'*e "-!een $n# '-@ "-!een %i#ge)"


(idgets 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. 9or e'ample 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.

SMS BLOCK

23

2.= SALITE PROGRAMMING


/4$) i" SALi)e7
SKGite is an #pen Source !atabase which is embedded into Android. SKGite supports standard relational database features like SKG synta'% transactions and prepared statements. $n addition it reEuires only little memory at runtime (appro'. ,18 Jbytes). SKGite supports the data types T@PT (similar to String in ?ava)% $ T@H@" (similar to long in ?ava) and "@AG (similar to double in ?ava). All other types must be converted into one of these fields before saving them in the database. SKGite 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.

SALi)e in An#!'i#
SKGite is available on every Android device. 4sing a SKGite database in Android does not reEuire any database setup or administration. You only have to define the SKG statements for creating and updating the database. Afterwards the database is automatically managed for you by the Android platform. Access to an SKGite database involves accessing the file system. This can be slow. Therefore it is recommended to perform database operations asynchronously% for e'ample inside the AsyncTask class. $f your application creates a database% this database is by default saved in the directory !ATA2data2ABBQ AM@2databases29$G@ AM@. The parts of the above directory are constructed based on the following rules. !ATA is the path which the @nvironment.get!ata!irectory () method returns. ABBQ AM@ is your application name. 9$G@ AM@ is the name you specify in your application code for the database.

2.=.1 SALi)e A!-4i)e-)(!e

P$-@$ge" The package android database contains all general classes for working with

databases. Android.database.sElite contains the SKGite specific classes.

SMS BLOCK

24

SALi)eO1en0e 1e! To create and upgrade a database in your Android application you usually

subclass SKGite#penIelper. $n the constructor of your subclass you call the super( ) method of SKGite#penIelper% specifying the database name and the current database version. $n this class you need to override the on*reate( ) and on4pgrade( ) methods. on*reate( ) is called by the framework% if the database does not e'ists.on4pgrade( ) is called% if the database version is increased in your application code. This method allows you to update the database schema. :oth methods receive a SKGite!atabase ob+ect as parameter which represents the database. SKGite#penIelper provides the methods get"eadable!atabase( ) and get(riteable!atabase( ) to get access to a SKGite!atabase ob+ectA either in read or write mode. The database tables should use the identifier Qid for the primary key of the table. Several Android functions rely on this standard. $t is best practice to create a separate class per table. This class defines static on*reate( ) and on4pgrade() methods. These methods are called in the corresponding methods of SKGite#penIelper. This way your implementation of SKGite#penIelper will stay readable% even if you have several tables.

SALi)eD$)$b$"e

SKGite!atabase is the base class for working with a SKGite database in Android and provides methods to open% Euery% update and close the database. More specifically SKGite!atabase provides the insert( )% update( ) and delete( ) methods. $n addition it provides the e'ecSKG( ) method% which allows to e'ecute an SKG statement directly. The ob+ect *ontent Falues allows to define key2values. The LkeyL represents the table column identifier and the LvalueL represents the content for the table record in this column. *ontent Falues can be used for inserts and updates of database entries. Kueries can be created via the rawKuery( ) and Euery( ) methods or via the SKGiteKuery:uilder class. rawKuery() directly accepts an SKG select statement as input. Euery() provides a structured interface for specifying the SKG Euery. SKGiteKuery:uilder is a convenience class that helps to build SKG Eueries.
SMS BLOCK 25

3. S9STEM ANAL9SIS
4nderstanding the properties and reEuirements of a new system is more difficult and reEuires creative thinking and understanding of e'isting running system is also difficult% improper understanding of present system can lead diversion from solution.

3.1 SECTION OVERVIE/


After analy0ing the reEuirements of the task to be performed% the ne't step is to analy0e the problem and understand its conte't. The first activity in the phase is studying the e'isting system and other is to understand the reEuirements and domain of the new system. :oth the activities are eEually important% but the first activity serves as a basis of giving the functional specifications and then successful design of the proposed system. 4nderstanding the properties and reEuirements of a new system is more difficult and reEuires creative thinking and understanding of e'isting running system is also difficult% improper understanding of present system can lead diversion from solution. The activities are eEually important% but the first activity serves as a basis of giving the functional specifications and then successful design of the proposed system.

3.2 E8ISTING S9STEM


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

F(n-)i'n$ i)ie" '2 e,i")ing "&")e*:


$f the user enables the SMS blocking then the message is blocked. (hen a user receives a message% he gets a notification that his message is being blocked. $t<s up to the user to enable or disable the SMS blocking.

Di"$#+$n)$ge":
There is no automatic blocking. $t intimates the user that his messsage is being blocked.

SMS BLOCK

26

3.3 PROBLEM STATEMENT


The SMS :lock is playing a vital role in case of user wants a particular phno message is to be blocked. @ven 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 :ut there is no system that provides SMS blocking without any notification to the user.

3.. PROPOSED S9STEM


:y considering the problems in the e'isting system we need to develop the new blocked system providing the user different interface. The pro+ect aims in implementing a system that does it provide user% which is not provide any notifications to the users that it is blocked.

F(n-)i'n$ i)ie" '2 1!'1'"e# "&")e*:


Application runs hidden in Android phone. Application start automatically when phone start. :lock the message of particular user number which is activated in SMS :lock% when mobile receives a SMS R the blocked message has e'tension of file name(.t't) The blocked message is automatically delete from memory.

A#+$n)$ge":
The user doesn<t get any notification. The output file format is supported in all mobiles.

SMS BLOCK

27

SMS BLOCK

28

*. S9STEM

DESIGN

..1 S9STEM 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. !esign is the first step in the development phase for any engineered product or system. The designer<s goal is to produce a model or representation of an entity that will later be built. :eginning% once system reEuirement have been specified and analy0ed% system design is the first of the three technical activities &design% code and test that is reEuired to build and verify software. The importance can be stated with a single word =Kuality>. !esign is the place where Euality is fostered in software development. !esign provides us with representations of software that can assess for Euality. !esign is the only way that we can accurately translate a customer<s view into a finished software product or system. Software design serves as a foundation for all the software engineering steps that follow. (ithout a strong design we risk building an unstable system D one that will be difficult to test% one whose Euality cannot be assessed until the last stage.

..2. S9STEM COMPONENTS


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

..2.1 M'#( e" In+' +e#


4ser $nterface Module- :y using this module we can design the screen according to your reEuirements. Set up :uttons Module- This module used to create buttons and provide actions based on ids.Set up !atabase Module- :y using this module we can store name of contact and number of contact. :lock SMS Module- This module is used to block SMS using contact numbers.

SMS BLOCK

4 :lock SMS Module- $t is used to delete contact numbers from block&list.

..3 UNIFIED MODELLING LANGUAGE DIAGRAMS


The 4nified Modeling Ganguage allows the software engineer to e'press an analysis model using the modeling notation that is governed by a set of syntactic semantic and pragmatic rules. A 4MG system is represented using five different views that describe the system from distinctly different perspective. @ach view is defined by a set of diagram% which is as follows.

U"e! M'#e Vie%: This view represents the system from the users perspective. The analysis representation describes a usage scenario from the end&users perspective.

S)!(-)(!$ *'#e +ie%: $n this model the data and functionality are arrived from inside the system. This model view models the static structures.

Be4$+i'! M'#e Vie%: $t 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. I*1 e*en)$)i'n M'#e Vie%: $n this the structural and behavioral as parts of the system are represented as they

are to be built

En+i!'n*en)$ M'#e Vie%: $n this the structural and behavioral aspects of the environment in which the system is to be implemented are represented 4se case !iagrams represent the functionality of the system from a user<s point of view. 4se cases are used during reEuirements elicitation and analysis to represent the functionality of the system. 4se cases focus on the behavior of the system from e'ternal point of view. Actors aree'ternal entities that interact with the system. @'amples of actors include users like administrator% bank customer Netc.% or another system like central database.

SMS BLOCK

3!

..3.1.C $"" Di$g!$*

9igure /.) *lass !iagram for SMS :lock

SMS BLOCK

31

..3.2 U"e -$"e Di$g!$*

9igure /., 4se *ase !iagram for SMS :lock

SMS BLOCK

32

..3.3 SeC(en-e Di$g!$*

9igure /.. SeEuence !iagram for SMS :lock

SMS BLOCK

33

..3.. C' $b'!$)i'n Di$g!$*D

9igure /./ *ollaboration !iagram for SMS :lock

SMS BLOCK

34

SMS BLOCK

35

?. S9STEM REAUIRMENTS SPECIFICATION


"eEuirements Specification plays an important role in creating Euality software solutions. Specification is basically a representation process. "eEuirements are represented in a manner that ultimately leads to successful software implementation. @ach reEuirement must be consistent with the overall ob+ective. The development of this pro+ect deals with the following reEuirement.

Iardware reEuirement Software reEuirements

?.1 SOFT/ARE REAUIRMENTS


The software reEuirements 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 reEuirements and design constraints% appropriate validation criteria and other data pertinent to reEuirements. Table- 1.) Software "eEuirements
C'n)en) #S !atabase Technologies Software De"-!i1)i'n Android%linu'2windows'p25 SKGite *ore ?ava% Android Adt&plugin

SMS BLOCK

36

Brocessor "AM !evice

B&$F with , HI0 )H: (minimum) Android compatible Iandset

?.2 0ARD/ARE REAUIREMENTS:


The selection of hardware is very important in the e'istence and proper working of any software. $n the selection of hardware% the si0e and the capacity reEuirements are also important. Table- 1., Iardware "eEuirements

SMS BLOCK

37

SMS BLOCK

38

SMS BLOCK

B. IMPLEMENTATION
$mplementation 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.

B.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.

*larity and simplicity of the code. Minimi0ation of hard coding. Minimi0ation of amount of memory used. Through phased implementation we can use our proposed system.

B.2 SAMPLE CODE


SMS RECEIVER:
packagecom.e'ample.sbtiA import+ava.util.GistA importandroid.annotation.SuppressGintA importandroid.content.:roadcast"eceiverA importandroid.content.*onte'tA importandroid.content.$ntentA importandroid.os.:undleA importandroid.telephony.SmsMessageA importandroid.widget.ToastA public class Sms"eceiver e'tends :roadcast"eceiver S
SMS BLOCK 4!

22 String specificBhone umber T L)1111,)1113LA !:AdapterdbA public String TAH T LSms"eceiverLA private static final String A*T$# T Landroid.provider.Telephony.S@ !QSMSLA public static int MSHQTB@T8A USuppressGint(L ewApiL) public void on"eceive(*onte't conte't% $ntent intent) S System.out.println(Lon recive) methodL)A db Tnew !:Adapter(conte't)A System.out.println(Lafter dbL)A String [email protected]()A if([email protected](Landroid.provider.Telephony.SMSQ"@*@$F@!L)) S System.out.println(Lif blackL)A 22 22 Toast toast T Toast.makeTe't(conte't%LSMS "eceived- LCMSHQTYB@ % toast.show()A :undle bundle T intent.get@'tras()A #b+ect messagesVW T (#b+ectVW) bundle.get(LpdusL)A SmsMessagesmsMessageVW T new SmsMessageVmessages.lengthWA for (int n T 8A n Xmessages.lengthA nCC) S System.out.println(Lfor loopL)A smsMessageVnW T SmsMessage.create9romBdu((byteVW) messagesVnW)A Y System.out.println(Louter for loopL)A String ph umTsmsMessageV8W.get#riginatingAddress()A System.out.println(Lphonenumber is --LCph um)A
SMS BLOCK 41

Toast.G@ HTIQG# H)A

ph umTph um.substring(5)A 22 ph umTph um.substring(ph um.length()&)8)A22for testing in real mobile device System.out.println(Lph um -- LCph um)A GistXStringMspecificBhone umber T db.getMessage)()A System.out.println(Lblocked number issssssssssLCspecificBhone umber)A intarunaT8A for(intiT8AiXspecificBhone umber.si0e()AiCC) S if (specificBhone umber.get(i).eEuals(ph um)) S arunaT)A Y Y if (arunaTT)) S 22 show first message Toast toast T Toast.makeTe't(conte't%L:G#*J@! "eceived SMS- L C smsMessageV8W.getMessage:ody()% Toast.G@ HTIQG# H)A toast.show()A abort:roadcast()A for(intiT8AiX6AiCC) S System.out.println(L:locking SMS ZZZZZZZZZZZZZZZZZZZZZZL)A Y Y else if([email protected](Landroid.provider.Telephony.S@ !QSMSL)) S Toast toast T Toast.makeTe't(conte't%LSMS S@ T- LCMSHQTYB@ % Toast.G@ HTIQG# H)A
SMS BLOCK 42

toast.show()A abort:roadcast()A for(intiT8AiX6AiCC) S System.out.println(L:locking SMS ZZZZZZZZZZZZZZZZZZZZZZL)A Y Y else S Toast toast T Toast.makeTe't(conte't%LS$ @GS@- LCMSHQTYB@ % Toast.G@ HTIQG# H)A toast.show()A 22 abort:roadcast()A for(intiT8AiX6AiCC) S System.out.println(L:locking SMS ZZZZZZZZZZZZZZZZZZZZZZL)A Y Y Y Y Y

SMS BLOCK

43

SMS BLOC> DAO:


packagecom.e'ample.sbtiA public class smsblock!ao S 22private variables int QidA String QnameA String QnumberA 22 @mpty constructor publicsmsblock!ao()S Y 22 constructor publicsmsblock!ao(int id% String name% String number)S this.Qid T idA this.Qname T nameA this.Qnumber T numberA Y 22 constructor publicsmsblock!ao(String name% String number)S this.Qname T nameA this.Qnumber T numberA Y 22 getting $! publicintget$!()S returnthis.QidA Y 22 setting id public void set$!(int id)S this.Qid T idA Y public String getQname() S
SMS BLOCK 44

return QnameA Y public void setQname(String Qname) S this.Qname T QnameA Y public String getQnumber() S return QnumberA Y Y Y public void setQnumber(String Qnumber) S this.Qnumber T QnumberA

SMS BLOC> ACTIVIT9:


packagecom.e'ample.sbtiA importandroid.app.ActivityA importandroid.os.:undleA importandroid.view.FiewA importandroid.view.Fiew.#n*lickGistenerA importandroid.widget.:uttonA importandroid.widget.@ditTe'tA public class Sms:lockActivity e'tends Activity implements #n*lickGistener S :utton b)%b,A @ditTe't e)%e,A !:AdapterdbTnew !:Adapter(this)A U#verride protected void on*reate(:undle saved$nstanceState) S 22 T#!# Auto&generated method stub super.on*reate(saved$nstanceState)A set*ontentFiew(".layout.smsblock)A
SMS BLOCK 45

b)T(:utton)findFiew:y$d(".id.button))A b,T(:utton)findFiew:y$d(".id.button,)A e)T(@ditTe't)findFiew:y$d(".id.editTe't))A e,T(@ditTe't)findFiew:y$d(".id.editTe't,)A b).set#n*lickGistener(this)A b,.set#n*lickGistener(this)A Y U#verride public void on*lick(Fiew v) S 22 T#!# Auto&generated method stub switch (v.get$d()) S case ".id.button)String strTe).getTe't().toString()A String str)Te,.getTe't().toString()A db.addmessage(str%str))A breakA case ".id.button,finish()A breakA defaultbreakA Y Y

SMS BLOCK

46

MAIN SCREEN ACTIVIT9:


packagecom.e'ample.sbtiA importandroid.app.ActivityA importandroid.content.$ntentA importandroid.os.:undleA importandroid.view.FiewA importandroid.view.Fiew.#n*lickGistenerA importandroid.widget.:uttonA importandroid.widget.@ditTe'tA public class MainScreenActivity e'tends Activity implements #n*lickGistener S :utton b)A U#verride protected void on*reate(:undle saved$nstanceState) S 22 T#!# Auto&generated method stub super.on*reate(saved$nstanceState)A set*ontentFiew(".layout.mainQscreenactivity)A b)T(:utton)findFiew:y$d(".id.button))A b).set#n*lickGistener(this)A Y U#verride public void on*lick(Fiew v) S 22 T#!# Auto&generated method stub switch (v.get$d()) S case ".id.button)$ntent i,Tnew $ntent(MainScreenActivity.this% Sms:lockActivity.class)A startActivity(i,)A breakA defaultbreakA

SMS BLOCK

47

SMS BLOCK

48

=. S9STEM TESTING
Testing is one of the most important phases in the software development activity. $n software development life cycle (S!G*)% the main aim of testing process is the EualityA the developed software is tested against attaining the reEuired functionality and performance.

=.1 SECTION OVERVIE/


!uring the testing process the software is worked with some particular test cases and the output of the test cases are analy0ed whether the software is working according to the e'pectations 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 e'pected behavior of the system and method of determining whether the observed behavior confirmed to the e'pected behavior.

=.2 LEVELS OF TESTING


Since the errors in the software can be in+ured at any stage. So% we have to carry out the testing process at different levels during the development. The basic levels of testing are 4nit% $ntegration% System and Acceptance Testing. The 4nit Testing is carried out on coding. Iere different modules are tested against the specifications produced during design for the modules. $n case of integration testing different tested modules are combined into sub systems and tested in case of the system testing the full software is tested and in the ne't level of testing the system is tested with user reEuirement document prepared during S"S.

F(n-)i'n$ Te")ing $n 9unctional Testing test cases are decided solely on the basis of reEuirements 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 :lack :o' Testing.

SMS BLOCK

S)!(-)(!$ Te")ing $n Structural Testing test cases are generated on actual code of the program or

module to be tested. This is called (hite :o' Testing.

=.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. 9or each unit specified in the plan first the test cases and reports are produced. These reports are analy0ed. Te") P $n Test plan is a general document for entire pro+ect% which defines the scope% approach to be taken and the personal responsible for different activities of testing. The inputs for forming test plans are Bro+ect plan "eEuirements document System design

Te") C$"e S1e-i2i-$)i'n Although there is one test plan for entire pro+ect 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 e'pected for those test cases. Te") C$"e E,e-()i'n $n# An$ &"i" The steps to be performed for e'ecuting the test cases are specified in separate document called procedure specification. This document specify any reEuirements that e'ist for setting the test environment and describes the methods and formats for reporting the results of testing.

SMS BLOCK

5!

Uni) Te")ing 4nit testing mainly focused first in the smallest and low level modules% proceeding one at a time. :ottom&up testing was performed on each module. As developing a driver program% that tests modules by developed or used. :ut for the purpose of testing% modules themselves were used as stubs. After the lower level modules were tested% the modules that in the ne't higher level those make use of the lower modules were tested. @ach module was tested against reEuired functionally and test cases were developed to test the boundary values. In)eg!$)ing Te")ing $ntegration testing is a systematic techniEue 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. :ottom&up approach integration strategy was implemented with the following steps.

Gow level modules were combined into clusters that perform specific software functions

S&")e* Te")ing System testing is a series of different tests whose primary purpose is to fully e'ercise the computer&based system. $t also tests to find discrepancies between the system and its original ob+ective% current specifications

SMS BLOCK

51

Table 5.) Test *ase for receiving SMS Test *ase[-) Test #b+ective- To check receiving a SMS Test !escription- SMS is checked "eEuirements Ferified- 4ser have verified message received in inbo' Test @nvironments- Android @mulator Test setup- user initiates any control mechanism like Msg sending Actions SMS Sending SMS receiving Bass- Yes *onditional pass9ail4ser need to check the inbo'. SMS received. @'pected "esults 4ser need to enter the te't SMS. Actual "esults SMS sent. Briority (I% G)- Iigh

=..

TEST CASES

SMS BLOCK

52

Test *ase[-,

Briority (I% G)- Iigh

Test #b+ective- To *heck the blocked SMS Test !escription- enter number % .t't e'tension "eEuirements Ferified- Bhno% message type Test @nvironments- Android *ompatable Iandset Test setup- SMS block need to be activated and check the inbo' of phone memory Actions Bhno blocked SMS The SMS need to be saved with .t't e'tension and .t't Bass- Yes need to be portable in any device *onditional pass9ailTable 5., Test *ase for blocked SMS The message is blocked with .t't e'tension and portable in all the machines. and @'pected "esults umber of the message not received Actual "esults Message :locked with correct no.

=.? DISCUSSION OF RESULTS

SMS BLOCK

53

9igure 5.) SMS :lock application ). The above screen shows us the SMS block application. ,. $t consists of SMS block .apk file which should be installed for application to run

SMS BLOCK

54

9igure 5., Ferifying the application


1. The above screen shows us the verifying process of the application. 2. $t consists of a package installer and verify and install for SMS block application

to get installed.

SMS BLOCK

55

9igure 5.. "eEuesting to install application


1. The above screen shows us the reEuest for installing application. 2. The above options need to be selected for installing the app.

SMS BLOCK

56

9igure 5./ Application installed


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

SMS BLOCK

57

9igure 5.1 Application overview


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

SMS BLOCK

58

9igure 5.3 @ntries fields


1. The above screen shows the entry fields in the application. 2. $t consists of one entry field for name and one entry field for number.

SMS BLOCK

9igure 5.5 @nter 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 e'ecution of application.

SMS BLOCK

6!

9igure 5.6 "eceiving the sample message


1. The above screen shows us a sample message received.

SMS BLOCK

61

9igure 5.7 SMS :locked


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

SMS BLOCK

62

SMS BLOCK

63

;. CONCLUSION AND FUTURE EN0ANCEMENTS


;.1 CONCLUSION
The SMS blocking system is an application developed as a special application and a uniEue feature that can be utili0able on mobile devices% with which the user feels comfortable :ecause 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.

;.2 FUTURE EN0ANCEMENTS


As it is developed on A "#$! 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 his2her reEuirements and as A !"#$! is based on ?AFA 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

64

E. REFERENCES
3$+$ Te-4n' 'gie"
?AFA *omplete "eference ?ava Script Brogramming by Yehuda Shiran

An#!'i# Te-4n' 'g&


http-22developer.android.com http-22www.vogella.com http-22android.programmerguru.com

SMS BLOCK

65

You might also like