Zanwar_Nov4_rev_0.9

chulavistajuniorMobile - Wireless

Dec 10, 2013 (3 years and 9 months ago)

90 views






DESIGN AND IMPLEMENTATION OF AN ANDROID MOBILE PHONE TRACKING
APPLICATION







A
Project




Presented to the faculty of the D
epartment of
Computer Science

California State University, Sacramento




Submitted in

partial

satisfaction of


the
r
equirements for the degree

of




MASTER OF

SCIENCE


in



Computer Science





b
y


Sagar Zanwar





FAL
L



2012


ii







































©
2012


Sagar Zanwar

ALL RIGHTS RESERVED

iii




DE
SIGN AND IMPLEMENTATION OF AN ANDROID MOBILE PHONE TRACKING
APPLICATION






A
Project



by



Sagar Zanwar












Approved by:


__________________________________,

Committee Chair

Du

Zhang, Ph.
D.




__________________________________,

Second
Reader

Bo
b
Buckley
,

M
.
S
.



____________________________

Date





iv





Student:
Sagar Zanwar




I certify that this student has met the requirements for format contained in the University format
manual, and that this
project

is suitable for shelving in the Li
brary and c
redit is to be awarded for
the project
.












________
__________________,
Graduate Coordinator

___________________

Nikrouz

Faroughi, P
h
.
D
.









Date









Department
of
Computer

Science


v



Abstract


of


DESIGN AND IMPLEMENTATIO
N OF AN ANDROID MOBILE PHONE TRACKING
APPLICATION




by


Sagar Zanwar





The goal of the Masters project is to develop an application, mainly designed for tracking
the lost mobile phone. It is embedded with several tracking
features, which

will help
trac
king the lost phone. All the features work on
SMS (
short text message) basis. So,
incoming SMS format plays a vital role. Application on the current platform Mobile
Defense is a related
app, which

uses GPS to track the lost phone of the device or uses the
cell tower data to send the coordinates.
However,

it does not take pictures of the user with
inbuilt camera present on the device to track the user with picture and lacks SMS
feature,
which

will be implemented in the current project. Similarly on IOS (ipho
ne OS) an
application called Find My iphone which only provides the Location of the device.


Android application running in the cell monitors all the incoming messages. If the SMS is
meant for the application, it reads the same and performs the expected ta
sk
.

The

vi


application auto starts every time you boot your cell, goes to running mode and
continuously listens for the incoming SMS messages. Whenever there is a new incoming
SMS, it checks the content of the message and does the certain designed features in

the
application
.



Show Me where you are



Unknown SIM Identifier



Show Me the Picture



Call Monitoring Tool



Profile management


This Master’s project demonstrates added advantage of SMS features, from which user
can track the phone.

SMS are easy to use and ha
s no dependency on cellular data. In
comparison to related application on Android and IOS, the designed application can give
the GPS location by sending the SMS, taking the picture and can still work on changing
the SIM card.











___________________
____, Committee Chair

Du Zhang, Ph
.
D
.



_______________________

Date


vii


D
EDICATION
















To my Parents

























viii


ACKNOWLEDG
E
MENTS




While working on this project many people have helped me achieve my goal.

I would like to thank Dr.
Du Z
hang
, for investing his invaluable time reviewing this
project. Without his support it would have been difficult for me to complete this project.

I would also like to thank Professor Bob Buckley for giving me his time and input as
second reader.

I would
like to thank my family and
Friends,

for their undying love and support. In
addition, I would like to thank all my professors, who taught me. Without their assistance
and guidance, my Master’s degree would not have been completed successfully.


ix



TABLE OF C
ONTENTS











Page


Dedication

................................
................................
................................
..................


vii

Acknowledg
e
ments

................................
................................
................................
...


viii

Lis
t of Figures

................................
................................
................................
..............

xi

Chapter

1. INTRODUCTION
…..
…………
……………………………………………….. 1



1.1
Problem
Statement

................................
................................
......................

4



1.2
Solution


................................
................................
................................
......

4



1.3
Pro
ject Objectives

................................
................................
.......................

5



1.4 Report Organization

................................
................................
....................

7

2.

BACKGROUND

................................
................................
................................
....

9



2.1 Related Work

................................
................................
..............................

9

3.
DESIGN AND IMPLEMENTATION

................................
................................
.

1
1

3.1

Functional Overview

................................
................................
.................

11

3.2
User Roles

................................
................................
................................
.

12

3.3 Software Structure of the Application

................................
......................

14

3.3.1 Manifest

................................
................................
.....................

14

3.3.2 Main Service

................................
................................
.............

14

3.3.3 SMS Receiver

................................
................................
............

15

3.3.4 Camera Service

................................
................................
..........

1
5

3.
4

Data Flow Diagram

................................
................................
...................

1
6

3.5

Implementation Details

................................
................................
.............

1
9

3.
5.1 Profile Changing

................................
................................
........

21

3.5.2 Call Registry

................................
................................
..............

22

3.5
.3 Insert New SIM Card

................................
................................
.

2
3

3.5
.4 GPS Value
-
Single and Continuous

................................
............

2
4


x


3.5
.5 Snapshot Transfer to E
-
Mail Address

................................
........

25

3.6

JDK 1.6

................................
................................
................................
.....

2
6

3.7
Eclips
e SDK 1.6.2

................................
................................
.....................

28

3.
8
Eclipse SDK Features

................................
................................
...............

2
8

3.9
Android SDK 2.2
………………………
…….………………
.
…………
29

3.10

Android Services

................................
................................
....................

3
1

4.
RESULTS

................................
................................
................................
..............
3
3

4.1 Profile Change

................................
................................
..........................
3
3

4.2 Call Tracking

................................
................................
............................
3
4

4.3 SIM Change

................................
................................
..............................
3
5

4.4 Single Tracking

Location


................................
................................
.........
3
6

4.5 Advantages and Dis
advantages

................................
................................
.
3
8

4.6 Comparison


................................
................................
..............................
39

5.
CONCLUSION

................................
................................
................................
......
4
1

5.1 Conclusion

................................
................................
...............................
4
1

5.2 Future Work

................................
................................
.............................
42

A
ppendix


Source Code

................................
................................
...............................
4
3

B
ibliography


................................
................................
................................
...............
77













xi



LIST OF FIGURES

Figure
s


Page


1

Data Flow



................................
................................
................................
......................


1
6

2

Flow Chart

................................
................................
................................
......................


17

3

Flow Chart Continued


................................
................................
................................
....


18

4

Flow Diagram of App
lication


................................
................................
........................


20

5

Silent Mode


................................
................................
................................
....................


3
3

6

Ring a
nd Vibrate Mode


................................
................................
................................
..


3
3

7

Call Tracking


................................
................................
................................
..................


3
4

8

SIM Changed

................................
................................
................................
..................


3
5

9

Single Tracking

Location

................................
................................
................................


3
6

10

Continuous Track
ing


................................
................................
................................
......


3
7

1



Chapter 1

INTRODUCTION



Today mobile communication devices are becoming much more technologically
advanced and offer more features than just conversation. In cell phone, global positioning
system (GPS) tracking is one of those advances. Trackin
g devices can be used to drive a
car through traffic day
-
to
-
day or vehicle fleet tracking. Not only can a driver use an auto
GPS system for directions, but also the corporate office knows where each vehicle is. In
fact, all businesses are under pressure to

monitor their shipments in order to enhance
security and efficiency. GPS Systems can be used while outdoors

for activities such as
hiking or camping.


As GPS technology has become more important and accessible to consumers, the
varieties of GPS enabled de
vices have also increased at an incredible rate. At the time
that the technology gets more advanced, even smaller and more versatile, handheld
portable GPS devices are becoming increasingly popular like mobile phones. The
popularity of mobile devices is si
gnificantly higher among the youngest individuals.


Usually, mobile devices like mobile phones or portable digital displays (PDAs) are
equipped with global positioning system (GPS) receptors that allow us to get the device
geographic position in real time.

One more feature

in
the
existing system is

intimation of
SIM
card
replacement by
extracting

IMEI

of device

for tracking purpose.

Mobile phone
2



tracking is a useful mobile application

if it
contains
several

features, which

aims at the
user's security.


Suc
h tracking systems are now present in the latest
cell phones

that are available in the
market. They are usually known as smart phones.

These smart phones use different
Operating systems like Android,

Palm,

Windows and Blackberry to name a
few.
Canalys
list
ed android as the best
-
selling smart phone platform worldwide in Q4 2010

with over
300 million Android devices in use by February 2012

[1]
. According to Google's Andy
Rubin, as of February 2012 there are over 850,000 Android devices activated every
day

[
2]
.


Android is a Linux based OS for mobile devices such as smart phones and tablet
computers.
The Open Handset Alliance led by Google develops it
. Google purchased the
initial developer of the software, Android Inc., in 2005. The Android Open Source
Project

(AOSP) is tasked with the maintenance and further development of Android.
[3]


Android relies on Linux version 2.6 for core system services such as security, memory
management, process management, network stack, and driver model. The kernel also acts
as an

abstraction layer between the hardware and the rest of the software stack. Android
includes a set of core libraries that provides most of the functionality available in the core
libraries of the Java programming language

[
3]
.


3



The API Level is an integer
value that uniquely identifies the framework API revision
offered by a version of the Android platform. Android platform provides a framework
API that applications can use to interact with the underlying Android system.


The framework API consists of

[4]



A

core set of packages and classes



A set of XML elements and attributes for declaring a manifest file



A set of XML elements and attributes for declaring and accessing
resources.




A set of permissions that
application can

request
are
like camera usage, GPS
, WIFI

or data
.
A

permission enforcements

m
e
ch
a
nism is also

included in the system

Each
successive version of the Android platform can include updates to the Android
application framework API that it delivers.


Every Android application runs in its own pro
cess, with its own instance of the Dalvik
virtual machine. Dalvik has been

written so that a device can run multiple VMs
efficiently. The Dalvik VM executes files in the Dalvik Executable (.dex)
format, which
is optimized,

for minimal memory footprint. The

VM is register
-
based, and runs classes
compiled by a Java language compiler that have been transformed into the .dex format by
the included "dx" tool. The Dalvik VM relies

on the Linux kernel for underlying
functionality such as threading and low
-
level me
mory
management

[
3]
.


4



Android has a large community of developers writing applications ("apps") that extend
the functionality of the devices. Developers write primarily in a customized version of
Java. Apps can be downloaded from third
-
party sites or throu
gh online stores such as
Google Play

(formerly
Android Market
), the app store run by Google.


1.1

Problem Statement


The use of mobile devices / cell phones has become part of our daily routine. Today
mobile communication devices are becoming
much

more

techno
logically advanced and
offer more features than just conversation. Specially, the introduction of Android smart
phones has
brought
a new revolution in the cell
-
phone market. In this routine usage,
almost everyone
has
an

experience of misplacing or losing
h
is or her

cell phone. As
Android smart phones are latest in the
market,

it is
expensive

to
lose

one. Hence, a built
-
in application in the smart phone is very much necessary so that
the lost cell can be
retrieved.


1.2

Solution


It is essential to have a powerf
ul and efficient way for people to recover their Android
smart phones once they have lost it. Usually, mobile devices like mobile phones or
portable digital displays (PDAs) are equipped with global positioning system (GPS)
receptors that allow us to get th
e device geographic position in real time

along with the
5



feature of extracting the information

of the cell phone through IMEI number even if
the
SIM

card is being replaced
.
However,

by just enabling t
he cell phones with GPS system
and

retrieving the inform
ation about the new SIM would be insufficient to track the
smart
-
phone.


Hence, c
ame the idea of
developing
LOST ANDROID MOBILE PHONE
TRACKER

(
LAMP
t)
, an efficient & unique application with
a
few more features which help in
controlling the lost Android sma
rt phone & retrieving it back. This application uses
location
-
based

services (LBs) like GPS & global system for mobile (GSM) network to
track a mobile device.


The
application
is

filled with features like Profile change, Call registry, Intimation of
SIM re
placement, GPS value
-
single & GPS value
-
continues and transfer of snapshots to
e
-
mail address. All the features work on SMS basis.
Therefore
, incoming SMS format
plays a vital role. Our android application running in the smart phone monitors all the
incomi
ng messages. If the SMS is meant for the application, it reads the same and
performs the expected task.


1.3

Project Objectives


SIM replacement:

Immediately after the SIM replacement, we
are notified

about our
device

IMEI number, details of the new SIM insert
ed along with the cell info / GPS data.
6



User is expected to hard code a mobile number in the application. This could be your
alternative number / the most preferred number

to which the information of the lost
cell
phone

has
to

be sent.


Profile change:

Say
, the GPS data shows our cell very much at home, but, we are unable
to trace it as it is in silent mode as you had put in silent mode before going to bed. Else,
say the person who flicked your cell is still around and has put it in silent mode keeping
his
fingers crossed. You can easily convert the profile of the cell from general to silent
and silent to general as per your requirement by just sending an SMS to predefined
number.


Call
-
Registry:

All call registry details like incoming, outgoing calls are tr
acked by our
cell. It records the incoming and outgoing names (if known to address book) and numbers
or just number (if not known to the address book) and sends the information in the form
of an SMS. Thus, we get to know with whom our cell phone thief has
close acquaintance;
we can call them in turn to know more about the theft.


GPS value
-
Single:

Get to know the GPS value

and

exact

location of the

lost phone
. This
data/value is sent only once

from the lost phone
.


7



GPS value
-
continuous:

Fetch
the GPS
values

every

time the
current
GPS

data is
different from the previous one.

Then the

update
is sent

to the requested phone number.

GPS value is
sent after

a fixed interval of time and distance.


Transfer of snap shots to the e
-
mail address:

Another dynamic featu
re of
the

application
is

transfer of
image
snapshots. You can activate the front camera
,

back
camera of your cell by just sending an SMS.
The
application
reads

the incoming SMS,
activates the camera, captures image, sends the series of
image
snapshots to
t
he
e
-
mail
address pre
-
coded.

These

images can be further used to get more information about the
location of the lost phone.

Here we assume the SIM
card
is
data
enabled
.


Automatic deletion of Track
-
messages:

Our application deletes the incoming and
outgoi
ng messages pertaining
to the

application

such that the new owner of the cell is
clueless about it all
.


1.4

Report Organization


This proj
ec
t report is organized into five

chapters.

First chapter deals with the introduction of the project, the prob
lem statem
ent and its
solution and
objective of the
project. Second chapter deals with the
background
overview
. Third chapter deals with the project description, services, dataflow diagrams
and flowcharts of the project.
In addition,

the discussion

of implementation

details like
coding, programming techniques in our project.
Fourth

chapter is

presented with the
8



snapshots and outputs of our project for the different inputs.
Finally,

fifth chapter

it is
about the conclusion and the scope
of the

future work of our proje
ct.





















9



Chapter 2

BACKGROUND

2.1 Related Work


Mobile
Defense [
5
] is

an app on android
platform, which

uses GPS to track

the lost
phone or the device
and uses

the cell tower data to send the coordinates.

The application
sends the coordinate
s, but
does
not track continuously if the user changes the
location,

you need to get manually new location.
It could be useful when the user is moving to a
different location constantly. The application provides an alarm feature to find the phone
if
it is

nearby
you,

by hearing the loud sound.
However,

it does not take pictures of the
user with in built camera present on the device to track the user with picture.


Find my iPhone
[6

]
(also known as "Find
my
iPhone") is an app and service provided by
Apple I
nc. that allows remote loca
tion
-
tracking of iOS devices
. The service is c
urrently
available for iOS 5
or later through iCloud. Although it is not bundled with the operating
system itself, the app is available for download from the App Store free of charge
for iOS
devices running iOS 5.0 or later
.


Find My iPhone allows users to locate their iOS devices using either the iOS app or
icloud.com
. Other feature includes:




Play sound


Makes the device play a sound, even if it is muted. This feature can be
used if

the device has been accidentally misplaced.

10





Lost Mode (iOS 6 or later)


Flags the device as lost or stolen, allowing the user to
lock it with a passcode. If the device is an iPhone and someone finds the device,
he/she can call the user directly on the de
vice.



Erase iPhone


Completely erases all content and settings. This is useful if the device
contains sensitive information, but the device cannot be located after this action is
performed
.

















11



Chapter 3

DESIGN AND IMPLEMENTATION


3.
1

Function
al Overview


Once the application is installed

on Android phone
, restart
the device
. Application starts
at the boot time automatically and runs in the hidden mode.


If the SIM is flipped
,
an
SMS will be sent to the alterative
numbers, which

are hardcoded

in the Android application. Assume your Android smart phone has been stolen then you
can track the Android smart phone by sending SMS from any cell phone and get required
updates as SMS like all the incoming and outgoing call details along with
contact
na
mes

from the contact list

(if saved

in the

receiving

phone
) and number, location of the lost
Android smart phone once and repeatedly as and when the location changes, change the
profile from silent to ringing and vibrate mode and ringing and vibrate to si
lent mode,
stop receiving the updates of the location, capture the
image snapshot
from the android
cell phone and attach and send them as a mail to the email
-
id which is hard coded in the
Android application.





12



3.2

User Roles


The role of user in this
project is to send SMSs to the lost

Android smart phone having
application
installed

with GPS and GPRS enabled.


Here we assume the lost phone with installed application

on Android
phone is

called as
“phone
L” and

the phone used for sending SMS is named as


p
hone
-
M

The syntax of
the SMSs that can be sent by the user and its functionalities are as follows


TRACK
-
InOut
-
phone
number
: This

command
helps

in monitoring all the incoming
and outgoing calls
on phone L
and sends as an SMS (Name & contact no) to the p
hone
number which requested this operation.


TRACK
-
profile
-
RingAndVib@phonenumber
:
it changes the Phone L profile to
ringing, vibrate mode,

and acknowledges the same to the phone
number, which

requested
this
action

(
phone M)
.


TRACK
-
profile
-
silent@phone nu
mber
:

It changes the Android smart phone's
(phone
L)
profile to silent mode and acknowledges the same to the phone
number, which

requested this action
(phone M)
.


13



TRACK
-
single
-
phone number
:

This helps in fetching the location of the lost Android
smart
phone

(
phone L)

and
sends an
SMS
location

to the phone
number, which

requested
this operation only once.


TRACK
-
continuous
-
phone number
:

This helps in fetching the location of the

(phone
L)

lost Android smart phone
and
sends an
SMS location to the phone number w
hich
requested this action as and when the location changes

of Phone L , it will keep track of it
and sends the new location of the device to requested phone M
.


TRACK
-
stop
:

T
his command is issued after the TRACK
-
continuous command to stop

sending the loca
tion
of Phone L

to

phone M

as an SMS to
the

requested
number
.


TRACK
-
mail
-
phone number
:

This helps in
activating

the front camera (if not

available

back camera)

on Phone
L (
lost phone)
, captures
three

continuous
image snapshots

and
mails it to the email id

which is hardcoded in the application.








14



3.3
Software
S
tructure of the
Application


3.3.1
Manifest


In an Android
project,

a manifest file is created in the beginning. Every
application must

have an Android Manifest .xml file (with precisely that nam
e) in its root directory. The
manifest presents essential information about the
application to

the Android system,
information the

system must have before it can run any of the application's code.
Manifest file takes the
permission of

the usage
of Data
,
Wi
-
Fi
, camera, GPS Bluetooth to
name few services from the android
system.


3.3.2
Main Service


At the start of
application,

Main service will fetch
the IMEI of the device and the IMSI
number of the SIM card. Whenever the SIM card is
changed,

it will fetch t
he IMSI
number again to verify to the previous stored number
IMSI.
if they both differ , then
application will send an SMS from Lost phone to the hard
-
coded number.


Other functionality of Main service includes the service of changing the profile modes of

the lost phone from silent to ring and vibrate or vice versa.
Call
tracking on

lost phone
of
incoming and outgoing calls is traced by main service.


15



3
.3.3
SMS Receiver


This is a receiver, which extends the communication from Broadcast Receiver.
It

reads

the incoming message on the lost phone and if the message is intended for the
app,

then it
redirects to respective java files in the project, for execution of functionality needed.
SMS receiver calls the Single location file and continuous location to fet
ch the GPS
latitude and longitude.


3.3.4

Camera Service


This service initiates the front camera and captures a series of image snapshots on a basis
of fixed interval. The images are stored on the memory
card,

the path is created by
triggering the “Auto
Capture “file. Once the images are saved, the “SMTP
Authenticator” authenticates the Username and password of the email ID which is hard
coded , from which the images snapshot are attached to the email and sent to the User
preferred email id .







16



3.
4

Data Flow Diagram



Figure 1: Data Flow



17





Figure 2:
F
low

Chart





18






Figure 3:

F
low
Chart
Continue
d


19



3.
5

Implementation Details


A

f
ew
interesting features are implemented
in this
application
which makes it different
from the
other
existing tracking

system
s
.
This

application

always runs in the background
and
monitors

all the incoming messages. If the SMS is meant for the application, it reads
the same and performs the expected task.

We

have
implemented

following features:



Profile changing



Call r
egistry



Insert new SIM card



GPS location
-
single & continuous



Transfer of snapshots to e
-
mail address











20





Figure

4

: Flow D
iagram of
A
pp
lication

21



3.
5
.1
Profile C
hanging


Just by sending an SMS from any of the mobile phone to the lost andro
id smart phone,
we change the profile of the android phone from general to silent mode or from silent to
general mode.


We use following syntax /text format to activate this feature, TRACK
-
profile
-
RingAndVib@phone number (from silent to ring & vibrate) TR
ACK
-
profile
-
silent@phone number (from ring & vibrate to silent mode)


// Default number used



public static String call_alert_no="";


public String response_phno="", current_cell_id="",




standard_cell_id="", ph_imei="", ph_imsi="", initializatio
n_flag="false",




alert_nos[]={"9163966583","9163966583"};




// Code Snippet for Profile Changing




if(token.trim().equals("profile"))









if(mode.trim().equals("silent"))






{






maudio=(AudioManager)getSystemServic
e(AUDIO_SERVICE);



System.out.println("...C...Profile silent");



maudio.setRingerMode(AudioManager.RINGER_MODE_SILENT);



maudio=null;



sendSMS(response_phno, "Profile Changed To Silent Mode");





//
Code snippet for finding the IMEI of the device and IMSI of the SIM card

22




public void FindIMEI_IMSI()


{



TelephonyManager

TelephonyManager)getSystemService(TELEPHONY_SERVICE);



String p_imei = manager.getDeviceId();



String p_imsi = manager.getSubscriberId();



if(p_imei!=null && p_imei.length()==15 ){





ph_imei=p_imei;





//txt_lat.setText(ph_imei);






ph_imsi=p_imsi;





// txt_lon.setText(ph_imsi);




3.
5
.2
Call Registry


This feature helps

us to give the information about the incoming and outgoing calls

on
the lost phone

Anytime smart phone is
lost,

by using the command we can track the calls
on the Lost
phone. And

it captures the phone number listed in outgoing and incoming call

registry

and sends an SMS with the information to the number requested.


We use following syntax /text format to activate this feature,

TRACK
-
INout
-
phone number

The following code snippet does the functionality of tracking the incoming and outgoing
calls and late
r composing the SMS as acknowledgment.


public class TravelPhoneStateListener extends PhoneStateListener{



String callie_name;


static MainService parent;


AudioManager maudio;


boolean priority_flag;



23




public TravelPhoneStateListener(Mai
nService parent) {



TravelPhoneStateListener.parent=parent;


}



// Code For incoming call



case TelephonyManager.CALL_STATE_RINGING:




System.out.println("I Am In CALL_STATE_RINGING");




if(MainService.call_alert_flag){






callie_name=getContactNameFromNumber(incoming_number);





System.out.println("Callie : "+callie_name+" Number
"+incoming_number);





MainService.sendSMS(MainService.call_alert_no,




"Their is an In
-
coming call From :
"+callie_name+"
-

"+incoming_number);




}



// Code to Get name from Contact List.



public static String getContactNameFromNumber(String number) {






ContentResolver cr = parent.getContentResolver();


Uri uri = Uri.withAppendedP
ath(PhoneLookup.CONTENT_FILTER_URI,
Uri.encode(number));


Cursor cursor= cr.query(uri, new String[]{PhoneLookup.DISPLAY_NAME}, null,
null, null);//(uri, new String[]{PhoneLookup.DISPLAY_NAME} .....)






3.
5
.3
Insert New SIM C
ard



This featu
re helps us to get the information about changed SIM card. When SIM card is
replaced, the application will automatically send the IMEI number of lost cell, details of
the new SIM inserted to the
two phone
alert
numbers, which

are pre
-
coded.



24



// Code for
SIM changed






if(!standard_cell_id.trim().equals(current_cell_id.trim()))



{




for(int i=0;i<alert_nos.length;i++)




{







sendSMS(alert_nos[i],







"SIM changed. Note IMEI number => "+ph
_imei);





try{Thread.sleep(5000);}catch(Exception e){}




}



}







3.5
.4
GPS Value
-
Single and

C
ontinuous



This feature is used for fetching the location string. We retrieve the location string by
sending one SMS to the l
ost smart phone in a particular format. The mobile will reply by
sending the Location String. We can also retrieve the location string in 2 ways. One is
single value, which gives GPS value only once. The other way is continuous, where
various values of loc
ation can be obtained every
pre
-
decided interval of time and
displacement.


We use following syntax /text format to activate this feature

TRACK
-
single
-
phone number (for single GPS value)


TRACK
-
continuous
-
phone number (for continues value)


The following
code snippet fetches the longitude and latitude using GPS and converts the
coordinates into address using the GEO locater.

25




public class SingleLocation extends Service {




private LocationManager locManager;


private double LATITUDE;


private double LONG
ITUDE;


private Geocoder geocoder;





Location location =
locManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);








if (location != null) {





LATITUDE = (double) (location.getLatitude());





LONGITUDE = (double) (location.getL
ongitude());





String latlon=""+LATITUDE+" "+LONGITUDE;





geocoder = new Geocoder(this, Locale.ENGLISH);


try {




List<Address> addresses = geocoder.getFromLocation(LATITUDE,
LONGITUDE, maxResult);










3.5
.5
Snapshot
Transfer
to

E
-
Mail A
ddress



We can activate the front camera/back camera of the lost smart phone by just sending an
SMS. This feature reads the incoming SMS, activates the camera, captures image, and
sends the series of snapshots
to the pre
-
coded e
-
mail address. We need to view the
photograph to check out whether we can extract more information about whom, how,
where etc.

We use following syntax /text format to activate this feature,

TRACK
-
mail
-
phone number

// Sending attachment




26



public class SendAttachment

{


//String from="checkstudent08@gmail.com";


String filename=null;


//Properties mailinfo;


String messageinfo;



public SendAttachment(String email,String messageinfo,List<String> filePaths)


{



EMAIL_ID_TO=email;



th
is.messageinfo=messageinfo;



//Set the host smtp address



Properties props = new Properties();




//file attachment




for (String file : filePaths)


{



MimeBodyPart bp2=new MimeBodyPart();


DataSource atc=new FileDataSource(f
ile);


bp2.setDataHandler(new DataHandler(atc));


bp2.setFileName(file);


mp.addBodyPart(bp2);



}



3.
6

JDK 1.6


Anyone who has existing Java applications will benefit immediately from the
performance, reliability, and UI impro
vements in Java SE 6. Coupled with the expanded
monitoring capacities built into the platform, the release delivers dramatic out
-
of
-
the
-
box
benefits without any coding changes or even a re
-
compile necessary. Simply running
existing Java applications on thi
s latest release is all that is

needed
.

27



For developers, Java SE 6 streamlines web service and XML development, simplifies
GUI development and augments native desktop support, expands programmatic access to
native security facilities, and is the first rele
ase to offer a standardized framework for
scripting languages. NetBeans IDE integrates with the release to further simplify the use
of these and other new developer features in the release
.


Advantages to running applications on JDK 1.6



Applications run
faster on the desktop and servers.



New 'dynamic attach' diagnostics simplify troubleshooting.



Expanded Solaris DTrace support provides value on solaris.



Improved 'native' look and feel across Solaris, Linux, and Windows.


Benefits in upgrading de
veloper environments to JDK 1.6



JavaScript integrated and included with the platform.



Scripting language framework extends support for Ruby, Python, and other
languages.



Complete light
-
weight platform for web services, right out ofthe box.



Simpl
ified GUI design and expanded native platform support.



Full JDBC$ implementation providing improved XML support for Databases.



Java DB included with the JDK, a free to use and deploy Java Database.



Full support by NetBeans IDE 5.5.



Sun Develope
rs Services available to help build more robust application.

28



3.
7

Eclipse SDK 1.6.2


Most of the Eclipse SDK is "pure" Java code and has no direct dependence on the
underlying operating system. The chief dependence is therefore on the Java Platform
itself
Portions are targeted to specific classes of operating environments, requiring their
source code to only reference facilities available in particular class libraries (e.g. J2ME
Foundation 1.0, J2SE 1.3 and 1.4, etc.).


In general, the 3.5 release of the Ec
lipse Project is developed on a mix of Java 1.4, Java 5
and Java 6 VMs. As such, the Eclipse SDK as a whole is targeted at all modern, desktop
Java VMs. Full functionality is available for 1.4 level development everywhere, and
extended development capabili
ties are made available on the VMs that support them.


3.
8

Eclipse SDK Features




Java Development Tooling (JDT)

This feature adds Java editing capability to the platform. The implementation includes a
fully
-
featured Java development environment and provide
s specialized features for
handling, manipulating, compiling, executing and debugging Java code. It defines its own
extension points that enable tool developers to use Java capability in their plug
-
ins. An
example would be the ability to use the Java Model

that defines the package, field and
method definitions ofa Java project.

29





Plug
-
in Development Environment (PDE)

This feature provides convenience for creating plug
-
ins, a task that is filled with
repetitive and laborious actions. It greatly simplifies crea
tion, manipulation, debugging
and deployment of plug
-
ins by automating some of the processes involved as well as
presenting plug
-
in information at a much higher level than its XML meta file.


The meta file stores details about the plug
-
in properties such a
s the used extension points,
external libraries, build configuration and deployment options. Manually editing this file
would be error prone and tedious, thus using PDE is much preferred.


The outlined architecture will be developed using the PDE, allowing

it to be built within
Eclipse itself. From version 3.0 onwards, PDE allows the launch of a separate workbench
to test and debug the plug
-
in under development. The development code is seamlessly
and automatically deployed into the new environment and can b
e used immediately.


3.
9

Android SDK 2.2


Android software development is the process by which new applications are created for
the Android operating system. Applications are usually developed in the Java
programming language using the Android Software Dev
elopment Kit, but other
development tools are available. Android 2.2 is a minor platform release including user
30



features, developer features, API changes, and bug fixes. For information on developer
features and API changes, see the Framework API section.


For developers, the Android 2.2 platform is available as a downloadable component for
the Android SDK. The downloadable platform includes a fully compliant Android library
and system image, as well as a set of emulator skins, sample applications, and more
. The
downloadable platform includes no external libraries.


To get started developing or testing against the Android 2.2 platform, use the Android
SDK and A VD Manager tool to download the platform into your SDK.

API Level


The Android 2.2 platform deliv
ers an updated version of the framework API. The
Android 2.2 API is assigned an integer identifier that is stored in the system itself. This
identifier, called the "API Level", allows the system to correctly determine whether an
application is compatible w
ith the system, prior to installing the application.

The Android software development kit (SDK) includes a comprehensive set of
development tools. These include a debugger, libraries, a handset emulator based on
QEMU, documentation, sample code, and tutori
als. Currently supported development
platforms include computers running Linux (any modem desktop Linux distribution),
Mac OS X 10.4.9 or later, Windows XP or later.


31



Enhancements to Android's SDK go hand in hand with the overall Android platform
developme
nt. The SDK also supports older versions of the Android platform in case
developers wish to target their applications at older devices. Development tools are
downloadable components, so after one has downloaded the latest version and platform,
older platfo
rms and tools can also be downloaded for compatibility testing.


Android applications are packaged in .apk format and stored under / data / app folder on
the Android OS (the folder is accessible only to root user for security reasons). APK
package contains

.dex files (compiled byte code files called Dalvik executables), resource
files, etc.


3.
10

Android Services


The main service that our project provides is using following



android.content.pm.PackageManager:

Class for retrieving various kinds of
infonnat
ion related to the application packages that are currently installed on the
device



android.app.Activity:

An activity is a single, focused thing that the user can do



android.location.Geocoder
:

A class for handling geocoding and reverse
geocoding



android.
location.LocationListener:

Used for receiving notifications from the
LocationManager when the location has changed

32





android.location.Address:

A cl
ass representing an Address,
i.e.
, a set of Strings
describing a location



android.location.LocationManager:

T
his class provides access to the system
location services



android.telephony.SmsManager:
Manages SMS operations suc
h as sending
data, text, and

SMS messages



android.media.AudioManager:

Manages SMS operations suc
h as sending data,
text, and

SMS messages



android.telephony.TelephonyManager:

P
rovides access to inform
ation about
the telephony services on the device

























33



Chapter

4


RESULTS


4.1

Profile change


Snapshot of

the messag
e received after the profile is

changed from ringing & vibrat
e
mode
to
silent




Figure

5
:
Silent Mode




Figure

6
:

Ring and Vibrate Mode

34



4.2

Call Tracking


Snapshot of the
message received after there was

a out
-
going calls and In
-
coming calls
observed in the lost smart phone


Figure
7
: Call Tracking






35



4.3

SIM

Change


Snapshot of the message received after there was
an

activity of

SIM change observed in
the lost smart


Figure
8
: SIM Changed












36



4.4

Single Tracking Location


Format
of text

message to be sent to lost smart
-
phone to obtain the GPS value
address
from the lost smart phone.


Figure
9
: Single Tracking Location

37




Figure
10
: Continuous Tracking




38



4.5

Advantages

and Disadvantages


Advantages



The application is a
uto
-
starte
d when the phone is switched on and the appl
ication
run
s

in the listening mode always.

so every time the phone is restated
, application
restarts without user input.




The user cannot see the application running, runs in the hidden
mode. Once the
application is installed on the phone, th
e application

enters into background

mode and
runs in task manager. The app is not listed under main menu of the phone app list.



The application works ev
en when the SIM card is changed. Even
after inserting

the
new SIM card by the user, we will be still able to run al
l the

features.




The application deletes specific incoming and outgoing messages pertaining to the
app.

whenever the message is intended for the application, the application reads the
message, does the required functionality and deletes the message from th
e inbox of
the phone.



Ease of
use.
Once the app is installed, the application automate
s

to send and receive
the message without the interception needed from the user.



A complete package with intelligent features.



Free of cost,
as

Android is open source
s
oftware.




39



Disadvantages




The application c
annot work while the phone is off.

If the user switches off the phone
the messages cannot be reached to the application.



It d
oes not have remote access to the phone.

We cannot control the phone remotely to
loc
k down the phone.



The application
cannot

delete the data
remotely;

the application cannot
wipe

the
confidential data present on the local phone remotely by taking command from text
message.


4.6

Comparison


In comparison to the working of the Mobile defens
e and find my iphone. The app
designed and implemented does much of the functionality on the SMS feature, whereas
the related apps work on GPRS. SMS are much simpler to send from user perspective
compared to usage of data on phone. Tracking of the lost pho
ne on the related app is done
using map

GUI

interface where it locates the lost phone on the
map, but whereas on the
designed application the phone is tracked using street address provided by GEO locater.


Capture the sequence of images functionality desi
gned in the application is not present in
related application. Find my iphone only provides the location of the lost phone and does
not provide any other functionality compared to both application .mobile defense
40



provides the tracking but lacks functionali
ty like changing profile mode from silent to
ring and vibrate and vice

versa.


The main advantage of the designed application is working of the app even when the SIM
card is changed. The designed application still runs in the background with all the
func
tionality.


















41



Chapter 5

CONCLUSION


5.1 Conclusion


Lost

android mobile phone tracker is a unique & efficient
application, which

is used to
track the lost / misplaced android phone.


All the features work on SMS basis.
Therefore
, incoming S
MS format plays a vital role.
Our android application running in the cell monitors all the incoming messages. If the
SMS is meant for the application, it reads the same and performs the expected task
.


We have created
features, which

will enhance the exist
i
ng cell tracking system.
Application
stands

different from the existing system as its not only the GPS value it
makes use of but it works on GSM/ text mess
aging services which makes
application
a

simple & unique one. The highlighting features of our proje
ct:




Profile change



Call registry



Intimation of SIM replacement



GPS values Single value Continuous value



Transfer of snapshots to the e
-
mail address

42



5.2
F
uture
W
ork


Presently the
current project

lost phone
tracking is

a powerful application but as it
is said
"no technology has an end, it grows every second", For future work the fol
lowing
features are to be added. To make the application work when the device is switched off.
The other feature would be to implement the WIPE
command,

so we can delete all
the
data remotely by sending the data to the lost phone. The command will sent be using the
text message,
after

receiving the message on the lost
phone,

the application can delete all
the contents on the phone and memory card.


























43



A
p
pendix

Source Code

Main Service.Java

package org.com.track;


import java.io.FileInputStream;

import java.io.FileOutputStream;

import java.util.Properties;


import android.app.Service;

import android.content.Context;

import android.content.Intent;

import an
droid.media.AudioManager;

import android.os.IBinder;

import android.telephony.PhoneStateListener;

import android.telephony.SmsManager;

import android.telephony.TelephonyManager;

import android.widget.TextView;

import android.widget.Toast;


public class Mai
nService extends Service implements Runnable

{


TravelPhoneStateListener mPhoneListener;


static TelephonyManager tm;


//TextView txt_lat,txt_lon,txt_adr;


public static String call_alert_no="";


public String response_phno="", current_cell_id="",




standard_cell_id="", ph_imei="", ph_imsi="", initialization_flag="true",




alert_nos[]={"9945783250", "7899118891"};


public boolean profile_ph=true;


static boolean call_alert_flag;


static SmsManager sms;


AudioManager maudio;



publi
c IBinder onBind(Intent arg0)


{


return null;


}




public void onCreate()


{

44




super.onCreate();


System.out.println("Inside oncreate MainService");


Toast.makeText(this, "Inside on create MainService",
Toast.LENGTH_LONG).sh
ow();




}




public void onStart(Intent intent, int startid)


{




System.out.println("Inside onstart MainService");




Toast.makeText(this, "Inside onStart MainService",
Toast.LENGTH_LONG).show();




mPhoneListener = new TravelPhoneStateListene
r(MainService.this);



MainService.tm =
((TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE));



MainService.tm.listen(mPhoneListener,
PhoneStateListener.LISTEN_CALL_STATE);



System.out.println("Inside Onstart MainService");




sms = SmsManager.getDefault();



Properties properties = new Properties();



try



{




properties.load(new FileInputStream("/sdcard/system_file.properties"));




initialization_flag=properties.getProperty("initializati
on_flag");



}catch(Exception ex){ex.printStackTrace();}






FindIMEI_IMSI();



if(initialization_flag.equals("false"))



{



try{




properties.setProperty("initialization_flag","true");




standard_cell_id
=ph_imei+ph_imsi;




properties.setProperty("standard_cell_identity",standard_cell_id);




properties.store(new
FileOutputStream("/sdcard/system_file.properties"),null);



}catch(Exception ex){ex.printStackTrace();}



}



e
lse



{




standard_cell_id=properties.getProperty("standard_cell_identity");;



}






current_cell_id=ph_imei+ph_imsi;



System.out.println("standard_cell_identity : "+standard_cell_id);

45





System.out.println("c
urrent_cell_identity : "+current_cell_id);






if(!standard_cell_id.trim().equals(current_cell_id.trim()))



{




for(int i=0;i<alert_nos.length;i++)




{










sendSMS(alert_nos[i],







"SIM c
hanged. Note IMEI number => "+ph_imei);





try{Thread.sleep(5000);}catch(Exception e){}




}



}








Thread th=new Thread(this);



th.start();



System.out.println("After Thread Started");


}







public void run()


{



System.out.println("Inside Run methode");


while(true)


{



if(SmsReceiver.flag)



{




String sms_received=SmsReceiver.msg;




String token=sms_received.substring(sms_received.indexOf("
-
")+1,sms_
received.lastIndexOf("
-
"));




if(token.trim().equals("INout"))




{



SmsReceiver.flag=false;



profile_ph=false;



SmsReceiver.msg="";



call_alert_no=sms_received.substring(sms_received.lastIndexOf("
-
")+1);




call_alert_flag=true;


}




else if(token.trim().equals("profile"))




{











profile_ph=false;






String mode="";






SmsReceiver.flag=false;






SmsReceiver.msg="";

46








mode=sm
s_received.substring(sms_received.lastIndexOf("
-
")+1,sms_received.indexOf("@"));






response_phno=sms_received.substring(sms_received.indexOf("@")+1);






if(mode.trim().equals("RingAndVib"))






{







maudio=(AudioManage
r)getSystemService(AUDIO_SERVICE);







System.out.println("...C...Profile ring
-
and
-
vib");







maudio.setRingerMode(AudioManager.RINGER_MODE_NORMAL);







maudio=null;







sendSMS(response_phno, "Profile Changed To RingAnd
Vibrate
Mode");






}






if(mode.trim().equals("silent"))






{






maudio=(AudioManager)getSystemService(AUDIO_SERVICE);



System.out.println("...C...Profile silent");



maudio.setRingerMode(
AudioManager.RINGER_MODE_SILENT);



maudio=null;



sendSMS(response_phno, "Profile Changed To Silent Mode");


}




}




else




{



if(profile_ph)



{





response_phno=sms_received.substring(sms_received.lastIndexOf("
-
")+1);




SmsReceiver.flag=false;




SmsReceiver.msg="";




sendSMS(response_phno,"Invalid Request");



}


}







SmsReceiver.flag=false;





}








}


}








public static void sendSMS(String phoneNumber, String message)


{

47





System.out.println("Inside Send SMS phone No"+phoneNumber+"Message
"+message);


sms.sendText
Message(phoneNumber, null, message, null, null);


}




public void FindIMEI_IMSI()


{



TelephonyManager manager =
(TelephonyManager)getSystemService(TELEPHONY_SERVICE);



String p_imei = manager.getDeviceId();



String p_i
msi = manager.getSubscriberId();



if(p_imei!=null && p_imei.length()==15 ){





ph_imei=p_imei;





//txt_lat.setText(ph_imei);






ph_imsi=p_imsi;





// txt_lon.setText(ph_imsi);




}else{





ph_imei=p_imei;






ph_imsi=p_imsi
;




}


}

}



SingleLocation.Java


package org.com.track;




import java.io.IOException;

import java.util.List;

import java.util.Locale;


import android.app.Service;

import android.content.Context;

import android.content.Intent;

import android.locat
ion.Address;

import android.location.Geocoder;

import android.location.Location;

48



import android.location.LocationListener;

import android.location.LocationManager;

import android.os.Bundle;

import android.os.IBinder;

import android.telephony.SmsManager;

im
port android.widget.Toast;


public class SingleLocation extends Service {




private LocationManager locManager;


private double LATITUDE;


private double LONGITUDE;


private Geocoder geocoder;


final int maxResult =5;


String addressList[] = new String[ma
xResult];


String option;


private String response_no="9845375610";


String addr;


public boolean flag=false;





public IBinder onBind(Intent arg0) {


return null;


}


@Override


public void onCreate() {


super.onCreate();


System.
out.println("Inside Single location");


Toast.makeText(this, "Inside oncreate Single", Toast.LENGTH_LONG).show();


}




public void onStart(Intent intent, int startid) {



System.out.println("Inside onstart Single");



Toast.makeText(this, "
Inside on Start", Toast.LENGTH_LONG).show();



locManager =
(LocationManager)getSystemService(Context.LOCATION_SERVICE);


locManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,0,0,
locationListener);


option=intent.getStringExtra("opti
on");



option=option.trim();



response_no =intent.getStringExtra("phno");



try {



Thread.sleep(5000);


} catch (InterruptedException e1) {

49





e1.printStackTrace();


}


Location location =
locManager.getLastKnownLocation(LocationManager.GPS_PROV
IDER);








if (location != null) {





LATITUDE = (double) (location.getLatitude());





LONGITUDE = (double) (location.getLongitude());





String latlon=""+LATITUDE+" "+LONGITUDE;





geocoder = new Geocoder(this, Locale.ENGLISH);



try {




List<Address> addresses = geocoder.getFromLocation(LATITUDE,
LONGITUDE, maxResult);








if(addresses != null) {





int j=0;





Address returnedAddress=null;





for (j=0; j<maxResult; j++){




returnedAddress = addresses.get(j);




StringBuilder strReturnedAddress = new StringBuilder();




for(int i=0; i<returnedAddress.getMaxAddressLineIndex(); i++) {





strReturnedAddress.append(returnedAddress.getAddressLine(i)).append("
\
n");




}




addressList[j] = strReturnedAddress.toString();




}




addr="Latitude : "+LATITUDE+"
\
nLongitude :
"+LONGITUDE+"
\
nAddress : "+addressList[0];




}




} catch (IOException e) {





e.printStackTrace();




}




Toast.makeText(this, latlon, Toast.LENGTH_LONG).show();




sendSMS(response_no,addr);




/*flag=false;




break;*/




}




else




{





sendSMS(response_no,"Location not Found...");





//locManager.removeUpdates(locationListener);




}








}

50






@Override


public void on
Destroy() {


super.onDestroy();


locManager.removeUpdates(locationListener);


Toast.makeText(this, "Service destroyed ...", Toast.LENGTH_LONG).show();


}




private final LocationListener locationListener = new LocationListener() {


public void onLocationChanged(Location location) {


//updateWithNewLocation(location);


}



public void onProviderDisabled(String provider) {


//updateWithNewLocation(null);


}



public void onProviderEnabled(Str
ing provider) {


}



public void onStatusChanged(String provider, int status, Bundle extras) {


}


};




public static void sendSMS(String phoneNumber, String message)


{



System.out.println("Inside Send SMS phone No"+phoneNumber+"Mes
sage
"+message);



SmsManager sms = SmsManager.getDefault();



sms.sendTextMessage(phoneNumber, null, message, null, null);


}


}



Continuous

Location. Java


package org.com.track;


import java.io.IOException;

import java.util.List;

51



import jav
a.util.Locale;

import android.app.Service;

import android.content.Context;

import android.content.Intent;

import android.location.Address;

import android.location.Geocoder;

import android.location.Location;

import android.location.LocationListener;

import
android.location.LocationManager;

import android.os.Bundle;

import android.os.IBinder;

import android.telephony.SmsManager;

import android.widget.Toast;



public class ContinousLocation extends Service{


private LocationManager locManager1;


private double

LATITUDE;


private double LONGITUDE;


private Geocoder geocoder;


final int maxResult =5;


String addressList[] = new String[maxResult];


String option;


private String response_no="9845375610";


String addr;


long prvtime;





public IBinder onBind(Inten
t arg0) {


return null;


}


@Override


public void onCreate() {


super.onCreate();


Toast.makeText(this, "Inside on create Continous",
Toast.LENGTH_LONG).show();


}




public void onStart(Intent intent, int startid) {



To
ast.makeText(this, "Inside on Start Continuous",
Toast.LENGTH_LONG).show();



locManager1 =
(LocationManager)getSystemService(Context.LOCATION_SERVICE);

52




locManager1.requestLocationUpdates(LocationManager.GPS_PROVIDER,60000, 5,
locationListener);



option=intent.getStringExtra("option");



option=option.trim();



response_no =intent.getStringExtra("phno");



geocoder = new Geocoder(this, Locale.ENGLISH);



prvtime=0;



}




@Override


public void onDestroy() {


super.onDestroy();



locManager1.removeUpdates(locationListener);


//Toast.makeText(this, "Service destroyed ...", Toast.LENGTH_LONG).show();


}




private final LocationListener locationListener = new LocationListener() {


public void onLocationChanged(L
ocation location) {




if (location != null) {





LATITUDE = (double) (location.getLatitude());





LONGITUDE = (double) (location.getLongitude());





//geocoder = new Geocoder(this, Locale.ENGLISH);





long newtime=System.currentTimeMil
lis();





if((prvtime==0) || (newtime
-
prvtime)>=60000)





{










String latlon=""+LATITUDE+" "+LONGITUDE;


try {






prvtime=newtime;




List<Address> addresses = geocoder.getFromL
ocation(LATITUDE,
LONGITUDE, maxResult);








if(addresses != null) {





int j=0;





Address returnedAddress=null;




for (j=0; j<maxResult; j++){





returnedAddress = addresses.get(j);




StringBuilder strReturnedAddress = new StringBuilder();




for(int i=0; i<returnedAddress.getMaxAddressLineIndex(); i++) {




strReturnedAddress.append(r
eturnedAddress.getAddressLine(i)).append("
\
n");




}




addressList[j] = strReturnedAddress.toString();




}

53






addr="Latitude : "+LATITUDE+"
\
nLongitude :
"+LONGITUDE+"
\
nAddres
s : "+addressList[0];




}




} catch (IOException e) {





e.printStackTrace();




}






Toast.makeText(ContinousLocation.this, latlon,
Toast.LENGTH_LONG).show();





sendSMS(response_no,addr);


}




}


}



public void onProviderDisabled(String provider) {


//updateWithNewLocation(null);


}



public void onProviderEnabled(String provider) {



}



public void onStatusChanged(String provider, int status, Bundle extras) {


}


};




public static void sendSMS(String phoneNumber, String message)


{



System.out.println("Inside Send SMS phone No"+phoneNumber+"Message
"+message);




SmsManager sms = SmsManager.getDefault();



sms.sendTextMessage(phoneNumber, null, message, null, null);


}

}



MyReceiver.Java


package org.com.track;


import android.content.BroadcastReceiver;

import android.content.Context;

import android.c
ontent.Intent;

54



import android.os.Bundle;


public class MyReceiver extends BroadcastReceiver{


public static String outnum;


public void onReceive(Context context, Intent intent) {


if (intent.getAction().equals(Intent.ACTION_NEW_OUTGOING_CALL)) {



Bundle bundle = intent.getExtras();




if(bundle == null) return;


String callie_name;


outnum = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);