Design and Implement Privet Chatting Over Bluetooth for Wide Area

The mobile applications have become one of the important applications in human life, and it was widely used during the last ten years. Mobile devices can be used to do various tasks, such as browsing the internet, sending or receiving emails, and performing other tasks. Bluetooth technology is considered as one of the important specifications that were added to mobile phones during the current century where the user can use it for data and image transmission and others. One of the important applications of Bluetooth, which appeared in the last years, is the conversation via Bluetooth where users can hold short conversations using this technique. One of the most important benefits of Bluetooth technology is that it's free to send and receive messages. While the disadvantages of this application is that it is short-term, since users must be within the scope of the Bluetooth service which is (7 9 meters) to be able to send messages and use it. In this paper, we will design and implement a private conversation via Bluetooth software which has the ability to work within biggest scopeby taking advantage of the properties of the (Scatternet). Each user of the application can be a crossroads for the other users. In other words, if there is, for example, users (a) and (b) 7 meters away from each other, and a third user (c) appeared within 12 meters of the first user (a). In this case, the third user (c) can be connected to the first user through the user (b). In other words, the second user (b) would be an intermediary between the first user (a) and the third user (c). So, we have been solved the distance limit problem for using the Bluetooth application. In addition, the users Kirkuk University Journal /Scientific Studies (KUJSS) Volume 11, Issue 1, March 2016 , p.p(167-184) ISSN 1992 – 0849 Web Site: www.kujss.com Email: kirkukjoursci@yahoo.com, kirkukjoursci@gmail.com 168 are now able to chat as a group (not just peer-to-peer) in a private room with a wide range using the piconet and scatternet characteristics. Netbeans 5.5, Java 2 Micro Edition (J2ME), Bluetooth API (JSR-82), Nokia Pc Suites are the tools and technologies that have been used through building this application.


INTRODUCTION
The mobile phone has become nowadays an inseparable part of our daily life.
Considerably surpassing in number the amount of desktop computers, mobile phone technology has met great improvements in the last couple of years.It's use is not limited to communication, but can also serve for numerous other purposes whether for business , checking emails, paying for tickets, sending money transfers, taking pictures of your kids, watching soccer World Cup live, checking commodity pricing, and to emergency response to mobile Health.Mobile devices have become an essential tool to help us navigate our day [1].
The Mobile Operating System is responsible for managing physical resources, power consumption and communication interface.A mobile operating system is composed of the computer kernel, the power management facility, and the real-time kernel.The computer kernel is the entity that manages access to physical resources, such as CPU and disk space.
The power management facility is responsible for reducing power consumption.The real-time kernel is responsible for managing the communication link [2].The mobile application just like any other java application .It is a set of compiled class files.The basic outline of a mobile application is pretty much dedicated by the runtime system requirement and the API concepts (application programming interface, is a source code interface that an operating system , library or services provides to support request made by computer programs).As shown in Fig. (1) an application can be in the following states [3]: 1-Active: The application is running and may use system resources.

2-Paused:
The application is temporarily paused because another application needs all resources, e.g. an incoming phone call.

3-Destroy:
The application has been terminated and all resources except for persistent memory need to be cleared.

MOBILE BLUETOOTH
Bluetooth is a short-range radio technology that enables wireless connectivity between mobile devices.It was initially developed by Swedish mobile phone maker Ericsson in 1994 as a way to let laptop computers make calls over a mobile phone.Since then, several companies have signed on to make Bluetooth the low-power short-range wireless standard for a wide range of devices.
The three main goals for Bluetooth were: small size, minimal power consumption, and low price [4].The technology was designed to be simple, and the target was to have it become a standard in wireless connectivity.Bluetooth radio operates in the unlicensed Industrial Scientific and Medical (ISM) band at 2.4 GHz.In some countries, this band is reserved for military use, but these countries have now begun freeing that band for general use.The maximum gross data rate is 1 Mbps.The range of Bluetooth depends on the power class of the radio.
The devices which use a radio communications system, they do not have to be in line of sight of each other; they can even be far apart if the transmission has sufficient power as shown in Table (1) .

Table (1):
The Bluetooth Classes [5] Most devices are expected to use the class 2 radio that provides 4 dBm nominal output power, resulting in a range of up to 10 meters in an obstacle-free environment.This range is sufficient for cable-replacement applications.When a longer range is needed (e.g., in access points), a more powerful radio (class 1) can be used.Larger power consumption is not a problem if the device is a piece of fixed equipment.With mobile devices such as mobile phones, power-consumption issues are crucial and therefore class 2 is the only feasible option.
The Bluetooth system consists of a radio unit, a link control unit, and a support unit for link management and host terminal interface functions see Fig. (2) .The Host Controller Interface (HCI) provides the means for a host device to access Bluetooth hardware capabilities.For example, a laptop computer could be the host device and a PC card inserted in the PC is the Bluetooth device.All commands from the host to the Bluetooth module and events from the module to the host go through the HCI interface.The protocol stack is above the radio and baseband hardware, partly residing in the Bluetooth unit and partly in the host device.
A Bluetooth solution can also be implemented as a one-processor architecture (embedded solution) where the application resides together with the Bluetooth protocols in the same hardware.In that case, the HCI is not needed.This is a feasible implementation for simple devices such as accessories or micro servers [6].

PROBLEM DESCRIPTION
The Bluetooth specification aims to allow Bluetooth devices from different manufacturers to work with one another, so it is not sufficient to specify just a radio system.Because of this, the Bluetooth specification does not only outline a radio system but a complete protocol stack to ensure that Bluetooth devices can discover each other, explore each other's services, and make use of these services.The Bluetooth stack is made up of many layers, as shown in   computer with both Bluetooth and Wi-Fi equipment).The frequency hopping algorithm can then avoid using Bluetooth channels overlapping the Wi-Fi channel in use, hence avoiding interference between your own radio communications.Every Bluetooth device is assigned a unique Bluetooth address, being a 48-bit hardware address equivalent to hardware addresses assigned to regular Network Interface Cards (NICs).The Bluetooth address is used not only for identification, but also for synchronizing the frequency hopping between devices and generation of keys in the Bluetooth security procedures [9].Last seven years, many applications have been developed by using Bluetooth technology.One of those applications was the chatting over Bluetooth peer-to-peer.The limitation of the application was the short range of it, which means, the users should be within the range of the Bluetooth, about 7-9 meter, to be able to send and receive massages [10].Web Site: www.kujss.comEmail: kirkukjoursci@yahoo.com, kirkukjoursci@gmail.com 176 between device A and device C will give us one piconet where A is the master and both B and C are slaves.We see that when a new device wants to be part of a piconet we actually need a role-switch to make this happen, else we get a scatternet [9].Discovery Database is not available.This will inform any other devices that may wish to connect that it is currently occupied.Most entries will also contain user-readable text to explain the type of service they offer, and it is even possible to provide a graphical icon for a service.On the client side, an attempt to make a Bluetooth connection is typically preceded by a process of searching for local Bluetooth-enabled devices and querying the services they provide.This process is known as Service Discovery [13].

The Proposed System Design
The main aim of the proposed system is to design and implement a mobile chatting over Bluetooth, as a group (not peer-to-peer), by using the Piconet and Scattering characteristics to extend the range of the application.In this designed application, the user will have six choices to use.

1.
Enter the Name.

Clear.
4.About the program.

The System Implementation
Users of this application have to download and install the application on their devices.
After installing the application, the icon of the new application can be seen in the application menu of each device.Bluetooth.In this part, the user will enter the name, and the name will be the same name of the chatting for the current user.

A
piconet is the usual form of a Bluetooth network and is made up of one master and one or more slaves.The device initiating a Bluetooth connection automatically becomes the master.A piconet can consist of one master and up to seven active slaves.The master device is literally the master of the piconet.Slaves may only transmit data when transmission-time is granted by the master device, also slaves may not communicate directly with each other and all communication must be directed through the master.Slaves synchronize their frequency hopping with the master using the master's clock and Bluetooth address.

Fig. ( 4 )Fig. ( 5 Fig. ( 6 ):
Fig. (4): A typical piconetPiconets take the form of a star network, with the master as the center node as shown in Fig.(4) .Two piconets may exist within radio range of each other.Frequency hopping is not synchronized between piconets, hence different piconets will randomly collide on the same

Fig. ( 9 )
Fig.(9) shows the address book flowchart.In this part of the project, we created a MIDP project for the mobile client application using Java 2 Micro Edition program, Java platform, Micro Edition is a common language used for developing the mobile applications providing a flexible environment for the application running on mobiles and other embedded phones devices.

Fig. ( 11 )
Fig. (11) is showing the option of choosing and entering the nick name of the chatting over

Table ( 2
[8]Descriptions of Bluetooth protocol layers[8] Application developers do not need to know all the details about the layers in the Bluetooth stack.However, an understanding of how the Bluetooth radio works is of importance.The Bluetooth radio is the lowest layer of Bluetooth communication.The Industrial, Scientific and Medical (ISM) band at 2.4 GHz is used for radio communication.frequency hops per second.Frequency hopping is used to reduce interference caused by nearby Bluetooth devices and other devices using the same frequency band.Adaptive Volume 11, Issue 1, March 2016 , p.p(167-184) ISSN 1992 -0849 Web Site: www.kujss.comEmail: kirkukjoursci@yahoo.com, kirkukjoursci@gmail.com 174 Frequency Hopping (AFH) is introduced in the Bluetooth 1.2 specification and is useful if your device communicates through both Bluetooth and Wi-Fi simultaneously (e.g. a laptop