You are on page 1of 7

"Sharpening Skills.....

Serving Nation"
International Journal of Emerging Technology and Advanced Engineering
Website: www.ijetae.com (ISSN 2250-2459 (Online), Volume 4, Special Issue 1, February 2014)
International Conference on Advanced Developments in Engineering and Technology (ICADET-14), INDIA.

A Complete Study of Chatting Room System based on


Android Bluetooth
Rahul Verma1, Ruchit Gupta2, Manas Gupta3, Rahul Singh4
Moradabad Institute of Technology, Moradabad
1
ce.rahulverma@gmail.com , 2ruchit.gupta09@gmail.com, 3
gmanu5176@gmail.com ,
4
panwar.rahul44@gmail.com
Abstract-- Bluetooth chatting is an innovative approach By the help of the Bluetooth module, the Android
to the mobile world. A low power and low cost connection phones can be divided into client and server. Chat can be
is provided by the Bluetooth among mobile devices and accomplished only after the division of client and server.
their accessories. It is basically an open standard for It is used to initialize the connection.
implementing a short range wireless communication. This
application allows two Android devices to carry out two-
way text chat over Bluetooth. This shows the use of
Bluetooth in terms of chatting. The paper contains design
and implementation of Bluetooth Communication by using
APIs of Android platform. The APIs wirelessly connect
applications to other Bluetooth devices, enabling point-to-
point and multipoint wireless features.
Fig 1: Bluetooth chat in two android devices
Keyword:- Android, Component, Bluetooth, wireless
communication, chat room. Bluetooth does not need a license around the globe for
the working frequency band. In the connection
I. INTRODUCTION initialization phase, firstly, it starts the application and
The Android platform support for the Bluetooth search the Bluetooth devices. Second, it sends the signals
network stack. It allows a device to wirelessly exchange to the server class. After this it can run, pause and stop
data with other Bluetooth devices. The new vitality to the the application. Third, it shows alert using setAlert
mobile space has injected because of the release of function on every changing. Server goes active and sends
the signals to other devices. Client class works to respond
Android smart platform. Android is an operating system
based on Linux kernel. It is designed for the touch screen the other Bluetooth device server. This allows a two-way
mobile devices. The user interface of Android is based on chat over Bluetooth. No GSM or Wi-Fi connection
direct manipulation. The Android system provides many required. In addition to the person-to-person chat, chat
Bluetooth APIs for developers to call.[1] rooms can be used to gather more than two persons at a
Bluetooth technology allows users to exchange voice time.
and data transmission between two or more devices. It is
basically a wireless communication technology. II. B LUETOOTH ARCHITECTURE
Bluetooth technology is reflected in the low price, easy to Bluetooth is a wireless technology standard for
control and non-visual distance limitations. Bluetooth is exchanging data over short distances. This low cost
integrated into the android platform as an android mobile transmission technology for the handheld devices and
network communication module. Chat room is used to various electronic products. Android Bluetooth system
connect the Android phones into a local area network. It contains linux kernel, Bluetooth driver, Bluetooth
helps to communicate with each other. protocol layers blueZ Bluetooth user library, blueZ
adaptation layer.[2]

Lord Krishna College of Engineering (An ISO 9001:2008 Certified Institute) Ghaziabad, Uttar Pradesh, INDIA. Page 135
"Sharpening Skills.....
Serving Nation"
International Journal of Emerging Technology and Advanced Engineering
Website: www.ijetae.com (ISSN 2250-2459 (Online), Volume 4, Special Issue 1, February 2014)
International Conference on Advanced Developments in Engineering and Technology (ICADET-14), INDIA.
III. P ROCESS OF B LUETOOTH CHAT APPLICATION
i. It first checks whether the Bluetooth of the
devices is in ON/OFF mode.
ii. If the Bluetooth of the devices is in OFF mode
then it makes the request to enable the
Bluetooth.
iii. Perform scanning of the devices which are in
their range.
iv. Display the list of all the devices in the range.
v. Select the device with which one wants to do the
chat.
vi. If the device connects then set up the chat
session.

IV. DESIGN O F B LUETOOTH COMMUNICATION


In the Android platform Bluetooth API is needed to
implement the communication between the Bluetooth
devices. The Bluetooth communication is based on the
unique MAC. Bluetooth devices must been paired before
Fig 2: Android Bluetooth structure using Bluetooth communication for the security purpose.
The connected devices will be shared with a
Bluetooth can be used to transmit asynchronous data RFCOMM channel to transmit data. RFCOMM
and synchronous language at the same time. L2C AP, bluetoothSocket used to accept the incoming connections
SDP, RFCOMM etc are underlying protocol layer must be attached to operating system resources with the
include a number of agreements. It provides the upper bind method.
transmission. The process of Bluetooth communication includes
three steps:
i. Query Bluetooth: BluetoothAdapter is used to get
the Bluetooth Activity. It is the entry-point for all
Bluetooth interaction and also it is used to discover
other Bluetooth devices. It creates the
BluetoothServerSocket to listen for
communications from other devices. Bluetooth
Adapter is also used to get the Bluetooth connection
intent.[6]
The query pairing process is shown in the following
figure-

Fig 3: Relationship between Bluetooth Protocol

Lord Krishna College of Engineering (An ISO 9001:2008 Certified Institute) Ghaziabad, Uttar Pradesh, INDIA. Page 136
"Sharpening Skills.....
Serving Nation"
International Journal of Emerging Technology and Advanced Engineering
Website: www.ijetae.com (ISSN 2250-2459 (Online), Volume 4, Special Issue 1, February 2014)
International Conference on Advanced Developments in Engineering and Technology (ICADET-14), INDIA.
iii. Connecting Bluetooth: Request the BLUETOOTH
PERMISSION in order to perform any Bluetooth
communication, such as requesting a connection,
accepting a connection and ransferring the data.
The process of pairing connection shown in the
following diagram:

Fig 4: The pairing process

ii. Finding devices: In this, it is needed to open the


Bluetooth user name and MAC address to pair the
Bluetooth.
Fig 5: Bluetooth pairing and Connection process

Lord Krishna College of Engineering (An ISO 9001:2008 Certified Institute) Ghaziabad, Uttar Pradesh, INDIA. Page 137
"Sharpening Skills.....
Serving Nation"
International Journal of Emerging Technology and Advanced Engineering
Website: www.ijetae.com (ISSN 2250-2459 (Online), Volume 4, Special Issue 1, February 2014)
International Conference on Advanced Developments in Engineering and Technology (ICADET-14), INDIA.

Fig 6: Workflow of the Bluetooth Chat Room

V. DESIGN O F MODULES W ITH S AMPLE CODE Sample code : startDiscovery method is used in the
i. Discovering Devices: Device discovery is a class of BluetoothAdapater. It executes asynchronously,
scanning procedure and searches the local area for so we do not consider the thread is blocked. Whole
Bluetooth enabled devices. If the Bluetooth device process takes about 12 seconds[3]. Then register a
is currently enabled to be discoverable then only it BroadcastReceiver object to receive the Bluetooth device
will respond to the discovery request. If the device information. Then filter ACTION_FOUND intent to
is discoverable then it will respond by sharing some obtain the tailed information for each remote device.
information such as device name, class and its // Create a BroadcastReceiver for ACTION_FOUND
unique MAC address. First time connection request private final BroadcastReceiver mReceiver = new
automatically presented to the user. The information BroadcastReceiver() {
can be read using the Bluetooth APIs. public void onReceive(Context context, Intent intent) {
Difference between paired and being connected are: String action = intent.getAction();
// When discovery finds a device
Paired To be connected if (BluetoothDevice.ACTION_FOUND.equals(action))
{
Two devices Devices // Get the BluetoothDevice object from the Intent
are aware of each others currently share an BluetoothDevice device =
existence. RFCOMM channel. intent.getParcelableExtra(BluetoothDevice.EXTRA_DE
They have a Transmit VICE);
shared link-key that can be data with each // Add the name and address to an array adapter to
used for the authentication. other. show in a ListView
Capable of mArrayAdapter.add(device.getName() + "\n" +
establishing an encrypted device.getAddress()); }}};
connection with each other.

Lord Krishna College of Engineering (An ISO 9001:2008 Certified Institute) Ghaziabad, Uttar Pradesh, INDIA. Page 138
"Sharpening Skills.....
Serving Nation"
International Journal of Emerging Technology and Advanced Engineering
Website: www.ijetae.com (ISSN 2250-2459 (Online), Volume 4, Special Issue 1, February 2014)
International Conference on Advanced Developments in Engineering and Technology (ICADET-14), INDIA.
ii.Paired Device: getBondedDevices() method is used Connect devices; and
in the pairing a Bluetooth device in the class Transfer data.
BluetoothAdapter to obtain a paired device. This
method returns the array of Bluetooth device to iv. Server Design: Server is needed to connect the two
distinguish between each paired device. devices because it holds an open
bluetoothserversocket. It is designed to listen for
Sample code: incoming connection requests.
Set<BluetoothDevice> pairedDevices = Call
mBluetoothAdapter.getBondedDevices(); listenUsingRfcommWithServiceRecord(String,
// If there are paired devices UUID) to get Bluetooth server socket.
if (pairedDevices.size() > 0) { String = Name of the service,
// Loop through paired devices UUID = sign of connection
for (BluetoothDevice device : pairedDevices) { Call the method accept() to listen for connection
// Add the name and address to an array adapter to request and return a connection on Bluetooth
show in a ListView socket bluetoothsocket.
mArrayAdapter.add(device.getName() + "\n" + Call the method close() after listening to a
device.getAddress());}} connection to close the listener.
iii. Establishing: For the establishment of a Bluetooth v. Client Design: Bluetooth Device object is used to
communication must go through : initialize a connection. Obtain the Bluetooth socket
Get local Bluetooth devices; and initialize the connection by the
Find the remote device; BluetoothDevice object.
Pairing;

Lord Krishna College of Engineering (An ISO 9001:2008 Certified Institute) Ghaziabad, Uttar Pradesh, INDIA. Page 139
"Sharpening Skills.....
Serving Nation"
International Journal of Emerging Technology and Advanced Engineering
Website: www.ijetae.com (ISSN 2250-2459 (Online), Volume 4, Special Issue 1, February 2014)
International Conference on Advanced Developments in Engineering and Technology (ICADET-14), INDIA.

Fig 7: Detailed design of Bluetooth Chat Room[4]

VI. ADVANTAGE O F B LUETOOTH CHAT IN ANDROID VII. LIMITATIONS O F C HATTING ROOM SYSTEM IN
i. Low-power & low-cost wireless connection. ANDROID B LUETOOTH
ii. Open standard short-range wireless i. Strangers can communicate with others using
communication. Bluetooth devices.
iii. Bluetooth offers higher level service profiles, ii. Bluejacking, refers to people who send
such as FTP-like file servers, voice irrelevant, surprising, or shocking messages to
transport, and more.[8] strangers in their vicinity.
iv. Innovative approach to the mobile world. iii. Limited range to chat.[7]
v. No GSM or Wi-Fi connection required.
vi. Bluetooth does not need a license around the VIII. CONCLUSION AND F UTURE W ORKS
globe for the working frequency band. The internet age of today chat room is of a great
vii. Low cost transmission technology for the entertainment features project. Most of the internet user
handheld devices. likes it.

Lord Krishna College of Engineering (An ISO 9001:2008 Certified Institute) Ghaziabad, Uttar Pradesh, INDIA. Page 140
"Sharpening Skills.....
Serving Nation"
International Journal of Emerging Technology and Advanced Engineering
Website: www.ijetae.com (ISSN 2250-2459 (Online), Volume 4, Special Issue 1, February 2014)
International Conference on Advanced Developments in Engineering and Technology (ICADET-14), INDIA.
Android provides the design and realization of [7] FELMETSGER, V., CAVEDON, L., KRUEGEL, C., AND
VIGNA, G. Toward Automated Detection of Logic
chatting room system is good for developing Bluetooth
Vulnerabilities inWeb Applications. In Proceedings of the
network application and Bluetooth agreement. The USENIX Security Symposium (2010).
system have realized the broadcast and private chat [8] FIRST TECH CREDIT UNION. Security Fraud: Rogue Android
between mobile phones. But few still need to further Smartphone app created. Dec. 2009.
improve the usability and functionality of the system like [9] GOODIN, D. Backdoor in top iphone games stole user data, suit
richer input format, the expression of information, claims. The Register, November 2009.
pictures, information transmission etc. [10] HOVEMEYER, D., AND PUGH, W. Finding Bugs is Easy. In
Proceedings of the ACM conference on Object-Oriented
REFERENCES Programming Systems, Languages, and Applications (2004).
[1] E2ECloud studio. Google Android[M] posts & telecom press. [11] JOHNS, T. Securing Android LVL Applications. 2010.
2009 [12] JUNG, J., SHETH, A., GREENSTEIN, B., WETHERALL,
[2] [2] The Bluetooth Special Interest Group. Bluetooth Specification D.,MAGANIS, G., AND KOHNO, T. Privacy Oracle: A System
Core v4.0 (2009-02). [3] Han Chao, Liang Quan, Principles and for Finding Application Leaks with Black Box Differential
development points of the Android system[M]. Publishing House Testing. In Proceedings of the ACM conference on Computer and
of Electronics industry. 2010 Communications Security (2008).
[3] yang Fegsheng. Android Inside [M]. Machinery Industry Press. [13] KASPERSKEY LAB. First SMS Trojan detected for smartphones
2008 running Android. August 2010.
[4] Andre N Klingsheim. J2ME Bluetooth Programming[D]. [14] KIRDA, E., KRUEGEL, C., BANKS, G., VIGNA, G., AND
Department of informatics University of Bergen, 2004 KEMMERER, R. A. Behavior-based Spyware Detection. In
Proceedings of the 15th USENIX Security Symposium (Aug.
[5] W., ONGTANG, M., AND MCDANIEL, P. OnLightweight 2006).
Mobile Phone Application Certification. In Proceedingsof the
16th ACM Conference on Computer and Communications
Security (CCS) (Nov. 2009).
[6] ENCK, W., ONGTANG, M., AND MCDANIEL, P.
Understanding Android Security. IEEE Security & Privacy
Magazine 7, 1 (January/February 2009), 5057.

Lord Krishna College of Engineering (An ISO 9001:2008 Certified Institute) Ghaziabad, Uttar Pradesh, INDIA. Page 141

You might also like