Agile Software Development On The Android Platform Computer Science Essay

Published: Last Edited:

This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.


Pedotrac is a health and fitness application for android based phones, which has elegant features and also a fun way of maintaining fitness right through the android phones. Pedotrac can be installed on android mobile devices that have sensors and GPS capabilities.

Pedotrac has following functionalities:

Keeps track of the users' distance.

Alert them during the half-way point in their path.

Counts number of steps and steps per minute.

Counts the speed of the user.

Counts the calories burnt by the user.

Gives users option of Google maps for finding their fine location.

This implementation is done by using Google Android SDK, java and Google APIs that are designed especially for android devices.

The later sections start with agile software development, followed by android platform and the next section describes system architecture followed by lessons learnt and references.

Agile Software Development:

Agile development is a way of breaking large and complex tasks into smaller modules with minimal planning and avoids long term planning. The modules are iterations of short time frames that range between one to four weeks. Though it is short term planning, the iteration includes all the software development cycle methods starting from planning to requirements, analysis, design, coding, unit testing and also acceptance testing to ensure that a working product is finally delivered after integration. This agile development method minimizes the risk involved in the project, makes it easier to adapt changes quickly thereby reducing the problem of changing the entire project and developing from the scratch if a large project is taken up as it is.

The agile methods involve face to face communication with a smaller group of people working on smaller modules there by contacting each other through emails, voice etc. Since the present project is developed by a single person, there are no teams but the whole task is divided into 5 smaller modules each of which is a separate story and is discussed in the coming sections.

User Stories in Agile development:

Storytelling or user stories [*3]is a way to describe a problem in the user point of view by narrating each detail of the problem in not too long or too short description. The following are the brief listing of the agile story telling.

Write brief character sketches making them customer focused.

One easy way to do this is to make the customer write the requirements or else the developer has to role play. This should contain main points and viewpoint characters.

Describe each character and make it elevator-friendly.

A good user story should be developed in such a way that it has to be so brief that it could be explained to the other party while on an elevator, but still should be self-explanatory.

Not too big but not too small:

Each scene has to be expanded and explained in hundred to three hundred words which could be called a "draft zero". At the end of this draft zero, we should be able to see the story taking a form.

Refine and Rewrite:

The story that has been formed in draft zero has to be refined and re-written incorporating necessary changes thus making it a new draft called draft one.

Make the draft testable:

The story should be such that it could be tested. Clear statements in the story make it testable and objectively verifiable.

Revise the manuscript and edit:

The manuscript should be frequently revised and edit it till the final version is perfect so that any small or large problems are fixed and ready for release.

The Android platform:

Developers have been using four versions of Android namely:

Android 1.5 (Cupcake)

Android 1.6 (Donut)

Android 2.1 (Eclair)

Android 2.2 (FroYo)

3.1 History of Android:

Android is an operating system designed especially for mobile devices, initially developed by Android inc., that which later was purchased by Google in 2005. Android is a modified version of Linux kernel. The members of Open Handset alliance and Google collaborated to release and develop the Android. Android is further tasked for maintenance and development by an open source project called Android open source project (AOSP). The currently available 100,000 apps or application programs are developed by a large community of developers to extend the functionality of the devices. These apps are written in Java language by the developers and control the device via Google-developed Java libraries. The unveiling of android distribution on 5 November 2007 was announced with the founding of the Open Handset Alliance, a consortium of 78 hardware, software and telecom companies that devoted to advancing open standards for mobile devices. The android code was released by Google under free software and an open source license called the Apache license.

This Android operating system software is a set of Java applications that run on a Java based object oriented application framework on top of Java core libraries running on a Dalvik virtual machine featuring JIT compilation. This Android operating system consists of 12 million lines of code in which 3 million are XML, 2.8 million of C, 2.1 million of Java and 1.75 million lines C++ code.

The unit sales for Android based smart phones ranked first among all smart phone OS handsets sold in the US in the 2nd and 3rd quarters of 2010 with market share of 43.6 %.

Features of Android:

Android is not just operating system software but also includes middleware and key applications. For developing applications on Android platform, the Android SDK provides the tools and APIs and allows the usage of Java programming language. The main features include:

Application framework enabling reuse and replacement of components

Dalvik virtual machine optimized for mobile devices

Integrated browser based on the open source WebKit engine

Optimized graphics powered by a custom 2D graphics library; 3D graphics based on the OpenGL ES 1.0 specification (hardware acceleration optional)

SQLite for structured data storage

Media support for common audio, video, and still image formats (MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, GIF)

GSM Telephony (hardware dependent)

Bluetooth, EDGE, 3G, and WiFi (hardware dependent)

Camera, GPS, compass, and accelerometer (hardware dependent)

Rich development environment including a device emulator, tools for debugging, memory and performance profiling, and a plug-in for the Eclipse Integrated Development Environment.

Android architecture:

Figure 1: Android system architecture.


Android includes a set of applications such as e-mail client, SMS program, calendar, browser, maps and contacts that which are written using Java programming language.

Application framework:

Android gives the developers to build extremely rich and innovative applications on a open development platform where the developers are free to take advantage of hardware, location information, set alarms, run background services, add notifications to the status bars. The application architecture is designed to encourage the reuse of components and applications. Below are the applications that are a ste of services and systems including:

A rich and extensible set of Views that can be used to build an application, including lists, grids, text boxes, buttons, and even an embeddable web browser

Content Providers that enable applications to access data from other applications (such as Contacts), or to share their own data

A Resource Manager, providing access to non-code resources such as localized strings, graphics, and layout files

A Notification Manager that enables all applications to display custom alerts in the status bar

An Activity Manager that manages the lifecycle of applications and provides a common navigation backstack.


A set of C or C++ libraries are used by the components of the Android systems. Some of the core libraries are

System C Library

Media Libraries

Surface Manager



3D Libraries

Free Type


Android Runtime:

Every Android application runs on its own process with Dalvik virtual machine. This Dalvik is written such that a device can run multiple VMs.VM executes files in the .dex format (Dalvik Executables) by the "dx" tool. This VM relies on Linux kernel for threading and low level memory management.

Linux kernel:

Linux 2.6 version is used by Android to support system services like security, memory and process management, network stack and driver model. This kernel forms the abstraction layer between the hardware and software stack.

PedoTrac System architecture:

4.1. Stories for PedoTrac

4.1.1. Count the number of steps

Priority: Mandatory

The user will be able to walk with the device and the device will count the number of steps taken by the user. When the user starts walking, he/she will click a button to start the walk, and at the end click a button to end the walk. The pedometer will also provide 'pause' and 'resume' button. The device will display the number of steps taken at the end.


Accessing the accelerometer API's from the application to calculate the movements of the phone and thereby calculate the no of steps taken by the user.

Develop the activity that will allow the user to start the counting of steps and stop the counting of steps.                          

4.1.2. Count the number of calories burnt

Priority: Mandatory

The user will enter the height, weight which will be stored permanently on the phone. The height, weight (or BMI) will be used along with the number of steps taken to calculate the number of calories burnt during each trip. When the user starts walking, he/she will click a button to start the walk, and at the end click a button to end the walk. The device will display the number of calories burnt at the end.


The number of calories burnt will be calculated by the application based on the number of steps taken by the user and the time user takes.

A suitable timer will be developed which calculates the time taken by the user. The time will be started when the user starts walking and stops when the user stops walking.

4.1.3. Count the speed (in miles/hr)

Priority: Mandatory


The Application will use the accelerometer API's and GPS coordinates to calculate the distance walked by the user.

The location of the user when he starts walking and the location when he stops will be calculated and the distance between these two will be calculated.

To calculate the absolute distance travelled by the user. The location of the user will be captured  at regular time intervals.

4.1.4. Database storage of all the information stored by user:

Priority: Optional


All the information like settings, location data, distance travelled, calories burnt etc will be stored in persistent database. SQLLite database will be used for this purpose.

4.1.5. Develop an algorithm which will indicate the users of the half-way point of a particular walk.

Priority: mandatory

You need an activity diagram that show the flow through the system. I would also suggest a class diagram because you have included a detailed discussion of the classes below.


As soon as the user starts the pedotrac application the "MainActivity" which is a class is initiated.

The user then has to hit the settings button and enter necessary details like "Height", "weight" and number of miles to travel "Miles". After entering the details the user has to hit "submit" button.

If the user accidentally hits the "submit" button without entering the necessary details, a "toast" with message "Please enter the details" pops up.

After the user has successfully entered the details, they are stored for the present session using shared preferences. A service "step service" is then called, which takes care of counting the steps.

Once user hits "reset", all the values entered and all the values calculated are reset to "zero".

All the menu items like "Pause", "Resume", "Reset", "Quit" are instantiated and handled in the "MainActivity" class.

4.2.1. "Menu" Items:


When the user hits "pause" button, the step service is unbind and stopped.


When user hits "Resume" button, step service is first started and then bind.


Reset values are performed, when user hits this button. "Quit":

This button stops "step service" and quits the application.

Map activity is also instantiated in "MainActivity" itself. When user hits "Map" button, "MapActivityTest" class is initiated and "activity" of "map" is started.


As per services are defined as "A Service is an application component representing either an application's desire to perform a longer-running operation while not interacting with the user or to supply functionality for other applications to use"[*].

"StepService" handles the counting of steps and different services required for this purpose, such as "wake_lock" of power service.

"StepService" is initiated when the user enters the details of settings and hits "submit" button.

Once it is initiated, power service is fired up and "wake_lock" is achieved, which keeps the phone in "wake" mode and never lets the phone go into sleep mode. This helps in uninterrupted service from "StepService".

Notifications such as "pedotrac is started" or "pedotrac is stopped" are shown when step service is started or stopped. So these notifications are handled in "StepService" class.

Passing of values of steps changed is taken care in this "StepService", since counting of steps is instantiated in this service.


When "StepService" starts all sensors required for counting steps such as accelerometer, magnetic field, orientation, delay sensors are started and necessary values such as sensitivity is set.

"StepDetector" class uses these sensors by implementing "SensorEventListener" calculations and finds out if there is a movement in these sensors and if there is such movement, then that is counted as 1 step and value is passed onto "StepListener".


"StepDisplayer" is used to increment values by '1' when movements are counted by step detector. These values are acquired from "StepListener".


This class is used for map activity that goes on in the application. The map is loaded once the "map" button on the main screen is hit by the user. This is loaded with the help of Google maps package for android.

Map view is set to satellite view, for better understanding of the places and surroundings.

Once the map is loaded, the current position (fine location) of the user is displayed, using GPS co-ordinates. A pinpoint is used to indicate the location.

Current position is determined using LocationManager.

Half way distance calculation:

As the user starts to walk, after half the distance set by the user in the "settings", intimation is given out in the form of an "alarm" and a "toast" (message) indicating "You reached half the distance".

For this purpose, "Haversines" formula for calculating distance using GPS co-ordinates between two points on earth's spherical radius is used.

Trigonometrical formula is

haversin (d/R) = haversin( ᶲ2- ᶲ1) + cos(ᶲ1) cos(ᶲ2) haversin(∆λ)

Technique used:

A toast is displayed as soon as the user hits the map button on the main screen. The toast is divided into two halves, first half on left indicates the actual distance travelled and second half on right indicates the half distance that is to be travelled by user, this distance is fetched from the details entered by the user in the "settings" along with height and weight.

For example, if the user enters 1 mile, the right half on the toast displays 0.5 miles.

As soon as the current distance is equal to the distance to be travelled, an alarm and a toast displaying "You reached half the distance" is indicated to the user.

The current distance is calculated even after the alarm rings and stops; this can only be stopped when user quits the application. is an auto generated file by the android SDK, which contains references to resources stored in "res" (Resources) folder of the project.

The final product

Add screen shots here.