Professional Documents
Culture Documents
CHAPTER 1
INTRODUCTION
1.INTRODUCTION
About Android
Android, the World's Most Popular Mobile Platform:
Android powers hundreds of millions of mobile devices in more than 190 countries around
the world. It's the largest installed base of any mobile platform and growing fast—every
day another 900,000 user’s power up their Android devices for the first time and start
looking for apps, games, and other digital content.
Android gives you a world-class platform for creating apps and games for Android users
everywhere, as well as an open marketplace for distributing to them instantly.
Generally, Android is a software stack for mobile devices that includes an operating
system, middleware and key applications.
Android is based on JAVA and all its applications are developed in JAVA. Uses Linux
to provide core system services
Security.
History of Android:
Android, Inc. was founded in Palo Alto California, United States in October, 2003 by
Andy Rubin (co-founder of Danger), Rich Miner and Chris White.
Google acquired Android Inc. on August 17, 2005, making Android Inc. a wholly owned
subsidiary of Google Inc With same Android, Inc Team.
Google was planning to enter the mobile phone market with this move.
In 2007 announced Open Handset Alliance with several companies which
include Broadcom Corporation, Google, HTC, Intel, LG, Marvell Technology
Group, Motorola, Nvidia, Qualcomm, Samsung Electronics, Sprint Nextel, T-
Mobile and Texas Instruments .
Android Open Source Project (AOSP):
"The goal of the Android Open Source Project is to create a successful real-
world product that improves the mobile experience for end users.
And one that can run any application written by third-party developers using
the Android SDK.
Version history
2008: Google sponsors 1st Android Developer Challenge T-Mobile G1 announced,
SDK 1.0 released as a open source that is Android dev phone 1.
2009: New soft keyboard with “auto complete” feature. That is SDK 1.5 called by
name Cupcake. In the same year SDK 1.6 with Support Wide VGA called by
Android Apps:
Built using Java and new SDK libraries
Libraries:
Android includes a set of core libraries that provides most of the functionality
available in the core libraries of the Java programming language. Every Android
application runs in its own process, 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 memory management.
Android uses a special virtual machine, e.g. the Dalvik Virtual Machine. Dalvik uses
special byte code. Therefore, you cannot run standard Java byte code on Android.
Android provides a tool "dx" which allows converting Java Class files into "dex"
(Dalvik Executable) files. Android applications are packed into an .apk (Android
Package) file by the program "aapt" (Android Asset Packaging Tool) To simplify
development Google provides the Android Development Tools (ADT) for Eclipse. The
ADT performs automatically the conversion from class to dex files and creates the apk
during deployment.
Android supports 2-D and 3-D graphics using the OpenGL libraries and supports data
storage in a SQLite database. Every Android applications runs in its own process and
under its own user id which is generated automatically by the Android system during
deployment. Therefore the application is isolated from other running applications and a
misbehaving application cannot easily harm other Android applications.
Hardware developers
Application Components:
Activity
◦ An activity represents a single screen with a user interface. An
activity is implemented as a subclass of Activity .
Broadcast Receivers
Content Providers
◦ Store and retrieve data and make it accessible to all applications.
What is SQLite?
SQLite is an Open Source Database which is embedded into Android.
SQLite supports standard relational database features like SQL syntax,
transactions and prepared statements. In addition, it requires only little
memory at runtime (approx. 250 Kbytes).
SQLite Database is the base class for working with a SQLite database in
Android and provides methods to open, query, update and close the database.
Technical Background:
Android Services
Service
A Service is a component which runs in the background, without interacting with the
user. Every developer can create new Services in his application Services support
true multitasking for Android, as they can run in their own process. If you use
threads in Activities there are still connected to the life-cycle of Activities and the
Android system may decide to terminate them at any point in point.
CHAPTER 2
LITERATURE SURVEY
2.LITERATURE SURVEY
2.1 Purpose:
A literature survey or literature review is the study of references projects and old
algorithms that we have read for designing the proposed methods. It also helps in
reporting summarization of all the old references projects, and their drawbacks. The
detailed literature survey for the project helps in comparing and contrasting various
methods, algorithms in various ways that have implemented in the research.
Related Study:
Eddie Chi-Wah Lau, ‘‘Simple Bus Tracking System’’, Journal of Advanced Computer
Science and Technology Research, vol.3, no.1, 2013.
This paper presents the bus tracking application using smart phones. The application
consists of both the transmitter and receiver inbuilt in mobile phones. The transmitter is
used to transmit the location and vehicle status information to the server. The receiver is
the user who can view the details regarding the bus location using his smart phone via
Google map. Due to the movement of bus is always available this project can also
ensure security by keeping track of the bus. So in the coming year it is going to play a
major role in our day to day living.
The purpose of this research is to find a way to implement a system that will provide a
solution not only for Buses The application will prove benificial for every bus traveler,
or even tourists. Not just buses, but this application will be useful for every person
travelling by any means of transport.
The main aim of this Android application is to track the buses which would give the
exact location of buses with the help of Google map and help the users to plan their way
to reach their destination on time. This application may be greatly used by public since
Android mobiles has become common and spread everywhere. In addition, this will also
enhance the security since the movement of the buses is always available.
CHAPTER 3
SYSTEM ANALYSIS
3. SYSTEM ANALYSIS
3.1Problem Definition:
This application is designed in the entire world of technology, mobiles are playing a major
role in almost every corner. As new models of mobiles are coming in day-by-day, the
technology and applications are also increasing. Android is an open source for developing
new applications as people expecting new technologies and applications in the mobiles.
This application is designed for a random user who are not willing to getting late or miss
the bus. By using this application users can easily reach their destination within the time.
This application includes the location of driver and students by using the global
positioning system(GPS).this application mainly consists of driver, student and database.
In this application the driver and student must have the android mobiles. The student and
driver need to register to run the application. Then the student and driver login in the
application and the student add the location. The student location should be stored in
database then it will be send to the driver. when the driver reaches to the destination the
student get the alert signals ( the bus is arriving). The location should be updated
automatically.
3.2 Existing system:
The proposed system provides the user can get the alerts from the bus.
The users can select the bus number which they want to travel.
The position of the bus is displayed in the google map.
This also enhances security because the movement of the bus is always
available.
Every one can track the bus at anytime and anywhere.
The bus location can be retrieved from anywhere.
This study is carried out to check the technical feasibility, that is, the
technical requirements of the system. Any system developed must not have a
high demand on the available technical resources. This will lead to high
demands on the available technical resources. This will lead to high demands
being placed on the client. The developed system must have a modest
requirement, as only minimal or null changes are required for implementing
this system.
This study is carried out to check the economic impact that the system
The expenditures must be justified. Thus the developed system as well within
the budget and this was achieved because most of the technologies used are
freely available. Only the customized products had to be purchased.
CHAPTER 4
SYSTEM DESIGN
4. SYSTEM DESIGN
4.1 Unified Modelling Language:
The UML’s four structural diagram exists to visualize, specify, construct and document the
static aspects of system. Just as the static aspects of a house encompass the existence and
placement of such things as walls, doors, windows, pipes, wires and vents. So, to do the
static aspects of a software system encompass the existence and placement of such things
classes, interfaces, collaborations, components and nodes.
Relations:
1.Dependency:
Fig: Dependency
2.Association:
Employer employee
Fig: Association
3. Generalization
Generalization is a specialization/generalization relationship in which objects of
specialized element (child) are substitutable for object of the
Generalized element (parent).in this way the child shares the structure and
behaviour of the parent.
Graphically, rendered as a solid-line with a hollow over-head
pointing to the parent.
Fig: Generalization
4.Realization:
Fig: Realization
The (UML) is a general and all-purpose modelling and planning language in the Software
engineering field, which provides a standard way to envisage or visualize the design of a
system in a pictorial format. Unified modelling language is a language for writing blueprints.
Specifying-building models that is precise, unambiguous, and
complete. Constructing-directly connected to various programming
languages.
Visualizing-modelling textually as well as graphically.
A use case diagram shows as set of use cases and actors and their relationships. Use case
diagrams are especially important in organizing and modeling behavior of a system.
A class diagram is a set of various related objects that share the same characteristics
called attributes operations called activities, relationships called associations and semantics
called rules. A class is a whole set of objects. Its representation is
Class Name
Attributes
Operations
Action states.
Transition.
Objects.
Contains Fork, Join and branching relations along with flow Chart symbols.
REPRESENTATION OF ACTIVITY DIAGRAM
Action State is represented as a shape with straight top and bottom and with
convex areas on the two sides.
State diagrams are also used to describe the behaviour of a Single class objects.
CHAPTER5
SYSTEM
IMPLEMENTATION
5. SYSTEM IMPLEMENTATION
5.1 Modules:
1. Driver
2. User
3. GPS
4. Geo Fencing
5. SMS Service
6. Database
5.1.1 Driver:
The driver must register first to run application.
The driver can link the bus and after that starts his bus.
The driver can add the stages and mobile numbers in
5.1.2 User:
User must register in order to login into the application.
After logging he/she they can link the bus number and get the location of the
bus.
The user can see the stages in the Google maps so that the user can understand
where the bus will stopped.
5.1.3 GPS:
To display our bus in Google Maps we need Gps.
Gps is a location based service get signals from Gps satellite.
5.1.4 GeoFencing:-
A geofencing is a virtual perimeter for a real-world geographic area.
Based on that geographical area when the driver touch the circle then the user
5.1.6 Database:
All the available information will be stored in the database like student, driver, stages,
phone no…etc.
The database can update the location every moment of time.
The admin can modify/view the data in the database.
5.2 CODING:
package com.example.aditya.bustrack;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.text.Layout;
import android.util.Log;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.Spinner;
import android.widget.Toast;
import android.graphics.drawable.AnimationDrawable;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.android.material.textfield.TextInputEditText;
import com.google.android.material.textfield.TextInputLayout;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import butterknife.BindView;
import butterknife.ButterKnife;
@BindView(R.id.text_input_layout_email)
TextInputLayout emailWrapper;
@BindView(R.id.text_input_layout_password)
TextInputLayout passwordWrapper;
@BindView(R.id.btnLogin)
Button login;
@BindView(R.id.registerbtn)
Button registerbtn;
@BindView(R.id.chooser_spinner)
Spinner userType;
@Override
protected void onStop() {
super.onStop();
mAuth.removeAuthStateListener(mAuthStateListener);
}
@Override
protected void onStart() {
super.onStart();
mAuth.addAuthStateListener(mAuthStateListener);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
ButterKnife.bind(this);
ConnectivityManager cm = (ConnectivityManager)
getSystemService(this.CONNECTIVITY_SERVICE);
NetworkInfo nInfo = cm.getActiveNetworkInfo();
if(nInfo != null && nInfo.isConnected()){
}
else {
Intent in = new
Intent(android.provider.Settings.ACTION_DATA_ROAMING_SETTINGS );
startActivity(in);
}
})
.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.cancel();
}
});
AlertDialog alert = a_builder.create();
alert.setTitle("No Internet Connection");
alert.show();
}
/*
// init coordinatorLayout
coordinatorLayout = (CoordinatorLayout) findViewById(R.id.activity_login);
// initializing animation drawable by getting background from constraint layout
animationDrawable = (AnimationDrawable) coordinatorLayout.getBackground();
// overridePendingTransition(R.anim.slide_in_right, R.anim.stay_in_place);
mAuth = FirebaseAuth.getInstance();
};
// switchToSignUp.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// Intent intent = new Intent(LoginActivity.this, SignUPActivity.class);
// startActivity(intent);
// }
// });
login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
mProgress.show();
hideKeyBoard();
emailInput = (TextInputEditText) emailWrapper.getEditText();
passwordInput = (TextInputEditText) passwordWrapper.getEditText();
String email = emailInput.getText().toString();
String password = passwordInput.getText().toString();
/**
* Saving detail of the user in a shared preference file i.e he is driver or not
* and will check from that shared pref while logging in!
*/
if (userType.getSelectedItem().toString().equals("Driver")) {
SharedPreferences.Editor editor = getPreferences(Context.MODE_PRIVATE).edit();
editor.putBoolean(getString(R.string.isDriver), true);
editor.commit();
}else{
SharedPreferences.Editor editor = getPreferences(Context.MODE_PRIVATE).edit();
editor.remove(getString(R.string.isDriver));
editor.commit();
}
mAuth.signInWithEmailAndPassword(email,
password).addOnCompleteListener(LoginActivity.this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (!task.isSuccessful()){
Toast.makeText(LoginActivity.this ,"Sign in error!"
,Toast.LENGTH_SHORT).show();
mProgress.dismiss();
}
}
});
}
});
registerbtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
mProgress.show();
hideKeyBoard();
emailInput = (TextInputEditText) emailWrapper.getEditText();
passwordInput = (TextInputEditText) passwordWrapper.getEditText();
String email = emailInput.getText().toString();
String password = passwordInput.getText().toString();
String user = userType.getSelectedItem().toString();
if (user.equals("Driver")) {
SharedPreferences.Editor editor = getPreferences(Context.MODE_PRIVATE).edit();
editor.putBoolean(getString(R.string.isDriver), true);
editor.commit();
} else
mAuth.createUserWithEmailAndPassword(email,
password).addOnCompleteListener(LoginActivity.this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (!task.isSuccessful()) {
getSystemService(Context.INPUT_METHOD_SERVICE);
view.clearFocus();
manager.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
}
@Override
protected void onResume() {
super.onResume();
if (animationDrawable != null && !animationDrawable.isRunning()) {
// start the animation
animationDrawable.start();
}
}
@Override
protected void onPause() {
super.onPause();
if (animationDrawable != null && animationDrawable.isRunning()) {
// stop the animation
animationDrawable.stop();
}
}
}
CHAPTER 6
SYSTEM TESTING
6. SYSTEM TESTING
6.1 Purpose of Testing:
Software Testing Strategy integrates the software test cases into a series of well-
planned steps and series of planned procedures that result in the successful construction,
Design and Implementation of a software. Various Software testing Methods are referred for
Verification and Validation. Software Verification refers to the set of activities on the
designed functions and programs for ensuring that the software or the product correctly
implements a specific function or the required output. Software Validation refers to a set of
activities that ensure that the software or product or application that has been built for
traceable to customer’s requirements and providing the customer to input valid data and make
Data store free from redundancy.
6.2 Testing Strategies:
6.2.1 Unit Testing
In software testing, Unit testing mainly focuses on verification effort on the smallest
unit of program or software design that is also called a module. In unit testing the procedural
or functional design provides a detailed description as a guide, focal the control paths are
tested to uncover errors occurred in the designed software within the boundaries of the
module. The unit testing of software is normally white box or open testing oriented and the
series of steps can be conducted in corresponding or parallel for multiple modules or
functions.
6.2.2 Integration Testing
Integration testing is another Testing for systematic technique and product module
integrating which constructs the program structure and makes the data flow between the
modules, while conducting Integration Testing it requires to uncover errors associated with
various interfaces. The main objective is to take unit tested methods and activities to build a
program structure that have been dictated by design.
6.2.3 Validation Testing
The Validation Testing is integration testing for software which is completely
assembled as a package. The Validation testing is the next stage in Testing Activities, which
can be defined as successful testing process for the software functions in the manner
reasonably expected by the customer.
Status
S No Input Expected Behavior Observed P=
behavior Passed
F=
Failed
1 Login as driver or Driver or user Driver or user Activity P
user with correct Activity Page should Page should be
login details be displayed displayed
4 Send Alerts to Users User can get alert User can get alert from P
from the Bus the Bus
5 Logout
Logout into the
Logout into the P
application.
application.
CHAPTER 7
SCREENSHOTS
––
CHAPER 8
CONCLUSION
8. CONCLUSION
This application overcomes the problem of bus tracking. It is designed for users who’s
want to travel and saving time without wasting time in bus stops. This application
provides real time tracking to the users with the help of this application user can get
alerts from the bus before bus reaching his location.
By using this application the user can travel freely and without taking any fear and
tensions. So that the user do not get delayed to reach their destinations.
This system is reliable and very secure. Upgrading this setup is very easy which makes
it open to future requirements without the need of rebuilding everything from scrath,
which also makes it more efficient.
This application presents the bus tracking application using smart phones. The
application consists of both the transmitter and receiver inbuilt in mobile phones. The
transmitter is used to transmit the location and vehicle status in formation to the server.
The receiver is the user who can view the details regarding the bus location using his
smart phone via Google map. Due to the movement of bus is always available this
project can also ensure security by keeping track of the bus. So in the coming year it is
going to play a major role in our day to day living.
CHAPTER 9
FUTURE
ENHANCEMENT
9. FUTURE ENHANCEMENT
In future, We are also planning to fix a GPS device on every bus so that it is not
essential for the driver to have an Android phone. Due to availability of android
phones and GPS devices it is going to stay for long in the future.
The application will prove benificial for every bus traveler, or even tourists. Not just
buses, but this application will be useful for every person travelling by any means of
transport.
CHAPTER 10
BIBLIOGRAPHY
10. BIBILOGRAPHY
Eddie Chi-Wah Lau, ‘‘Simple Bus Tracking System’’, Journal of Advanced Computer
Science and Technology Research, vol.3, no.1, 2013.
Khondker Shajadul Hasan, Mashiur Rahman, Abul L. Haque, M Abdur Rahman, Tanzil
Rahman, and M Mahbubur Rasheed, “Cost Effective GPS-GPRS Based Object Tracking
System,” Proceedings of the International MultiConference of Engineers and Computer
Scientists 2009 (IMECS 2009), March 2009, Hong Kong, vol. 1.
https://www.dfrobot.com/wiki/index.php/GPS/GPRS/GSM_Module_
3.0_(SKU:TEL0051)
http://javapapers.com/android/android-location-tracker-with-google-maps/
http://www.codeproject.com/Articles/665527/A-GPS-Location-Plotting-Android-
application
https://developer.android.com/guide/topics/location/strategies.html
http://www.todroid.com/how-to-create-a-google-map-application-using-androidstudio/