Professional Documents
Culture Documents
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
_________________
ALLA
H
ALMI
GHTY
DEDICATION
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
10
11
12
13
Tool Selection.................chapter...............................02
20
21
27
27
28
32
42
Design .chapter..04
48
48
49
72
Testing .chapter05
73
75
Introduction:
chepter 01
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.
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
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.
Blocker
Main Activity
List Activity
Manage messages
Number list
Remainder database
Message blocker
User
Sys
Call log
01
Blocker
this use-case will describe the how to block the calls according to
Precondition: System must be in ready state to receive the calls and give the response.
Primary scenario:
1)
2)
3)
4)
Post Condition:
1) The system will display the notification if the number is match to the blocking number
02
Main Activity
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
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
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
03
List Activity
this use case shows the all numbers that are to be blocked. User
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)
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.
04
Manage Messages
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
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.
05
Number list
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
Post Condition:
10) System show the textbox and add button
11) System show the toast if the number is correctly add to the database.
06
Remainder Database
this use case save the number show, and delete the number from
database.
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
07
Message blocker
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.
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.
Call log
this use case shows the call history time, date, call duration, call
type, and user can clear the call history.
Actor (s):
User
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)
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
Processor Name:
Dual Core
Processor Speed:
3.2 GHz
RAM:
2 GB
320 GB
Display Device:
14 Inch Monitor
Keyboard Type:
PS2 or USB
Mouse Type:
PS2 or USB
Technology Implemented:
Java
Language Used:
Android
Database:
SQLite
XML
platform:
eclips
Operating System:
Programming Language:
Android
Software:
eclips
Main Activity.
Number show.
Show messages.
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);
}
c.moveToNext();
}
}
c.close();
mDbAdapter.close();
}
else
{
}
}
}
}
public void blockCall(Context c, Bundle b)
{
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();
}
}
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;
str = intt.getExtras().getString("sms");
add(str,"Blocked");
}
};
VARCHAR);");
setDefaultButtonChecked();
dta=openOrCreateDatabase("MyDB1",MODE_PRIVATE, null);
dta.execSQL("CREATE TABLE IF NOT EXISTS Message(msgs VARCHAR, nmbr
}
else if(value.equals("listMsg")){
listm.setChecked(true);
}
else if(value.equals("cancl")){
cncl.setChecked(true);
}
else{
cncl.setChecked(true);
}
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.
Test case Id : 01
all
radio button to
output
output
Block all call Valid
Result(P/
F)
Pass
successfully..
2.
3.
User
select 0333-
Block the
Valid
Pass
the Valid
Pass
number from
list.
number.
User select the 0333button
of 1234567
unsaved
contact block.
Blcok
unsaved
number.
Test case Id : 02
Tester : Ali
2.
User Click
output
Data show
the show
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
User Click
output
Number
the Add
saved
button
number for
successfully
blocking
output
Valid
Result(
P/F)
Pass
Test case Id : 05
Tester : Ali
management.
Project Name: calls and messsage blocker Time Taken: 3min
Sr.no
Steps
Data
Expected
Actual
1.
User Click
output
Data show
user wants to
successfully
message
control the
setting
message blocking
output
Valid
Result(
P/F)
Pass
button
Test case Id : 04
Tester : Ali
2.
button
Click to
User wants to
history
call history
deleted
valid.
Result(
Pass
P/F)
Pass
Pass
Test case Id : 06
Tester : Ali
2.
User Click
output
Data show
the show
successfully
message
the blocked
button
message
Click to
User wants to
delete messages
messages
deleted
Result(
output
Valid
P/F)
Pass
valid.
Pass
messages
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.
CHAPTER: 5
References
5.0 Bibliography:
Books:
android
Beginning
Android
Android
Author
best
:
brain
Android
sawer
app
Websites:
www.Android Developer.com
www.stack.net