Anda di halaman 1dari 56

CHAPTER 1

INTRODUCTION

1.1 OVERVIEW OF THE PROJECT


This report explains all the details of development process for the Location tracking of an
Android device using SMS [DroidLocator] software system.

The main feature of DroidLocator is to provide location tracking functionalities to Android


devices using SMS. This application locates device by making device ring and get latitude and
longitude of an Android device. Also the DroidLocator have the capability of authentication to
share the location information with the sender of SMS.

The Android application gives the opportunity to share location information with the users
through SMS. In order to do that, the application receives each SMS, matches contents of SMS
with predefined attention word. If attention word matches with the predefined word than
application makes device ringing or get location details of device and acknowledges the user
through SMS.

MOTIVATION

As a result of technological progress we are facing an incredible variety of possibilities to


communicate regardless of the distance. Smart phones provide a great choice of features that
facilitate the life for the users as well they make it more comfortable.

Every day the features and capabilities of Mobiles are increasing surprisingly. For this reason we
want to create an Android application which gives us the opportunity to improve our knowledge
of Mobile developing. We find this project a great opportunity to combine a lot of technologies
and languages in the same software system, and learn how to work in big projects as a team
member. An important motivation for us is the challenge to solve all the problems that will arise
while the project is developed. In addition, we will try to make the program portable, reliable,
secure, stable, intuitive, etc.
1.2 PROBLEM STATEMENT
A silent phone can be extremely tricky to find. If you're in the habit of losing a silent cell phone,
you may wish to invest in a phone sensor, also known as a phone detector. The user has to follow
tedious procedures to find his theft phone and ultimately user may not find his phone. This
procedure is time consuming too.

1.3 PROJECT DESCRIPTION

1.3.1 Objective:
The objective of this project is to provide location tracking functionalities to Android devices
using SMS. This application locates device by making device ring and get latitude and longitude
of an Android device.

1.3.2 Purpose:
If an android user wants to know the location of Android device then user has to send SMS to
designated device. So that he can locate device either by it making ring or gets actual location of
device using GPS or network provider.

1.3.3 Scope:
This project supports only the Android OS and makes communication with the tracker through
SMS messages only. The Architecture, Security and the accuracy of tracking unit itself are the
scope of this project.

This single application consists of modules like

Ringer
Location tracking
CHAPTER 2

LITERATURE SURVEY

2.1 EXISTING SYSTEM


Ringer

A silent phone can be extremely tricky to find. If you're in the habit of losing a silent cell phone,
you may wish to invest in a phone sensor, also known as a phone detector. These are tools that,
when placed near a cell phone, will actually pick up the call signal and make sounds to indicate
that the phone is somewhere within proximity. If the phone is lost, all you need to do is have
someone call you as you walk around with the sensor until the device begins to indicate that a
call signal is nearby. When you hear the signal, you then have a basic idea of where to start
looking for your cell phone.

Phone Tracking Using IMEI Number:

Every phone comes with a unique International Mobile Equipment Identify Number which can
come in useful to track it in case of loss or theft. This number can be accessed by dialing *#06#
and it is advisable to make a note of it as soon as you purchase your handset. In case the phone
gets stolen, file an FIR with the police and give them its identity number.

Pass on a copy of the FIR and IMEI number to your service provider who will then be able to
track your handset. With its IMEI number, a device can be traced even if it is being used with
another SIM or even if it is switched off. Once the handset is located, request your service
provider to block it from being used till you are able to get your hands on it again.

2.2 PROPOSED SYSTEM

Ringer

Using simple SMS commands you can ring your Android Device even though it is in silent mode
and thus locate your device locally.
Location Tracking

In this proposed system you can locate any phone that has been misplaced or stolen. Once
the App is installed on the phone, it can be located by sending SMS with predefined
keyword. The system gets you current updated location.

2.3 SOFTWARE DEVELOPMENT TOOL

Introduction to android:
Android is a software bunch comprise not only operating system but also middleware and
key applications. Android Inc was founded in Palo Alto of California, U.S. by Andy Rubin,
Rich miner, Nick sears and Chris White in 2003. Later Android Inc. was acquired by Google in
2005. After original release there have been number of updates in the original version of
Android.

Features and Specification


Android is a powerful Operating System supporting a large number of applications in Smart
Phones. These applications make life more comfortable and advanced for the users. Hardwares
that support Android are mainly based on ARM architecture platform. Some of the current
features and specifications of android are:
Android comes with an Android market which is an online software store. It was developed
by Google. It allows Android users to select, and download applications developed by third
party developers and use them. There are around 2.0 lack+ games, application and widgets
available on the market for users.

Applications
These are the basics of Android applications:
• Android applications are composed of one or more application components (activities,
services, content providers, and broadcast receivers)
• Each component performs a different role in the overall application behavior, and each one
can be activated individually (even by other applications)
• The manifest file must declare all components in the application and should also declare all
application requirements, such as the minimum version of Android required and any hardware
configurations required
• Non-code application resources (images, strings, layout files, etc.) should include
alternatives for different device configurations (such as different strings for different languages)
Building blocks to an Android application

There are four building blocks to an Android application:

Activity
Broadcast Intent Receiver

Service

Content Provider

Activity
Activities are the most common of the four Android building blocks. An activity is usually
a single screen in your application. Each activity is implemented as a single class that extends
the Activity base class. Your class will display a user interface composed of Views and
respond to events. Most applications consist of multiple screens. For example, a text messaging
application might have one screen that shows a list of contacts to send messages to, a second
screen to write the message to the chosen contact, and other screens to review old messages or
change settings. Each of these screens would be implemented as an activity. Moving to another
screen is accomplished by a starting a new activity. In some cases and activity may return a
value to the previous activity -- for example an activity that lets the user pick a photo would
return the chosen photo to the caller.

Intent and Intent Filters


Android uses a special class called Intent to move from screen to screen. Intent describes what an
application wants done. The two most important parts of the intent data structure are the action
and the data to act upon. Typical values for action are MAIN (the front door of the
application), VIEW, PICK, EDIT, etc. The data is expressed as a URI. For example, to view
contact information for a person, you would create intent with the VIEW action and the data set
to a URI representing that person.
There is a related class called an Intent Filter. While an intent is effectively a request to do
something, an intent filter is a description of what intents an activity (or Broadcast Receiver, see
below) is capable of handling. An activity that is able to display contact information for a
person would publish an Intent Filter that said that it knows how to handle the action
VIEW when applied to data representing a person. Activities publish their Intent Filters in the
AndroidManifest.xml file.
. The new activity is informed of the intent, which causes it to be launched. The process
of resolving intents happens at run time when start Activity is called, which offers two key
benefits:

Activities can reuse functionality from other components simply by making a request in
the form of an Intent

Activities can be replaced at any time by a new Activity with an equivalent Intent Filter

BROADCAST INTENT RECEIVER


You can use a Broadcast Receiver when you want code in your application to execute in reaction
to an external event, for example, when the phone rings, or when the data network is
available, or when it's midnight. Broadcast Receivers do not display a UI, although they
may use the Notification Manager to alert the user if something interesting has happened.
Broadcast Receivers are registered in AndroidManifest.xml, but you can also register them
from code using Context.registerReceiver (). Your application does not have to be running
for its BroadcastReceivers to be called; the system will start your application, if necessary,
when a BroadcastReceiver is triggered. Applications can also send their own intent broadcasts
to others with Context.sendBroadcast ().

SERVICE
A Service is code that is long-lived and runs without a UI. A good example of this is a
media player playing songs from a play list. In a media player application, there would
probably be one or more activities that allow the user to choose songs and start playing them.
However, the music playback itself should not be handled by an activity because the user
will expect the music to keep playing even after navigating to a new screen. In this case, the
media player activity could start a service using Context.startService () to run in the
background to keep the music going. The system will then keep the music playback service
running until it has finished. Note that you can connect to a service (and start it if it's not
already running) with the Context.bindService ()
method. When connected to a service, you can communicate with it through an interface
exposed by the service. For the music service, this might allow you to pause, rewind, etc.

CONTENT PROVIDER
Applications can store their data in files, an SQLite database, or any other mechanism that
makes sense. A content provider, however, is useful if you want your application's data to
be shared with other applications. A content provider is a class that implements a standard set
of methods to let other applications store and retrieve the type of data that is handled by
that content provider.
Not every application needs to have all four, but your application will be written with
some combination of these.
All the components needed for android application should listed in an xml file called
AndroidManifest.xml. This is an XML file where you declare the components of your
application and what their capabilities and requirements are.

Storing, Retrieving and Exposing Data


A typical desktop operating system provides a common file system that any application can
use to store and read files that can be read by other applications. Android uses a different
system on Android, all application data are private to that application. However, Android
also provides a standard way for an application to expose its private data to other
applications. This section describes the many ways that an application can store and retrieve
data, expose its data to other applications, and also how you can request data from other
applications that expose their data.
Android provides the following mechanisms for storing and retrieving data:

Preferences
A lightweight mechanism to store and retrieve key/value pairs of primitive data types.
This is typically used to store application preferences.

Files
You can store your files on the device or on a removable storage medium. By default,
other applications cannot access these files.

Databases
The Android APIs contain support for SQLite. Your application can create and use a
private SQLite database. Each database is private to the package that creates it.

Content Providers
A content provider is an optional component of an application that exposes read/write
access to an application's private data, subject to whatever restrictions it wants to
impose. Content providers implement a standard request syntax for data, and a
standard access mechanism for the returned data. Android supplies a number of
content providers for standard data types, such as personal contacts.

Network
Don't forget that you can also use the network to store and retrieve data.

Security and Permissions in Android

Android is a multi-process system, where each application (and parts of the system) runs in its
own process. Most security between applications and the system is enforced at the process level
through standard Linux facilities, such as user and group IDs that are assigned to applications.
Additional finer-grained security features are provided through a "permission" mechanism that
enforces restrictions on the specific operations that a particular process can perform, and per-URI
permissions for granting ad-hoc access to specific pieces of data.

System Architecture

A central design point of the Android security architecture is that no application, by default, has
permission to perform any operations that would adversely impact other applications, the
operating system, or the user. This includes reading or writing the user's private data such as
contacts or e-mails, reading or writing another application's files, performing network access,
keeping the device awake, etc.

An application's process is a secure sandbox. It can't disrupt other applications, except by


explicitly declaring the permissions it needs for additional capabilities not provided by the basic
sandbox. These permissions it requests can be handled by the operating in various ways,
typically by automatically allowing or disallowing based on certificates or by prompting the
user. The permissions required by an application are declared statically in that application, so
they can be known up-front at install time and will not change after that.

Application Signing

All Android applications (.apk files) must be signed with a certificate whose private key is
held by their developer. This certificate identifies the author of the application. The
certificate does not need to be signed by a certificate authority: it is perfectly allowable, and
typical, for Android applications to use self-signed certificates. The certificate is used only to
establish trust relationships between applications, not for wholesale control over whether an
application can be installed. The most significant ways that signatures impact security is by
determining who can access signature-based permissions and who can share user IDs.

User IDs and File Access

Each Android package (.apk) file installed on the device is given its own unique Linux user
ID, creating a sandbox for it and preventing it from touching other applications (or other
applications from touching it). This user ID is assigned to it when the application is installed
on the device, and remains constant for the duration of its life on that device.
Using Permissions

A basic Android application has no permissions associated with it, meaning it can not do
anything that would adversely impact the user experience or any data on the device. To make
use of protected features of the device, you must include in your AndroidManifest.xml one or
more
<uses-permission> tags declaring the permissions that your application needs.

The permissions provided by the Android system can be found at Manifest.permission.


Any application may also define and enforce its own permissions, so this is not a
comprehensive list of all possible permissions.

A particular permission may be enforced at a number of places during your program's operation:

At the time of a call into the system, to prevent an application from


executing certain functions.

When starting an activity, to prevent applications from launching activities


of other applications.

Both sending and receiving broadcasts, to control who can receive your
broadcast or who can send a broadcast to you.

When accessing and operating on a content

provider. Binding or starting a service

Declaring and Enforcing Permissions

To enforce your own permissions, you must first declare them in your AndroidManifest.xml
using one or more <permission> tags.

The <protection Level> attribute is required, telling the system how the user is to be
informed of applications requiring the permission, or who is allowed to hold that permission,
as described in the linked documentation.
The <permission Group> attribute is optional, and only used to help the system display
permissions to the user. You will usually want to set this to either a standard system group (listed
in android.Manifest.permission_group) or in more rare cases to one defined by yourself. It is
preferred to use an existing group, as this simplifies the permission UI shown to the user.

Note that both a label and description should be supplied for the permission. These are string
resources that can be displayed to the user when they are viewing a list of permissions
(android:label) or details on a single permission ( android:description). The label should be short,
a few words describing the key piece of functionality the permission is protecting. The
description should be a couple sentences describing what the permission allows a holder to do.
Our convention for the description is two sentences, the first describing the permission, the
second warning the user of what bad things can happen if an application is granted the
permission.

Development Process for Android Application

To develop apps for Android devices, you use a set of tools that are included in the Android
SDK. Once you've downloaded and installed the SDK, you can access these tools right from
your Eclipse IDE, through the ADT plugin, or from the command line. Developing with Eclipse
is the preferred method because it can directly invoke the tools that you need while developing
applications.

The basic steps for developing applications (with or without Eclipse) are shown in figure 1. The
development steps encompass four development phases, which include:

1. Setup
During this phase you install and set up your development environment. You also create Android
Virtual Devices (AVDs) and connect hardware devices on which you can install your
applications.

2. Development
During this phase you set up and develop your Android project, which contains all of the source
code and resource files for your application
3. Debugging and Testing
During this phase you build your project into a debuggable .apk package that you can install and
run on the emulator or an Android-powered device. If you are using Eclipse, builds are generated
each time you project is saved. If you're using another IDE, you can build your project using Ant
and install it on a device using adb.

4. Publishing
During this phase you configure and build your application for release and distribute your
application to users.
2. Introduction to Google Services for Android Developer

Google APIs Console


The Google APIs Console is a web interface for managing and viewing traffic data,
authentication, and billing information for the Google APIs that are used by your project. In the
APIs Console, a project is a named collection of information about your application: auth
information, team members' email addresses, the Google APIs that your application uses, and so
on. You can create your own projects, or be added as a viewer or editor to existing projects
created by other developers. At the top of the Console is a dropdown list that shows the projects
that you have access to, as well as commands for creating and managing projects

The Console lets you see and manage the following project
information:
Activated APIs
Activate one or more APIs to enable traffic monitoring, filtering, and billing, and API-specific
pages for your project.

Traffic information
The Console reports traffic information for each activated API. Additionally, you can cap or
filter usage by API.

Project keys
Each project is identified by either an API key or an OAuth 2.0 token. Use this key/token in your
API requests to identify the project, in order to record usage data, enforce your filtering
restrictions, and bill usage to the proper project. You can use the Console to generate or revoke
API keys or OAuth 2.0 certificates to use in your application.

Steps to enable API access

1. Open Google API console window with your Google account.


2. Click on API Access and go to create new Android key, enter the SHA1 certificate
Fingerprint.
SHA1 certificate fingerprint accessed by the following command:

keytool -list -v -keystore C:\Users\leon\.android\debug.keystore -alias


androiddebugkey -storepass android -keypass android

It displays three keys SHA1, SHA2, MD5, user has to copy SHA1 key and paste it
into configure android key window
3. Now your API key is generated as shown below which can be used to access Google
APIs.
4. Now click on Services tap to activate various services provided by Google like Google
map, Location API, calendar API etc. There are number of services available, enable the
services which you want to use in your project .

Services used in my project are:

5. Now with the help of your API key you can use activated services in your project.

.
Google Maps Android v2

With the Google Maps Android API, you can add maps based on Google Maps data to your
application. The API automatically handles access to Google Maps servers, data downloading,
map display, and response to map gestures. You can also use API calls to add markers, polygons,
and overlays to a basic map, and to change the user's view of a particular map area. These objects
provide additional information for map locations, and allow user interaction with the map. The
API allows you to add these graphics to a map:

Icons anchored to specific positions on the map (Markers).


Sets of line segments (Polylines).
Enclosed segments (Polygons).
Bitmap graphics anchored to specific positions on the map (Ground Overlays).
Sets of images which are displayed on top of the base map tiles (Tile
Overlays).

Steps to use Google Map in Android Application:


1. Select File > Import > Android > Existing Android Code Into Workspace and click Next.
2. Select Browse..., enter <android-sdk-
folder>/extras/google/google_play_services/libproject/google-play-services_lib, and
click Finish.
Once you have installed Google Play services, you can view the sample code, or run the sample
app locally. The sample app is an Eclipse project that you can run on your device as follows:

1. Select File > Import > Android > Existing Android Code Into Workspace and click Next.
2. Select Browse..., enter <android-sdk-
folder>/extras/google/google_play_services/samples/maps, and click Finish.
3. Select Project > Properties, select Java Build Path, and navigate to Libraries.
4. Select Add External Jars, include the following jar files, and click OK: + <android-sdk-
folder>/extras/android/compatibility/v4/android-support-v4.jar
5. Add your own Google Maps Android API key.
6. Select Run > Run to test the sample app.

The Map Object


The Google Maps Android API allows you to display a Google map in your Android application.
These maps have the same appearance as the maps you see in the Google Maps for Mobile
(GMM) app, and the API exposes many of the same features. Two notable differences between
the GMM Application and the Maps displayed by the Google Maps Android API are:

Map tiles displayed by the API don't contain any personalized content, such as
personalized smart icons.
Not all icons on the map are clickable. For example, transit station icons can’t be clicked.
However, markers that you add to the map are clickable, and the API has a listener callback
interface for various marker interactions.
In addition to mapping functionality, the API also supports a full range of interactions that are
consistent with the Android UI model. For example, you can set up interactions with a map by
defining listeners that respond to user gestures.

The key class when working with a Map object is the GoogleMap class. GoogleMap models the
map object within your application. Within your UI, a map will be represented by either
a MapFragment or MapView object.
GoogleMap handles the following operations automatically:
Connecting to the Google Maps service.
Downloading map tiles.
Displaying tiles on the device screen.
Displaying various controls such as pan and zoom.
Responding to pan and zoom gestures by moving the map and zooming in or out.
In addition to these automatic operations, you can control the behavior of maps with objects and
methods of the API. For example, Google Map has callback methods that respond to keystrokes
and touch gestures on the map. You can also set marker icons on your map and add overlays to
it, using objects you provide to Google Map.

Google Direction API

The Google Directions API is a service that calculates directions between locations using an
HTTP request. You can search for directions for several modes of transportation, include transit,
driving, walking or cycling. Directions may specify origins, destinations and waypoints either as
text strings (e.g. "Chicago, IL" or "Darwin, NT, Australia") or as latitude/longitude coordinates.
The Directions API can return multi-part directions using a series of waypoints.

This service is generally designed for calculating directions for static (known in advance)
addresses for placement of application content on a map; this service is not designed to respond
in real time to user input, for example. For dynamic directions calculations (for example, within
a user interface element), consult the documentation for the JavaScript API V3 Directions
Service.
Calculating directions is a time and resource intensive task. Whenever possible, calculate known
addresses ahead of time (using the service described here) and store your results in a temporary
cache of your own design.

Direction Responses

Directions responses are returned in the format indicated by the output flag within the URL
request's path.

1. JSON Output

2. XML Output

2.3.1 Introduction to Java

Java is a programming language created by James Gosling from Sun Microsystems (Sun) in
1991. The first publicly available version of Java (Java 1.0) was released in 1995. Sun
Microsystems was acquired by the Oracle Corporation in 2010. Over time new enhanced
versions of Java have been released. The current version of Java is Java 1.7 which is also known
as Java 7. From the Java programming language the Java platform evolved. The Java platform
allows software developers to write program code in other languages than the Java programming
language and still runs on the Java virtual machine. The Java platform is usually associated with
the Java virtual machine and the Java core libraries.

Java Virtual machine


The Java virtual machine (JVM) is a software implementation of a computer that executes
programs like a real machine. The Java virtual machine is written specifically for a specific
operating system, e.g. for Linux a special implementation is required as well as for Windows.

Java Runtime Environment vs. Java Development Kit

A Java distribution comes typically in two flavors, the Java Runtime Environment (JRE) and
the Java Development Kit (JDK).The Java runtime environment (JRE) consists of the JVM and
the Java class libraries and contains the necessary functionality to start Java programs. The JDK
contains in addition the development tools necessary to create Java programs. The JDK consists
therefore of a Java compiler, the Java virtual machine, and the Java class libraries.
Characteristics of Java

The target of Java is to write a program once and then run this program on multiple operating
systems.

Java has the following properties:

Platform independent: Java programs use the Java virtual machine as abstraction and do not
access the operating system directly. This makes Java programs highly portable. A Java
program (which is standard complaint and follows certain rules) can run unmodified on all
supported platforms, e.g. Windows or Linux.

Object-orientated programming language: Except the primitive data types, all elements in
Java are objects.

Strongly-typed programming language: Java is strongly-typed, e.g. the types of the used
variables must be pre-defined and conversion to other objects is relatively strict, e.g. must be
done in most cases by the programmer.

Interpreted and compiled language: Java source code is transferred into the byte code format
which does not depend on the target platform. These byte code instructions will be interpreted
by the Java Virtual machine (JVM). The JVM contains a so called Hotspot-Compiler which
translates performance critical byte code instructions into native code instructions.

Automatic memory management: Java manages the memory allocation and de-allocation for
creating new objects. The program does not have direct access to the memory. The so-called
garbage collector deletes automatically objects to which no active pointer exists.

2.3.2 Android
Android is a software platform and operating system for mobile devices. Android is available as
open source. It allows developers to write managed code in the Java language, controlling the
device via Google-developed Java libraries.
Android SDK was released by Open Handset Alliance in the month of November of the year
2007. Android is actually developed using the kernel of Linux 2.6 and the highlighting features
of Android include the following [7]:

• No fees for licensing, distribution and release approval


• GSM, 3G EDGE networks for telephony
• IPC message passing
• Background processes and applications
• Shared data stores
• Complete multimedia hardware control
• API’s for location based services such as GPS.

2.3.2.1 Architecture of Android OS

The skeleton of Android framework and its constituents are shown in the following figure:

Figure 2.1: Architecture of Android OS


Applications Layer
Android ships with a set of core applications including an email client, SMS program, calendar,
maps, browser, contacts and others. All applications are built using the Java. Each of the
application aims at performing a specific task that it is actually intended to do.

Application Framework Layer


The next layer is the application framework. This includes the programs that manage the phone’s
basic functions like resource allocation, telephone applications, switching between processes or
programs and keeping track of the phone's physical location. Application developers have full
access to Android's application framework. This allows them to take advantage of Android's
processing capabilities and support features when building an Android application. We can think
of the application framework as a set of basic tools with which a developer can build much more
complex tools.
Libraries Layer
The next layer contains the native libraries of Android. These shared libraries are all written in C
or C++, compiled for the particular hardware architecture used by the phone and preinstalled by
the phone vendor.

Android Runtime Layer

Android Runtime layer includes Dalvik Virtual Machine (DVM) and a set of core java libraries.
Every Android app gets its own instance of DVM. Dalvik has been written so that a device can
run multiple virtual machines efficiently and it executes files with .dex (Dalvik Executable
Format) extension optimized for minimum memory.

2.3.2.2 Components of Android

The basic components of an Android application include Activity, Broadcast Receiver, Service,
and Content Provider. Each of these which when used forany application has to be declared in
the AndroidManifest.xml. The user interface of the component is determined by the Views. For
the communication among these basic components we use Intents and Intent filters which play
crucial role during app development.
Android
Application

Broadcast Content
Activity Service
Receiver Provider
Figure 2.2: Structure of Android Components

Activity
An Activity is, fundamentally, an object that has a lifecycle. An Activity is a chunk of code that
does some work; if necessary, that work can include displaying a UI to the user. It doesn't have
to, though-some Activities never display UIs. Typically, we will designate one of our
application's Activities as the entry point to our application.

Broadcast Receiver
Broadcast Receiver is yet another type of componentthat can receive and respond to any
broadcast announcements.
Service
A Service is a body of code that runs in the background. It can run in its own process, or in the
context of another application's process, dependingon its needs. Other components "bind" to a
Service and invoke methods on it via remote procedure calls. An example of a Service is a media
player; even when the user quits the media-selection UI, she probably still intends for her music
to keep playing. A Service keeps the music going even when the UI has completed.

Content Provider
Content Provider is a data storehouse that providesaccess to data on the device; the classic
example is the Content Provider that's used to access the user's list of contacts. Our application
can access data that other applications have exposed via a Content Provider, and we can also
define our own Content Providers to expose data of our own.

2.3.2.3 Location based Services in Android


Android's Network Location Provider determines user location using cell tower and Wi-Fi
signals, providing location information in a way that works indoor and outdoor, responds faster,
and uses less battery power. The purpose of location-based services is to find the Physical
location of the device. Access to the location-based services is handled by the LocationManager
system Service. To access the Location Manager, request an instance of the
LOCATION_SERVICE using the get System Service() method. Current Location can be fetched
using two ways:
1. GPS (Global Positioning System)
2. Network Service Location

GPS (Global Positioning System)


The Global Positioning System (GPS) uses a constellation of 24 satellites orbiting the earth. GPS
finds the user position by calculating differences in the times the signals, from different satellites,
take to reach the receiver. GPS signals are decoded, so the smart phone must have in-built GPS
receiver. To get access to GPS hardware of android we request using following statement
LocationManager.GPS_PROVIDER;

Figure 2.3: Architecture of A-GPS System

Network Service Location


The current cell ID is used to locate the Base Transceiver Station (BTS) that the mobile phone is
interacting with and the location of that BTS. It is the most basic and cheapest method for this
purpose as it uses the location of the radio base station that the cell phone is connected to. A
GSM cell may be anywhere from 2 to 20 kilometers in diameter. Other approaches used along
with cell ID can achieve location granularity within 150 meters. The granularity of location
information is poor due to Wide Cell Range. The advantage is that no additional cost is attached
to the handset or to the network to enable this service.
To get access to Network Provider android we request using following statement
LocationManager.NETWORK_PROVIDER;

Geocoding and Reverse Geocoding


Geocoding lets us translate between street addresses and longitude/latitude map coordinates. This
can give us a recognizable context for the locations and coordinates used in location-based
services and map-based activities. The Geocoding lookups are done on the server, so our
applications will require us to include an Internet uses-permission in our manifest. The Geocoder
class provides access to two geocoding functions:
• Forward Geocoding
Forward Geocoding converts the address into latitude and longitude.

• Reverse Geocoding
Reverse Geocoding converts latitude and longitude to corresponding address
2.3.3 Eclipse

Eclipse is a multi-language software development environment comprising an integrated


development environment (IDE) and an extensible plug-in system. It can be used to develop
applications in Java and, by means of various plug-ins, other programming languages like c, c++,
android etc….

Features

1) It is an open source.
2) It is strongly recommended by Android developer.
3) It is directly linked with compiler, so we don’t need to compile the program
4) It has good UI(user interface)
CHAPTER 3

SOFTWARE DEVELOPMENT LIFE CYCLE

3.1 V-MODEL

Fig 3.1: V-Model

The V-model represents a software development process (also applicable to hardware


development) which may be considered an extension of the waterfall model. Instead of moving
down in a linear way, the process steps are bent upwards after the coding phase, to form the
typical V shape. The V-Model demonstrates the relationships between each phase of the
development life cycle and its associated phase of testing. The horizontal and vertical axes
represents time or project completeness (left-to-right) and level of abstraction (coarsest-grain
abstraction uppermost), respectively.
3.1.1 Verification Phases

Requirements Analysis

The user requirements document will typically describe the system’s functional, interface,
performance, data, security, etc. requirements as expected by the user. It is used by business
analysts to communicate their understanding of the system to the users. The users carefully
review this document as this document would serve as the guideline for the system designers in
the system design phase.

System Design
Systems design is the phase where system engineers analyze and understand the business of the
proposed system by studying the user requirements document. They figure out possibilities and
techniques by which the user requirements can be implemented. If any of the requirements are
not feasible, the user is informed of the issue. A resolution is found and the user requirement
document is edited accordingly.

Architecture Design

The phase of the design of computer architecture and software architecture can also be referred to as high-
level design. The baseline in selecting the architecture is that it should realize all which typically consists
of the list of modules, brief functionality of each module, their interface relationships, dependencies,
database tables, architecture diagrams, technology details etc. The integration testing design is carried out
in the particular phase.

Module Design

The module design phase can also be referred to as low-level design. The designed system is
broken up into smaller units or modules and each of them is explained so that the programmer
can start coding directly. The low level design document or program specifications will contain a
detailed functional logic of the module, in pseudo code:
Database tables, with all elements, including their type and
size. All interface details with complete API references.
All dependency
issues. Error message
listings.
Complete input and outputs for a module.

3.1.2 Validation Phases


Unit testing

Try to detect if all application functions work correct individually.

Integration testing

Try to detect if all these functions are accessible in our application and they are properly
integrated.

System Testing

System testing checks if the integrated product meets the specified requirements.

Acceptance Testing

Acceptance testing is the phase of testing used to determine whether a system satisfies the
requirements specified in the requirements analysis phase. The acceptance test design is derived
from the requirements document. The acceptance test phase is the phase used by the customer to
determine whether to accept the system or not.
CHAPTER 4

SOFTWARE REQUIREMENT SPECIFICATION

4.1 INTRODUCTION

Software Requirement Specification (SRS) is the starting point of the software development
activity. It is a complete description of the behavior of a system which is to be developed. The
SRS document enlists all necessary requirements for project development. To derive the
requirements we need to have clear and thorough understanding of the product which is to be
developed. This is prepared after detailed communication with project team and the customer.

A SRS is a comprehensive description of the intended purpose and environment


for software under development. The SRS fully describes what the software will do and how it
will be expected to perform.

An SRS minimizes the time and effort required by developers to achieve desired goals and also
minimizes the development cost. A good SRS defines how an application will interact with
system hardware, other programs and human users in a wide variety of real-world situations.

Characteristics of SRS:

Correct - An SRS is correct if, and only if, every requirement stated therein is one that
the software shall meet. Traceability makes this procedure easier and less prone to error.
Unambiguous - An SRS is unambiguous if, and only if, every requirement stated therein
has only one interpretation. As a minimum, this requires that each characteristic of the
final product be described using a single unique term.
Verifiable – It is verifiable if there exists some finite cost-effective process with which a
person or machine check whether software product meets requirements.
Consistent - Consistency refers to internal consistency. If an SRS does not agree with
some higher-level document, such as a system requirements specification, then it is not
correct. An SRS is internally consistent if, and only if, no subset of individual
requirements described in it conflict.
Modifiable – SRS is said to be modifiable if its structure and style are such that any
changes to the requirements can be made easily, completely and consistently while
retaining the structure and style.
Traceable – SRS is said to be traceable if the origin of each of its requirements is clear
and it facilitates the referencing of each requirement in future enhancement.
Ranked for importance or stability – SRS is ranked for importance or stability if each
requirement in it has an identifier to indicate either the importance or stability of that
particular requirement.

4.2 FUNCTIONAL REQUIREMENTS

Modules: This application contains two important modules.

Ringer

Location Tracker

1. Ringer

Be able to recognize the attention word received through SMS.


Be able to handle the phone state to ring automatically.
Be able to send phone state through SMS.

2. Location Tracking

Be able to detect the current location of Android device.


Be able to retrieve the device, SIM card & location details.
Be able to send retrieved details through SMS.
4.3 NON FUNCTIONAL REQUIREMENTS

Performance Requirements:

Application must respond within 5 seconds excluding GPS enabling time. The user must use the
required option to get the information of the users.

Reliability:

This application has various other features like SMS this can be extensible with many features in
the user devices.

Availability:

This proposed system find extended application who are installed this application those users can
be get the location of the device and send the details back to requesting phone.

Maintainability:

Since we are using JAVA software to support our application no maintenance is very easy and
economical also.

Portability:

The project is built using JAVA and can be run on any device which uses android OS.

Safety Requirements:

It is better to use the antivirus and keep on checking for the latest updates of the
application.

Security Requirements:

The application will prompt the user for upgrading and downloading new features
updated by the developer.
4.4 SYSTEM REQUIREMENTS

HARDWARE REQUIREMENTS
On Developer Side

Processor : Dual core or above.

RAM : 4GB.

Hard disk : 40GB or above.

Monitor : 15’’ LCD or CRT Monitor or above.

Keyboard : Standard windows keyboard

On Client Side

Device : GPS enabled Android OS mobile.

SOFTWARE REQUIREMENTS

Development Kit: Android SDK 2.3, Java JDK 1.6.

Languages : Java.

IDE : Eclipse Helios, Android Emulator.

Platform : Window 7/XP.

4.5 USE CASE DIAGRAM

A use case is a coherent piece of functionality that a system provides interacting with actors. It
describes a system which involves a set of use cases and a set of actors.A use case diagram
summarizes who uses our application or system and what they can do with it.
By use case diagram we can achieve,

The scenario in which our application interacts with people, organizations or external
systems.
The goals that it helps those actors to
achieve. The scope of our system.

The components included in it are as follows:

Actor - Actors represent classes of users, organizations, and external systems that interact
with your system.
Use Cases - Use cases represent the activities that actors perform with the help of your
system.

Fig 4.1 Use Case Diagram


CHAPTER 5

SYSTEM DESIGN

System design is the solution to the creation of a new system. This phase is composed of several
systems. This phase focuses on the detailed implementation of the feasible system. It emphasis
on translating design specifications to performance specification is system design. System design
has two phases of development logical and physical design.

During logical design phase the analyst describes inputs (sources), outputs (destinations),
databases (data stores) and procedures (data flows) all in a format that meats the uses
requirements. The analyst also specifies the user needs and at a level that virtually determines the
information flow into and out of the system and the data resources. Here the logical design is
done through data flow diagrams and database design.

The physical design is followed by physical design or coding. Physical design produces the
working system by defining the design specifications, which tell the programmers exactly what
the candidate system must do.

The programmers write the necessary programs that accept input from the user, perform necessary
processing on accepted data through call and produce the required report on a hard copy or display it on
the screen.

5.1 SYSTEM ARCHITECTURE

5.1.1 Architectural Design:

3-Tier architecture is also called layered architecture. Some people called it n-tier architecture.
Layer architectures are essentially objects and work in object oriented environment. 3-tier
architecture is a very well-known architecture in the world of software development, it doesn't
matter whether you are developing web based application or desktop based, it is the best
architecture to use.
3-Tier architecture consists of
1) UI or Presentation Layer
2) Business Access Layer or Business Logic Layer
3) Data Access Layer

Presentation Layer:
Presentation layer consists of pages like .java or desktop based form where data is
presentedtousersorgettinginputfrom users.

BusinessLogiclayerorBusinessAccessLayer

Business logic layer contains all of the business logic. Its responsibility is to validate the business
rules of the component and communicating with the Data Access Layer. Business Logic Layer is
the class in which we write functions that get data from Presentation Layer and send that data to
database through Data Access Layer.

Data Access Layer:

Data Access Layer is also the class that contains methods to enable business logic layer to
connect the data and perform desired actions. These desired actions can be selecting, inserting,
updating and deleting the data. DAL accepts the data from BAL and sends it to the database or
DAL gets the data from the database and sends it to the business layer. In short, its responsibility
is to communicate with the backend structure.

Fig 5.1: Illustration of3-Tier Architecture with Diagram.


5.2 UML DIAGRAMS

5.2.1 State Machine Diagram

A State diagram is a graph whose nodes are states and whose directed arcs are transitions
between the states. It specifies the state sequences caused by event sequences. State names must
be unique within the scope of the diagram. State diagrams are used to give an abstract
description of the behavior of a system. This behavior is analyzed and represented in series of
events that could occur in one or more possible states.

Fig 4.2: State Diagram

5.2.2 Activity Diagram

Activity Diagram shows the sequence of steps that make up complex process. It shows the flow
of control, similar to sequence but focuses on operation rather than on objects.

The components used in this are as follows:

o Rounded Rectangle – It indicates the process.


o Arrow – It indicates transition line.
o Rhombus – It indicates the decision.
o Bars – It represents the start or end of concurrent activities.
o Solid Circle – It represents the initial state of workflow.
o Encircled Black Circle –It represents the final state of workflow.

Fig 5.2 Activity Diagram

5.2.3 Sequence Diagram

A Sequence diagram shows how a set of objects communicate with each other to perform a
complex task. This type of diagram allows the other developer to verify that the interaction is
correct.
A Sequence diagram shows, as parallel vertical lines (lifelines), different processes or objects
that live simultaneously, and as horizontal arrows, the messages exchanged between them, in
the order in which they occur. This allows the specification of simple runtime scenarios in a
graphical manner.

Fig 5.3 Sequence Diagram

5.2.3 Class Diagram


In software engineering, a class diagram in the Unified Modeling Language (UML) is a type of
static structure diagram that describes the structure of a system by showing the system's classes,
their attributes, operations (or methods), and the relationships among objects.

In the diagram, classes are represented with boxes which contain three parts:

The top part contains the name of the class


The middle part contains the attributes of the class
The bottom part gives the methods or operations the class can take or undertake
Fig 5.4 Class Diagram
CHAPTER6

IMPLEMENTATION

6.1 INTRODUCTION:

After designing the new system, the whole system is required to be converted into computer
understanding language. Coding the new system into computer programming language does this.
It is an important stage where the defined procedures are transformed into control specifications
by the help of a computer language. This is also called the programming phase in which the
programmer converts the program specifications into computer instructions, which we refer
as programs. The programs coordinate the data movements and control the entire process in a
system.

It is generally felt that the programs must be modular in nature. This helps in fast development,
maintenance and future change, if required.

The validity and proper functionality of all the modules of the developed application is assured
during the process of implementation. Implementation is the process of assuring that the
information system is operational and then allowing user to take over its operation for use and
evaluation.

Implementation is the stage in the project where the theoretical design is turned into a working
system. The implementation phase constructs, installs and operated the new system. The most
crucial stage in achieving a new successful system is that it works effectively and efficiently.

6.2 MODULES

1. Send attention word text:


 Perform predefined action according to alert word and abort
broadcasting.
2. Send text other than attention word:
 Allow broadcasting
3. Make device ring.
4. Acknowledges device ringing status to the user by sending SMS.
5. Get latitude and longitude of device and create a Google map link.
6. Send device location to sender of SMS.
7. Exit Application

6.2.1 IMPLEMENTATION OF MODULES

6.2.1.1 Broadcast receiver that alerts application when each new SMS arrived.
This module decides which action has to perform when attention word matches with the keyword
“ringmydevice”. If it is matched then it starts activity which enables device ringing. If attention
word matches with the keyword “getlocation” then it starts activity which retrieves location of
device and sends information to the sender of SMS. At the same time it aborts message
broadcasting so that message can’t be reached to inbox of native messaging application.

If attention word is not matched with the specified key word than it simply allow broadcasting so
that message can be reached to inbox of native messaging application.

Step 1: START
Step 2:SMS received.
Step 3:Checks attention word.
Step 4:If attention word matches with “ringmydevice” then starts ringing activity and abort
broadcasting.
Step 5:If attention word matches with “getlocation” then starts ringing activity and abort
broadcasting.
Step 6: If attention word not matched then allow broadcasting.
Step 7:End
6.2.1.2 Enable device ringing and acknowledges the user.
Received attention word text is “ringmydevice”:
In this module we provide the functionality of making device ringing by sending an attention
word to android device. DroidLocator recognizes the keyword “ringmydevice” and makes
device ringing no matter it is in silent or vibrate mode. So user can locate his phone.
Step 1: START
Step 2:Checks device it in silent or vibrate mode.
Step 3:If it is in silent or vibrate mode than set device to ringing mode.
Step 4: Enable device ringing.
Step 5:Acknowledges user that device ringing by sending device status information to user.
Step 6: If user found phone and clicks phone found button then stop ringing.
Step 7:End

6.2.1.3 Get location And Acknowledges user.


Received attention word text is “getlocation”.
In this module we provide the functionality of getting location details of device and the same will
be sent to user. DroidLocator recognizes the keyword “getlocation”, retrieves latitude and
longitude of device, creates a Google map link and the same will be sent to sender of SMS. So
user can locate his phone.
Step 1: START
Step 2:Checks that internet is available.
Step 3:If internet is available then get location details from Network Provider.
Step 4:If internet is not available then Checks is GPS turned on.
Step 5:If GPS is available then get location details.
Step 6:Send location information to user.
Step 7:End
CHAPTER 7

TESTING

The chapter which is presented below deals with the various tests that have been made to the
developed software so as to detect the failures it may have. Along this chapter there will be
carried out two types of tests: unit tests and integration tests.

1. Unit tests
Try to detect if all application functions work correct individually.
2. Integration tests
Try to detect if all these functions are accessible in our application and they are
properly integrated.

7.1 UNIT TESTS

SIN SCENARIOS EXPECTED RESULT ACTUAL RESULT STATUS


1 Install
DroidLoactor.apk file Installation Successful Installation Successful Success
on Android phone
2 Check whether UI Is
Displaying On screen Display UI Display UI Success

3 Send SMS From SMS Sent SMS Sent Success


Application

4 Receive SMS Inside SMS Received SMS Received Success


Application

5 Read Contents Of SMS Contents Read Contents Read Success

6 Make Device Ring Device Ringing Device Ringing Success

7 Retrieve Latitude And Latitude And Latitude And Longitude Success


Longitude Longitude
7.2 INTEGRATION TESTING
1. Application starts on SMS receive.
2. Contents of SMS read and matches with the attention word.
3. If it is ringer attention word then makes phone ring even it is in silent or vibrate mode.
4. Acknowledges the phone status to the requesting phone through SMS.
5. If it is GPS attention word then retrieves current location details and sends back to
therequesting phone silently.
6. Application stops.
CHAPTER 8

DEPLOYMENT

In IT context, deployment encompasses all the processes involved in getting new software or
hardware up and running properly in its environment, including installation, configuration,
running, testing, and making necessary changes.

Software deployment is all of the activities that make a software system available for use.

Android application can be deployed multiple ways:

1. If you don't use eclipse, you can use adb tool. adb -d install
PATH_TO_YOUR_APK_FILE
2. If you use eclipse, you can click run application in eclipse's launch menu. If this doesn't
work, make sure you have "USB Debugging Mode" checked on your android phone. It's
in the application menu.
3. You can export your package and sign it! And then browse to it to install.
CHAPTER 9

CONCLUSION AND FUTURE ENHANCEMENTS

9.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 SMS 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 existing cell tracking system. Application
stands different from the existing system as it’s not only the GPS value it makes use of but it
works on GSM/ text messaging services which makes application a simple & unique one.

9.2 FUTURE ENHANCEMENT


1. Get notification of a SIM card change.

2. SMS/Call Filtering.

3. Allowing user to specify his own attention words (Database Connectivity).

4. Lock device, wipe memory to keep your private data safe.

5. Control your Android remotely via a web-based interface through DroidLocator.


CHAPTER 10

ANNEXTURE

10.1 SNAPSHOTS

Fig 10.1 Splash Screen

Fig 10.2 Menu Screen


Fig 10.3 Ringer keyword Screen

Fig 10.4 GPS keyword Screen


Fig 10.5 About Screen

Fig 10.6 Device ringing acknowledgement


Fig 10.6 Device Ringing
Fig 10.6 GPS location detail acknowledgement
10.2 BIBLIOGRAPHY
References:

1. Hello Android, the Pragmatic Programmers (2009),E. Burnette.

2. Professional Android 2 Application Development, R. Meier, Wiley (2010).

3. Beginning Android 2, M. Murphy, Apress (2010).

4. Android Developer Guide: http://developer.android.com/guide/index.html.

5. Android API: http://developer.android.com/reference/packages.html

6. V-Model:http://en.wikibooks.org/wiki/Introduction_to_Software_Engineering/Process/V-
Model

Anda mungkin juga menyukai