You are on page 1of 52

Final Project Report

Calls and Message blocker

MCS 4th (Evening)


Session 2012-2014
Submitted By:
Sajjad Hussain IUB 1272404
Syes Yasir Hussain IUB 1272437

Department Of Computer Science Bahawalnagar Campus

FINAL APPROVAL

It is to certify that we have gone through this Final Project report that is submitted by
Sajjad Hussain And Syed Yasir Hussainof MCS(Evening) Session 2012-14 of their
final project titled as Calls and message blocker of Department of Computer Science,
The Islamia University of Bahawalpur to fulfill the partial requirement for the award of
the degree of Masters in Computer Science (MCS).

PANEL OF EXAMINERS:
Internal Examiner:
Mr. Omer Ajmal
Lecturer,
Department of Computer Science
The Islamia University of Bahawalpur
Bahawalnagar Campus

_________________

External Examiner:

_________________

Mr.Muhammad Ateeq
Assistant Professor
Department of Computer Science
The Islamia University of Bahawalpur

Head of Department:
Mr. Suleman
Department of Computer Science
The Islamia University of Bahawalpur
Bahawalnagar Campus

_________________

All Praised Are For my

ALLA
H
ALMI
GHTY

The most beneficent, who guides us in the darkness and helps in


difficulties,
Without this help one can never achieve destination.
All Respects Are For His

HOLLY PROPHET HAZRAT


MUHAMMAD (P.B.U.H]
Who enlighten out the minds to recognize our creature.

DEDICATION

We dedicate this project to our respected teachers at Islamia University


Bahawalpur (Bahawalnager Campus) who taught us the skills and techniques
of every course very proficiently throughout our MCS degree. They provided
us all the knowledge, which is very important and useful for the success of
professional and personal life.

ACKNOWLEDGMENT
Up and above everything, we are grateful almighty ALLAH, The beneficent, the
merciful, and his Holy Prophet Hazarat MUHAMMAD (peace be upon him) who is
forever true light of guidance for whole humanity. We are greatly obliged ALLAH by
whom grace we have been able to complete this project successfully.
We feel much obliged to our families, whom prayers and good wishes have enabled us
to reached at this stage.
Our success is the result of the Technical Guidance, invaluable comments and moral
support of our supervisor Sir Omer efforts and for the students are not only for projects
but also throughout the session. We are very thankful to him for talking such a pain
for us. We extend our thanks to all our teachers from whom we have learnt a lot
during the session and their nice behavior and attitude is always encouraging us for
learning.
Sajjad Hussain And Syed Yasir Hussain

Date:
November 5, 2015

Sr.No
1

Table of Content

Page

INTRODUCTION................chapter..............................01

10

1.1 Statement of the Problem

10

1.1.1 Why your app name or what u r developing

11

1.2 Objectives and Motivation for the project

12

1.3 Tools Used

13

Tool Selection.................chapter...............................02

20

Introduction of your technology which u r using like Android/WP


or whatever you are using

21

S/W requirement specification chapter.........03

27

3.1 S/W requirements

27

3.2 how many same apps u visited

28

3.3 Use cases

32

3.4 Activity Diagram

42

Design .chapter..04

48

4.1 Architectural Design

48

4.2 Architecture Layer

49

4.4.1 Client Module

72

Testing .chapter05

73

5.1 Test Cases

75

Introduction:

chepter 01

Calls and Messages blocker:


1.Statement of the problem:
The main issue of the call blocker application is that we cannot block
the messages in a proper way. The one more drawback of the call
blocker application is that we cannot block the unknown numbers or
that numbers which are not exist in our contact book.

2.

Why:
Calls and Messages blocker.

3.

Objectives
The main objective of this project is to block the Calls and messages.
Application will block the unwanted numbers from list and unsaved
contacts.
This application will block the numbers more efficiently and more
improved than previous one.

4.Need or Motivation

When our 4th semester was ended my first think to make project in
android. I had used the android cell phone with different apps. The one
of them was call blocking. But all of them could not fulfill my
requirements and then I was kept thinking about making the
application of call and message block.

Introduction to Android: chepter 02


Android provides a rich application framework that allows you to build innovative apps and
games for mobile devices in a Java language environment. The documents listed in the left
navigation provide details about how to build apps using Android's various APIs.
Apps adapt to different devices
Android provides an adaptive app framework that allows you to provide unique resources for
different device configurations. For example, you can create different XML layout files for
different screen sizes and the system determines which layout to apply based on the current
device's screen size.
You can query the availability of device features at runtime if any app features require specific
hardware such as a camera. If necessary, you can also declare features your app requires so app
markets such as Google Play Store do not allow installation on devices that do not support that
feature.

Software Requirement
specifications
The purpose behind the SRS documents is to describe the recourses
and their management used in the design of Call and Message blocker
.this SRS further provides details about the Call and messages
blocker.

Software Requirements.
Sr.
1
2
3
4
5
6
7
8
9
10
11
12
13

Description
System shall provide friendly user interface on application
System shall provide facility to user to visit the application
System shall provide facility to user to check the all numbers
System shall provide facility to user to receive messages to any numbers
System shall provide facility block the numbers that is specified
System shall provide facility to user to see the block list
System shall provide facility to receive calls
System shall provide facility to update database
System shall provide facility to user to block the messages
System shall provide facility to user to provide to show the blocked messages
System shall provide facility to user to provide call history
System shall provide facility to user to clear the call history
System shall provide facility to user the clear the all blocked messages

14
15
16
17
18
19

System shall the provide facility to user the delete the blocked number from the list
System shall provide facility to user block the unsaved contacts
System shall provide facility to user to provide the facility to block all calls
System shall provide facility to user provide the interests of user
System shall provide facility to user to provide the entertainment of user
System shall provide the facility to developer to maintain the application

How many application you visited


I have visited 10 kinds of application of call and messages blocker.

Use cases
1.Blocker(block numbers)
2.Main
Activity(Select
Radio
buttons,Add
numbers,Call Log,Show List,Messages)
3.List Activity(shows the numbers)
4.Manage messages(Select Radio Buttons,show
Messages)
5.Messages blocker(block the messages)
6.Number List(add the numbers)
7.Remainder
Database
Adapter(save
numbers,retrieve numbers)
8.Call Log(show the all call log)
USAGE SCENARIOS (USE CASES) OF calls
Actors:-Users.

and Message blocker:

Use case Diagram

Blocker

Main Activity

List Activity

Manage messages

Number list

Remainder database

Message blocker
User
Sys
Call log

2.5 Detail of use cases:

Use case ID:

01

Use case name:

Blocker

Use case Description:

this use-case will describe the how to block the calls according to

the given instruction.

Actor (s): System.

Precondition: System must be in ready state to receive the calls and give the response.

Primary scenario:
1)
2)
3)
4)

Receive the call


Go to the blocker activity
Checking the number
Block the number if condition is true.

System responses & Exceptions:


1. R.1. System will display the main interface
1. R.4. System will display the notification to block the number

Post Condition:
1) The system will display the notification if the number is match to the blocking number

Use case ID:

02

Use case name:

Main Activity

Use case Description:

this use case describes the process of how to add delete the
number that is to be blocked, show the block list, show the message settings, show the call log
and radio buttons to select the condition.
Actor (s): User

Precondition: Users must have successfully controls the function.

Primary scenario:
1) User click on the add number button
2) User add the number that is to be blocked
3) User click and add the number

System responses & Exceptions:


1. R.1. System display main Activity to select the contents
1. E.2. System will display an error message if the user does not enter the correct
number.

Post Condition:
1) A radio button describe the condition that the user desire.
2) System will show the message after adding the correct number.
3) System will response the given condition after clicked ant for buttons

Use case ID:

03

Use case name:

List Activity

Use case Description:

this use case shows the all numbers that are to be blocked. User

can delete the number.

Actor (s): User,System

Precondition: the number must be correct enter in the data base and then this use case will
call the data base.

Primary scenario:
4)
5)
6)
7)

User click on show Button


User click the number and show the serial number
User click on the number and display the menu
User click the delete Button to delete the number

System responses & Exceptions:


1. R.1. System display a layout to show the all numbers

Post Condition:
4) System display the numbers that are saved in data base.
5) User can delete the number
6) User can find the serial number that is saved in data base.

Use case ID:

04

Use case name:

Manage Messages

Use case Description:

this use case describes the message blocking section through


radio buttons. User can show the blocked messages and can delete the blocked messages

Actor (s): user, System.

Precondition: Users must select the radio button to take the response from system.

Primary scenario:
8) User must click on any radio button
9) User click the button to show the blocked message
10) User click on the delete button to delete the blocked messages

System responses & Exceptions:


1. R.1. System display a layout that is consists radio buttons and show messages button
1. E.2. System will display an error if the activity is open and a message is received
from blocked number.

Post Condition:
7) System will show the toast that is show the message that the number is blocked
8) System will show the toast to add the message in data base.
9) User can display the blocked messages and delete the blocked messages.

Use case ID:

05

Use case name:

Number list

Use case Description:

this use case has textbox to add the number that is to be blocked
and button to add the number into data base.

Actor (s):

User

Precondition: User must successful enter the add number


Primary scenario:
11) User click on the add number button
12) User enter the number in textbox
13) User click the add button to add the number in database.

System responses & Exceptions:


1. R.1. System will display a textbox and add button
1. E.2. System will display an error message if the number is not correct.

Post Condition:
10) System show the textbox and add button
11) System show the toast if the number is correctly add to the database.

Use case ID:

06

Use case name:

Remainder Database

Use case Description:

this use case save the number show, and delete the number from

database.

Actor (s): System:

Precondition: Users must have successfully add the numbers.

Primary scenario:
14) User click on the add number button to add the number
15) User click on the show button to show the numbers
16) User click on the delete menu to delete the number

System responses & Exceptions:


1. R.1. System display a layout to show the numbers
1. E.2. System will display an error message if the number is not correct.

Use case ID:

07

Use case name:

Message blocker

Use case Description:

this use case describes the process of message blocking.

Actor (s): System.


Precondition:

User must have successfully selected the radio button to execute the

scenario.

Primary scenario:
17) User click radio button
18) User select some radio button
19) Messages block according to the condition.

System responses & Exceptions:


1. R.1. System displays a toast if any message is received. And block the messages.
2. E.2. System will display an error message if the user shows the messages.

Post Condition:
12) System displays the toast if any message is received.
13) System does not give the permission to message to divert into the inbox if that message is
to be blocked.

Use case ID: 08


Use case name:

Call log

Use case Description:

this use case shows the call history time, date, call duration, call
type, and user can clear the call history.

Actor (s):

User

Precondition: System must have some call detail before.

Primary scenario:
20) User click on the call log button
21) System shows the all call detail.
22) User click on the clear menu to clear the call log.
23)

System responses & Exceptions:


1. R.1. System displays a layout.
1. E.2. System will display an error message if call detail does not exist.

Post Condition:
14) System displays the layout to show the numbers
15) Now the user can display the numbers and user can clear the call log.

CHAPTER: 3

DESIGN

3.1 System Design:


System design is the process of defining the architecture, components, modules,
interfaces, and data for a system to satisfy specified requirements.

3.1.1 Architectural Design:


3.1.1.1 Hardware Specifications:

Processor Name:

Dual Core

Processor Speed:

3.2 GHz

RAM:

2 GB

Hard Disk Capacity:

320 GB

Display Device:

14 Inch Monitor

Keyboard Type:

PS2 or USB

Mouse Type:

PS2 or USB

3.1.1.2 Software Specifications:


3.1.1.3 for Application:

Technology Implemented:

Java

Language Used:

Android

Database:

SQLite

User Interface Design:

XML

platform:

eclips

3.1.1.4 for Software Product:

Operating System:

Android jelly beans.

Programming Language:

Android

Software:

eclips

3.2 User Interface Design:


User Interface Design is concerned with how users add information to the system and
with how the system presents information back to them.

Main Activity.

Number adding page.

Call Log page.

Number show.

Managing messages page.

Show messages.

4.2.2 Core Business Logic layer


Call blocker Activity.
import java.lang.reflect.Method;
import com.android.internal.telephony.ITelephony;
import android.net.Uri;
import android.os.Bundle;
import android.provider.BaseColumns;
import android.provider.ContactsContract;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.telephony.TelephonyManager;
import android.view.Menu;
import android.widget.Toast;
public class Blocker extends BroadcastReceiver {

private static final int MODE_WORLD_READABLE = 1;


private ITelephony telephonyService;
private String incommingNumber;
private String incommingName=null;
private SharedPreferences myPrefs;
@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
myPrefs = context.getSharedPreferences("myPrefs",
MODE_WORLD_READABLE);
String blockingMode=myPrefs.getString("mode", "not retrieved");

if(!blockingMode.equals("cancel"))
{
Bundle bb = intent.getExtras();
String state = bb.getString(TelephonyManager.EXTRA_STATE);
if ((state != null)&&
(state.equalsIgnoreCase(TelephonyManager.EXTRA_STATE_RINGING)))
{
incommingNumber =
bb.getString(TelephonyManager.EXTRA_INCOMING_NUMBER);
if(blockingMode.equals("all"))
{
blockCall(context, bb);
//for notification
incommingName=getContactDisplayNameByNumber(incommingNumber, context);
Intent nn = new Intent(context, Call_log.class);
PendingIntent pi = PendingIntent.getActivity(context, 0, nn, 0);
Notification notify = new Notification.Builder(context)
.setTicker(incommingName+" has been blocked")
.setContentTitle("Blocking number is.")
.setContentText(incommingName+":-"+incommingNumber)
.setSmallIcon(R.drawable.icon_block)
.setContentIntent(pi.getActivity(context, 0, nn,
0)).setAutoCancel(true).build();
notify.flags=Notification.FLAG_AUTO_CANCEL;
NotificationManager notifiM = (NotificationManager)
context.getSystemService(context.NOTIFICATION_SERVICE);
notifiM.notify(0, notify);

}
else if(blockingMode.equals("unsaved"))
{
incommingName=getContactDisplayNameByNumber(incommingNumber,
context);
if((incommingName==null)||(incommingName.length()<=1)){
blockCall(context, bb);
//for notification
Intent nn1 = new Intent(context, Call_log.class);

PendingIntent pi = PendingIntent.getActivity(context, 0,
nn1, 0);
Notification notify = new Notification.Builder(context)
.setTicker(incommingNumber+" This number has been
blocked")
.setContentTitle("Blocking number is.")
.setContentText(incommingNumber)
.setSmallIcon(R.drawable.icon_block)
.setContentIntent(pi.getActivity(context, 0, nn1,
0)).setAutoCancel(true).build();
notify.flags=Notification.FLAG_AUTO_CANCEL;
NotificationManager notifiM = (NotificationManager)
context.getSystemService(context.NOTIFICATION_SERVICE);
notifiM.notify(0, notify);

}
}
else if(blockingMode.equals("list"))
{
RemindersDbAdapter mDbAdapter=new RemindersDbAdapter(context);
mDbAdapter.open();
Cursor c= mDbAdapter.fetchAllReminders();
if(c.moveToFirst())
{
while (c.isAfterLast() == false) {
String
title=
c.getString(c.getColumnIndex(RemindersDbAdapter.KEY_TITLE));
if(title.equals(incommingNumber))
{
blockCall(context, bb);
//for notification
incommingName=getContactDisplayNameByNumber(incommingNumber, context);
Intent nn2 = new Intent(context, Call_log.class);
PendingIntent pi =
PendingIntent.getActivity(context, 0, nn2, 0);

Notification notify = new


Notification.Builder(context)
.setTicker(incommingName+" has
been blocked")
.setContentTitle("Blocking number
is.")
.setContentText(incommingName+":
-"+incommingNumber)
.setSmallIcon(R.drawable.icon_bloc
k)
.setContentIntent(pi.getActivity(cont
ext, 0, nn2, 0)).setAutoCancel(true).build();
notify.flags=Notification.FLAG_AUTO_CANCEL;
NotificationManager notifiM =
(NotificationManager) context.getSystemService(context.NOTIFICATION_SERVICE);
notifiM.notify(0, notify);

}
c.moveToNext();
}
}
c.close();
mDbAdapter.close();
}
else
{
}
}
}
}
public void blockCall(Context c, Bundle b)
{

TelephonyManager telephony = (TelephonyManager)


c.getSystemService(Context.TELEPHONY_SERVICE);

try {
Class cls = Class.forName(telephony.getClass().getName());
Method m = cls.getDeclaredMethod("getITelephony");
m.setAccessible(true);
telephonyService = (ITelephony) m.invoke(telephony);
//telephonyService.silenceRinger();
telephonyService.endCall();
} catch (Exception e) {
e.printStackTrace();
}
}

public String getContactDisplayNameByNumber(String number, Context c) {


Uri uri =
Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI,
Uri.encode(number));
String name = "?";
String data=null;
ContentResolver contentResolver =c.getContentResolver();
Cursor contactLookup = contentResolver.query(uri, new String[] {BaseColumns._ID,
ContactsContract.PhoneLookup.DISPLAY_NAME }, null, null, null);
try {
if (contactLookup != null && contactLookup.getCount() > 0) {
contactLookup.moveToNext();
data =
contactLookup.getString(contactLookup.getColumnIndex(ContactsContract.Data.DISPLAY_NA
ME));
//String contactId =
contactLookup.getString(contactLookup.getColumnIndex(BaseColumns._ID));
}
} finally {
if (contactLookup != null) {
contactLookup.close();
}
}
return data;
}

Main Activity.
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//

///////////////////////////////////
myPrefs = this.getSharedPreferences("myPrefs", MODE_WORLD_READABLE);
editor=myPrefs.edit();
RadioGroup radiogroup = (RadioGroup) findViewById(R.id.radGroup1);
radiogroup.setOnCheckedChangeListener(this);
// radio button setting
allBlock=(RadioButton) findViewById(R.id.blockAll);
unSaved=(RadioButton) findViewById(R.id.blockUnsaved);
fromList=(RadioButton) findViewById(R.id.blockFromList);
cancelAll=(RadioButton) findViewById(R.id.cancelBlocker);
setDefaultButtonChecked();
// add and show button controls
btnAddNumber=(Button) findViewById(R.id.btnAdd);
btnShowList=(Button) findViewById(R.id.btnShow);
showLog = (Button) findViewById(R.id.call_log);
msgs = (Button) findViewById(R.id.msg_activity);
btnAddNumber.setOnClickListener(this);
btnShowList.setOnClickListener(this);
showLog.setOnClickListener(this);
msgs.setOnClickListener(this);
}
private void setDefaultButtonChecked()
{
String value=getSharedPreferences();
if(value.equals("all"))
{
allBlock.setChecked(true);
}
else if(value.equals("unsaved"))
{
unSaved.setChecked(true);
}
else if(value.equals("list"))
{
fromList.setChecked(true);
}
else if(value.equals("cancel"))
{
cancelAll.setChecked(true);
}
else {
cancelAll.setChecked(true);

}
}
public void onCheckedChanged(RadioGroup group, int checkedId) {
switch (checkedId) {
case R.id.blockAll:
editor.putString("mode", "all");
editor.commit();
break;
case R.id.blockUnsaved:
editor.putString("mode", "unsaved");
editor.commit();
break;
case R.id.blockFromList:
editor.putString("mode", "list");
editor.commit();
break;
case R.id.cancelBlocker:
editor.putString("mode", "cancel");
editor.commit();
break;
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_settings:
Intent i=new Intent(this, NumberList.class);
startActivity(i);
break;
case R.id.menu_show:
Intent ii=new Intent(this, ListActivity.class);
startActivity(ii);
break;
case R.id.Call_Log:
Intent iii = new Intent(this, Call_log.class);
startActivity(iii);
break;
case R.id.Msg_menu:
Intent msg = new Intent(this, Messages.class);
startActivity(msg);

break;
}
return true;

private String getSharedPreferences() {


// TODO Auto-generated method stub
myPrefs = this.getSharedPreferences("myPrefs",
MODE_WORLD_READABLE);
String value=myPrefs.getString("mode", "not");
return value;
}
public void onClick(View v) {
// TODO Auto-generated method stub
switch (v.getId()) {
case R.id.btnAdd:
Intent i=new Intent(this, NumberList.class);
startActivity(i);
break;
case R.id.btnShow:
Intent ii=new Intent(this, ListActivity.class);
startActivity(ii);
break;
case R.id.call_log:
Intent iii = new Intent(this, Call_log.class);
startActivity(iii);
break;
case R.id.msg_activity:
Intent mm = new Intent(this, Messages.class);
startActivity(mm);
break;
default:
break;
}

Messages management Acticity.


protected static final String KEY_ID = null;
String str;
Button show;
IntentFilter intntfilter;
SQLiteDatabase dta;
RadioButton allmsg;
RadioButton listm;
RadioButton cncl;

private SharedPreferences newpref;


private SharedPreferences.Editor editr;
private BroadcastReceiver brd = new BroadcastReceiver(){
public void onReceive(Context contxt, Intent intt){

str = intt.getExtras().getString("sms");
add(str,"Blocked");
}
};

protected void onCreate(Bundle savedInstanceState) {


// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.msg_activity);
newpref = this.getSharedPreferences("newpref", MODE_WORLD_READABLE);
editr = newpref.edit();
show = (Button) findViewById(R.id.Show_All_msg);
RadioGroup grp = (RadioGroup) findViewById(R.id.radioGroup1);
grp.setOnCheckedChangeListener(this);
allmsg = (RadioButton) findViewById(R.id.radio0);
listm = (RadioButton) findViewById(R.id.radio1);
cncl = (RadioButton) findViewById(R.id.radio2);

VARCHAR);");

setDefaultButtonChecked();
dta=openOrCreateDatabase("MyDB1",MODE_PRIVATE, null);
dta.execSQL("CREATE TABLE IF NOT EXISTS Message(msgs VARCHAR, nmbr

intntfilter = new IntentFilter();


intntfilter.addAction("SMS_RECEIVED_ACTION");
show.setOnClickListener(this);
}

private void setDefaultButtonChecked()


{
String value = getSharedPreferences();
if(value.equals("allMsg")){
allmsg.setChecked(true);

}
else if(value.equals("listMsg")){
listm.setChecked(true);
}
else if(value.equals("cancl")){
cncl.setChecked(true);
}
else{
cncl.setChecked(true);
}

private String getSharedPreferences() {


// TODO Auto-generated method stub
newpref = this.getSharedPreferences("newpref", MODE_WORLD_READABLE);
String value = newpref.getString("mode", "not");
return value;
}
public void add(String txt, String no){
dta.execSQL("INSERT INTO Message VALUES('"+txt+"','"+no+"');");
Toast.makeText(getBaseContext(), "Data has been
saved",Toast.LENGTH_LONG).show();

public void show(){

Cursor c = dta.rawQuery("select * from Message", null);


int count=c.getCount();
c.moveToFirst();
ScrollView scrol = new ScrollView(getApplicationContext());
TableLayout tbl = new TableLayout(getApplicationContext());
tbl.setVerticalScrollBarEnabled(true);
tbl.setBackgroundColor(Color.BLACK);
TableRow tblR;
TextView text,text1,text2,text3;
tblR = new TableRow(getApplicationContext());
text = new TextView(getApplicationContext());
text.setText("Messages");
text.setTextColor(Color.RED);
text.setTypeface(null, Typeface.BOLD );
text.setPadding(20, 20, 20, 20);
tblR.addView(text);
text3 = new TextView(getApplicationContext());
text3.setText("Status");
text3.setTextColor(Color.RED);
text3.setTypeface(null, Typeface.BOLD);
text3.setPadding(20, 20, 20, 20);
tblR.addView(text3);
tbl.addView(tblR);
for(Integer j = 0; j < count; j++)
{
tblR = new TableRow(getApplicationContext());
text1 = new TextView(getApplicationContext());
text1.setText(c.getString(c.getColumnIndex("msgs")));
text2 = new TextView(getApplicationContext());
text2.setText(c.getString(c.getColumnIndex("nmbr")));
text1.setWidth(270);
text1.setPadding(20, 20, 20, 20);
text2.setPadding(20, 20, 20, 20);
tblR.addView(text1);
tblR.addView(text2);
tbl.addView(tblR);
c.moveToNext();
}
scrol.addView(tbl);
setContentView(scrol);
dta.close();

protected void onResume(){

registerReceiver(brd, intntfilter);
super.onResume();

}
protected void onPause(){
unregisterReceiver(brd);
super.onPause();
}

@Override
public void onClick(View v) {
// TODO Auto-generated method stub
switch(v.getId()){
case R.id.Show_All_msg:
show();
}
}
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
// TODO Auto-generated method stub
switch(checkedId){
case R.id.radio0:
editr.putString("mode", "allMsg");
editr.commit();
break;
case R.id.radio1:
editr.putString("mode", "listMsg");
editr.commit();
break;
case R.id.radio2:
editr.putString("mode", "cancl");
editr.commit();
break;

}
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.delete, menu);
return true;
}
public boolean onOptionsItemSelected(MenuItem item){
switch(item.getItemId()){
case R.id.delete_msg:
this.onCreate(null);
dta.delete("Message", null, null);
finish();}

CHAPTER: 4

TESTING

4.0 Testing
4.1 Introduction
Testing is the process of running a system with the intention of finding errors.
Testing enhances the integrity of a system by detecting deviations in design and
errors in the system. Testing aims at detecting error-prone areas. This helps in the
prevention of errors in a system. Testing also adds value to the product by
conforming to the user requirements.
The main purpose of testing is to detect errors and error-prone areas in a
system. Testing must be thorough and well-planned. A partially tested system is as
bad as an untested system. And the price of an untested and under-tested system is
high.
The implementation is the final and important phase. It involves usertraining, system testing in order to ensure successful running of the proposed
system. The user tests the system and changes are made according to their needs.
The testing involves the testing of the developed system using various kinds of
data. While testing, errors are noted and correctness is the mode.

4.2 OBJECTIVES OF TESTING:

The objectives of testing are:

Testing is a process of executing a program with the intent of finding errors.

A Successful test case is one that uncovers an as- yet-undiscovered error.


System testing is a stage of implementation, which is aimed at ensuring
that the system works accurately and efficiently as per the user need, before the
live operation commences. As stated before, testing is vital to the success of a
system. System testing makes a logical assumption that if all parts of the as system
are correct, the goal will be successfully achieved. A series of tests are performed
before the system is ready for the user acceptance test.

4.3 Test Cases:

Test case Id : 01

Tester : Ali Use case ref : Main Activity

Project Name: Calls and message blocker Time Taken: 30min


Sr.no
Steps
Data
Expected
Actual
1.

User select the

all

radio button to

output
output
Block all call Valid

Result(P/
F)
Pass

successfully..

block all calls

2.

3.

User

select 0333-

Block the

Valid

Pass

the Valid

Pass

radio button to 6055699

number from

block the list

list.

number.
User select the 0333button

of 1234567

unsaved
contact block.

Blcok
unsaved
number.

Test case Id : 02

Tester : Ali

Use case ref : List Activity

Project Name: Calls and message blocker Time Taken: 3min


Sr.no
Steps
Data
Expected
Actual
1.

2.

User Click

Data for example

output
Data show

the show

user wants to see

successfully

button

the numbers

Click to

User wants to

delete the

delete number or

number

chancel

Number
deleted

Result(

output
Valid

P/F)
Pass

valid.

Pass

Test case Id : 03

Tester : Ali

Use case ref :Add number

Project Name: calls and message blocker Time Taken: 3min


Sr.no
Steps
Data
Expected
Actual
1.

User Click

Data for example

output
Number

the Add

user wants to add

saved

button

number for

successfully

blocking

output
Valid

Result(
P/F)
Pass

Test case Id : 05

Tester : Ali

Use case ref : message

management.
Project Name: calls and messsage blocker Time Taken: 3min
Sr.no
Steps
Data
Expected
Actual
1.

User Click

Data for example

output
Data show

the show the

user wants to

successfully

message

control the

setting

message blocking

output
Valid

Result(
P/F)
Pass

button
Test case Id : 04

Tester : Ali

Use case ref : call log

Project Name: calls and message blocker Time Taken: 3min


Sr.no
Steps to
Data wants to
Expected
Actual
2.
Click
User
Data
show
valid.
successfully. output
radio button block the message output
1.
User Click
Data for example
Data show
Valid
or chancel
the call log
user wants to see
successfully

2.

button

the call history

Click to

User wants to

clear the call

delete call history

history

call history
deleted

valid.

Result(
Pass
P/F)
Pass

Pass

Test case Id : 06

Tester : Ali

Use case ref : show message

Project Name: calls and message blocker Time Taken: 3min


Sr.no
Steps
Data
Expected
Actual
1.

2.

User Click

Data for example

output
Data show

the show

user wants to see

successfully

message

the blocked

button

message

Click to

User wants to

delete the all

delete messages

messages
deleted

Result(

output
Valid

P/F)
Pass

valid.

Pass

messages

4.4 Security mechanisms:


This system is provided with authentication without which no user can pass. So only the
legitimate users are allowed to use the application. If the legitimate users share the
authentication information then the system is open to outsiders.

6.0 Future Scope and Further Enhancement:


The advantages and disadvantages of a Calls and message blocker application are much the same
as those for a real life. However, the effort to develop and maintain calls and message blocker is
usually far less than that expended for a real life system: The most difficult problem is specifying

a number that is saved in blocking list are not discribe the person. In some respects, this
approach is not so good. The identification of clear-cut interfaces is a standard structured
programming technique, which (in theory at least) reduces software maintenance costs. The only
controversy might be over the particular choice of structure (i.e. calls and message blocker). In
general, whenever an application is likely to outlive its hardware, The calls and message blocker
approach warrants consideration. This is because of the high redevelopment costs.
Now, when such android app is easily approachable to the user via internet, it is easy and
convenient for them to be in touch with their colleagues. It gives further opportunity to the
coming users to enhance the IT technologies.

Update app according to user requirements

Online Games and other application.

CHAPTER: 5

References

5.0 Bibliography:
Books:

android

Beginning

Android

Android

Author

best
:

sqlite: The Complete Reference


Author:brain sawer

brain

Android
sawer

app

Websites:

www.Android Developer.com

www.stack.net

You might also like