Вы находитесь на странице: 1из 7
"Sharpening Skills Serving Nation" International Journal of Emerging Technology and Advanced Engineering Website:

"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 Verma 1 , Ruchit Gupta 2 , Manas Gupta 3 , Rahul Singh 4

Moradabad Institute of Technology, Moradabad

1 ce.rahulverma@gmail.com , 2 ruchit.gupta09@gmail.com, 3 gmanu5176@gmail.com ,

4 panwar.rahul44@gmail.com

Abstract-- Bluetooth chatting is an innovative approach to the mobile world. A low power and low cost connection is provided by the Bluetooth among mobile devices and their accessories. It is basically an open standard for 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.

Keyword:- Android,

Component,

Bluetooth,

communication, chat room.

I.

INTRODUCTION

wireless

The Android platform support for the Bluetooth network stack. It allows a device to wirelessly exchange data with other Bluetooth devices. The new vitality to the mobile space has injected because of the release of Android smart platform. Android is an operating system based on Linux kernel. It is designed for the touch screen mobile devices. The user interface of Android is based on direct manipulation. The Android system provides many Bluetooth APIs for developers to call.[1] Bluetooth technology allows users to exchange voice and data transmission between two or more devices. It is basically a wireless communication technology. Bluetooth technology is reflected in the low price, easy to control and non-visual distance limitations. Bluetooth is integrated into the android platform as an android mobile network communication module. Chat room is used to connect the Android phones into a local area network. It helps to communicate with each other.

By the help of the Bluetooth module, the Android phones can be divided into client and server. Chat can be accomplished only after the division of client and server. It is used to initialize the connection.

client and server. It is used to initialize the connection. Fig 1: Bluetooth chat in two

Fig 1: Bluetooth chat in two android devices

Bluetooth does not need a license around the globe for the working frequency band. In the connection initialization phase, firstly, it starts the application and search the Bluetooth devices. Second, it sends the signals to the server class. After this it can run, pause and stop the application. Third, it shows alert using setAlert function on every changing. Server goes active and sends the signals to other devices. Client class works to respond the other Bluetooth device server. This allows a two-way chat over Bluetooth. No GSM or Wi-Fi connection required. In addition to the person-to-person chat, chat rooms can be used to gather more than two persons at a time.

II. BLUETOOTH ARCHITECTURE

Bluetooth is a wireless technology standard for exchanging data over short distances. This low cost transmission technology for the handheld devices and various electronic products. Android Bluetooth system contains linux kernel, Bluetooth driver, Bluetooth protocol layers blueZ Bluetooth user library, blueZ adaptation layer.[2]

blueZ Bluetooth user library, blueZ adaptation layer.[2] Lord Krishna College of Engineering (An ISO 9001:2008
blueZ Bluetooth user library, blueZ adaptation layer.[2] Lord Krishna College of Engineering (An ISO 9001:2008

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:

"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.

in Engineering and Technology ( ICADET-14), INDIA. Fig 2: Android Bluetooth structure Bluetooth can be used

Fig 2: Android Bluetooth structure

Bluetooth can be used to transmit asynchronous data and synchronous language at the same time. L2C AP, SDP, RFCOMM etc are underlying protocol layer include a number of agreements. It provides the upper transmission.

a number of agreements. It provides the upper transmission. Fig 3: Relationship between Bluetooth Protocol III.

Fig 3: Relationship between Bluetooth Protocol

III. PROCESS OF BLUETOOTH 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 OF BLUETOOTH 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 using Bluetooth communication for the security purpose. The connected devices will be shared with a RFCOMM channel to transmit data. RFCOMM bluetoothSocket used to accept the incoming connections must be attached to operating system resources with the bind method. 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-

The query pairing process is shown in the following figure- Lord Krishna College of Engineering (An
The query pairing process is shown in the following figure- Lord Krishna College of Engineering (An

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:

"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.

in Engineering and Technology ( ICADET-14), INDIA. Fig 4: The pairing process ii. Finding devices: In

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.

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:

of pairing connection shown in the following diagram: Fig 5: Bluetooth pairing and Connection process Lord

Fig 5: Bluetooth pairing and Connection process

diagram: Fig 5: Bluetooth pairing and Connection process Lord Krishna College of Engineering (An ISO 9001:2008
diagram: Fig 5: Bluetooth pairing and Connection process Lord Krishna College of Engineering (An ISO 9001:2008

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:

"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.

in Engineering and Technology ( ICADET-14), INDIA. Fig 6: Workflow of the Bluetooth Chat Room V.

Fig 6: Workflow of the Bluetooth Chat Room

V. DESIGN OF MODULES WITH SAMPLE CODE

i. Discovering Devices: Device discovery is a scanning procedure and searches the local area for Bluetooth enabled devices. If the Bluetooth device is currently enabled to be discoverable then only it will respond to the discovery request. If the device is discoverable then it will respond by sharing some information such as device name, class and its unique MAC address. First time connection request automatically presented to the user. The information can be read using the Bluetooth APIs. Difference between paired and being connected are:

 

Paired

To be connected

Two devices

Devices

are aware of each other’s existence.

currently

share

an

RFCOMM channel.

They have a

Transmit

shared link-key that can be used for the authentication.

data

with

each

other.

Capable of

establishing an encrypted connection with each other.

Sample code : startDiscovery method is used in the class of BluetoothAdapater. It executes asynchronously, so we do not consider the thread is blocked. Whole process takes about 12 seconds[3]. Then register a BroadcastReceiver object to receive the Bluetooth device information. Then filter ACTION_FOUND intent to obtain the tailed information for each remote device.

// Create a BroadcastReceiver for ACTION_FOUND private final BroadcastReceiver mReceiver = new BroadcastReceiver() { public void onReceive(Context context, Intent intent) { String action = intent.getAction(); // When discovery finds a device if (BluetoothDevice.ACTION_FOUND.equals(action))

{

// Get the BluetoothDevice object from the Intent

BluetoothDevice

intent.getParcelableExtra(BluetoothDevice.EXTRA_DE

VICE); // Add the name and address to an array adapter to show in a ListView mArrayAdapter.add(device.getName() + "\n" + device.getAddress()); }}};

device

=

+ "\n" + device.getAddress()); }}}; device = Lord Krishna College of Engineering (An ISO 9001:2008
+ "\n" + device.getAddress()); }}}; device = Lord Krishna College of Engineering (An ISO 9001:2008

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:

"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 in the pairing a Bluetooth device in the class BluetoothAdapter to obtain a paired device. This method returns the array of Bluetooth device to distinguish between each paired device.

Sample code:

Set<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices(); // If there are paired devices if (pairedDevices.size() > 0) { // Loop through paired devices for (BluetoothDevice device : pairedDevices) { // Add the name and address to an array adapter to show in a ListView mArrayAdapter.add(device.getName() + "\n" + device.getAddress());}}

iii. Establishing: For the establishment of a Bluetooth communication must go through :

Get local Bluetooth devices;

Find the remote device;

Pairing;

Connect devices; and

Transfer data.

iv. Server Design: Server is needed to connect the two devices because it holds an open bluetoothserversocket. It is designed to listen for incoming connection requests.

Call listenUsingRfcommWithServiceRecord(String, UUID) to get Bluetooth server socket. String = Name of the service, UUID = sign of connection

Call the method accept() to listen for connection request and return a connection on Bluetooth socket bluetoothsocket.

Call the method close() after listening to a connection to close the listener.

v. Client Design: Bluetooth Device object is used to initialize a connection. Obtain the Bluetooth socket and initialize the connection by the BluetoothDevice object.

and initialize the connection by the BluetoothDevice object. Lord Krishna College of Engineering (An ISO 9001:2008
and initialize the connection by the BluetoothDevice object. Lord Krishna College of Engineering (An ISO 9001:2008

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:

"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.

in Engineering and Technology ( ICADET-14), INDIA. Fig 7: Detailed design of Bluetooth Chat Room[4] VI.

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

VI. ADVANTAGE OF BLUETOOTH CHAT IN ANDROID

i. Low-power & low-cost wireless connection.

VII. LIMITATIONS OF CHATTING ROOM SYSTEM IN ANDROID BLUETOOTH

ii. Open standard short-range wireless communication.

i.

Strangers can communicate with others using Bluetooth devices.

iii. Bluetooth offers higher level service profiles, such as FTP-like file servers, voice transport, and more.[8]

ii.

Bluejacking, refers to people who send irrelevant, surprising, or shocking messages to 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 globe for the working frequency band.

vii. Low cost transmission technology for the handheld devices.

VIII. CONCLUSION AND FUTURE WORKS

The internet age of today chat room is of a great entertainment features project. Most of the internet user likes it.

features project. Most of the internet user likes it. Lord Krishna College of Engineering (An ISO
features project. Most of the internet user likes it. Lord Krishna College of Engineering (An ISO

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:

"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 chatting room system is good for developing Bluetooth network application and Bluetooth agreement. The system have realized the broadcast and private chat between mobile phones. But few still need to further improve the usability and functionality of the system like richer input format, the expression of information, pictures, information transmission etc.

REFERENCES

[1]

E2ECloud studio. Google Android[M] posts & telecom press.

2009

[2]

[2] The Bluetooth Special Interest Group. Bluetooth Specification Core v4.0 (2009-02). [3] Han Chao, Liang Quan, Principles and development points of the Android system[M]. Publishing House of Electronics industry. 2010

[3]

yang Fegsheng. Android Inside [M]. Machinery Industry Press.

2008

[4]

Andre N Klingsheim. J2ME Bluetooth Programming[D].

Department of informatics University of Bergen, 2004 [5] W., ONGTANG, M., AND MCDANIEL, P. OnLightweight Mobile Phone Application Certification. In Proceedingsof the 16th ACM Conference on Computer and Communications Security (CCS) (Nov. 2009).

[6]

M., AND MCDANIEL, P.

Understanding Android Security. IEEE Security & Privacy

ENCK,

W.,

ONGTANG,

Magazine 7, 1 (January/February 2009), 5057.

[7] FELMETSGER, V., CAVEDON, L., KRUEGEL, C., AND

[8]

VIGNA, G. Toward Automated Detection of Logic Vulnerabilities inWeb Applications. In Proceedings of the USENIX Security Symposium (2010). FIRST TECH CREDIT UNION. Security Fraud: Rogue Android

[9]

Smartphone app created. Dec. 2009. GOODIN, D. Backdoor in top iphone games stole user data, suit

claims. The Register, November 2009. [10] HOVEMEYER, D., AND PUGH, W. Finding Bugs is Easy. In Proceedings of the ACM conference on Object-Oriented Programming Systems, Languages, and Applications (2004). [11] JOHNS, T. Securing Android LVL Applications. 2010. [12] JUNG, J., SHETH, A., GREENSTEIN, B., WETHERALL, D.,MAGANIS, G., AND KOHNO, T. Privacy Oracle: A System for Finding Application Leaks with Black Box Differential Testing. In Proceedings of the ACM conference on Computer and Communications Security (2008). [13] KASPERSKEY LAB. First SMS Trojan detected for smartphones running Android. August 2010. [14] KIRDA, E., KRUEGEL, C., BANKS, G., VIGNA, G., AND KEMMERER, R. A. Behavior-based Spyware Detection. In Proceedings of the 15th USENIX Security Symposium (Aug.

2006).

of the 15th USENIX Security Symposium (Aug. 2006). Lord Krishna College of Engineering (An ISO 9001:2008
of the 15th USENIX Security Symposium (Aug. 2006). Lord Krishna College of Engineering (An ISO 9001:2008

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

Page 141