Você está na página 1de 51

ACKNOWLEDGEMENT

The satisfaction and euphoria that accompany the successful completion of any task would be incomplete without mention of the people who made it possible whose constant guidance and encouragement crowned our efforts with success. We consider our privilege to express our gratitude and respect to all those who guided us in the completion of this project. We express our sincere gratitude to Dr. Y. P. Nerkar, Principal, PVGs College of Engineering and Technology, Pune for providing us facilities. We wish to place on record our grateful thanks to Prof and Head of Department of Computer Engineering and Information Technology, Prof. G. V. Garje for providing us support and help to come out of problems that we faced during the tenure. We thank our guide Prof. Urmila Kalshetti, Lecturer, Department of Computer Engineering and Information Technology for her valuable time and guidance to complete this project. Last but not the least we would like to thank our teaching and non-teaching staff of department of I.T. and our friends, without their help the completion of our project wouldnt have been possible.

Mujawar Suraj Y Dhokane Amol S Kulkarni Swapnil P Shah Ashish R (BE Information Technology)

ABSTRACT
Multiplayer gaming is one of the emerging technology in the era. Multiplayer gaming can be done using LAN, WiFi, and Bluetooth. Multiplayer game can be played on both computer as well as on the mobile device. Multiplayer gaming can be easily carried over computer due its capability and processing power. But in case of mobile its somewhat difcult. In case of a mobile device only P2P gaming can be easily done using Bluetooth. So to extend the limit, we decided to develop a game which will allow more than two users to connect their mobile over a single network and play multiplayer game. The network named as Bluetooth LAN technically PICONET is used. Due to this, the game can be played anywhere and at any time if the devices are within the bluetooth range. Typically, multiplayer games are organized based on a Client-Server (CS) or a Peer-to-Peer (PP) architecture. In CS, players exchange periodic updates through a central server that is also responsible for resolving any state inconsistencies. In PP, each player communicates with every other player.

Contents
1 Introduction 1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Need . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3 Basic Concept . . . . . . . . . . . . . . . . . . . . . . . . . . Literature Survey 2.1 Scope of the Study . . . . . . . . . . . . . . . . . . . . . . . 2.2 Technologies catering same concepts . . . . . . . . . . . . . . 2.3 Advantages, Disadvantages and Limitations . . . . . . . . . . 2.4 Reviews . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4.1 Emerging Security Threats for Mobile Platforms . . . 2.4.2 The Platform of Quick Development of Mobile 3D Game . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4.3 The Study for the Extension of Bluetooth Ring Network 2.4.4 Other related work . . . . . . . . . . . . . . . . . . . Proposed System 3.1 Problem Statement 3.2 Goals . . . . . . . 3.3 Objectives . . . . . 3.4 Features . . . . . . 3.5 Scope . . . . . . . 3.6 Constraints . . . . 1 2 2 3 4 4 4 4 4 4 5 6 6 8 8 8 9 9 9 10

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

Research Methodology 11 4.1 Steps to carry out project work . . . . . . . . . . . . . . . . . 11 Sotware Requirements and Specications 13 5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 5.1.1 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . 13 5.1.2 References . . . . . . . . . . . . . . . . . . . . . . . 13

5.2

5.3

5.1.3 Overview . . . . . . . . . . . . . . . Positioning . . . . . . . . . . . . . . . . . . 5.2.1 Problem Statement . . . . . . . . . . 5.2.2 Product Position Statement . . . . . . Product Overview . . . . . . . . . . . . . . . 5.3.1 Product Perspective . . . . . . . . . . 5.3.2 Hardware and software requirements 5.3.3 Performance Requirements . . . . . . 5.3.4 Environmental Requirements . . . . . 5.3.5 Advantages . . . . . . . . . . . . . . 5.3.6 Disadvantages . . . . . . . . . . . . 5.3.7 Applications . . . . . . . . . . . . . 5.3.8 UML Diagrams . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

13 14 14 14 14 15 16 16 17 17 17 19 19 25 25 25 26 26 28 29 31 33 36 36 36 36 36 36 37

Implementation 6.1 Implementation . . . . . . . . . . 6.1.1 Bluetooth . . . . . . . . . 6.1.2 API Description . . . . . 6.1.3 Protocols . . . . . . . . . 6.1.4 Bluetooth Communication 6.1.5 Code Snippets . . . . . . 6.1.6 J2ME and Bluetooth . . . 6.1.7 Snapshots . . . . . . . . . 6.2 Testing . . . . . . . . . . . . . . . 6.2.1 Introduction and test plan . 6.2.2 Goals And Objectives . . 6.2.3 Goals And Objectives . . 6.2.4 White Box Testing . . . . 6.2.5 Black Box Testing . . . . 6.2.6 Test Cases And Results . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

Project Planning And Scheduling 38 7.1 Project Planning . . . . . . . . . . . . . . . . . . . . . . . . . 38 7.2 Scheduling . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Conclusion And Future Work 40 8.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 8.2 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

Chapter 0

List of Tables
5.1 5.2 5.3 5.4 5.5 6.1 6.2 Problem Statement . . . . . . Product Positioning Statement Customer Support System . . Hardware Requirements . . . Software Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 14 15 16 16

JSR 82 - Bluetooth API . . . . . . . . . . . . . . . . . . . . 26 Test Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

PVGs COET, Department of Information Technology 2012-13

iii

List of Figures
5.1 5.2 5.3 5.4 5.5 7.1 System Architecture . Class Diagram . . . . Use Case Diagram . Sequence Diagram . Activity Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 21 22 23 24

Schedule Diagram . . . . . . . . . . . . . . . . . . . . . . . . 39

Chapter 1

Introduction

Chapter 1 Introduction
Multiplayer gaming is one of the emerging technologies in the era. Multiplayer gaming can be done using LAN, Wi-Fi, and Bluetooth. Multiplayer game can be played on both computers as well as on the mobile device. Multiplayer gaming can be easily carried over computer due its capability and processing power. But in case of mobile its somewhat difcult. In case of a mobile device only P2P gaming can be easily done using Bluetooth. So to extent the limit a game which will allow more than two users to connect their mobile over a single network and play multiplayer game is needed. The network named as Bluetooth LAN is used. So, due to this the game can be played anywhere and at any time if the devices are within the bluetooth range. At the beginning, mobile (cell) phones were simple communication devices with limited computation and communication capabilities. Few years before mobile games were simple single player games with limited graphics and Artifcial intelligence of opponents. With progress in HW, games became not only graphically rich applications, but also wide bandwidth multiplayer mobile games. The main motivation of our game is to enable connection and management of players (up to 8) via a mobile phone through Bluetooth link. In addition, players should be able to challenge of the other players while driving a car on the selected track. Even though many contemporary multiplayer mobile games support only two players (e.g. Panzer Tactics, Requiem of Hell, Rifts world, Pet Gen, One, Hammer and Sickle), there are many supporting from 4 (High Seize, Worms, High Size, Operation Shadow, Ashen, Glimmerati), 6 (Pathway to Glory Ikusa Islands) up to 16 (Pirates of Caribbean) players. We are presenting pure ad-hoc mobile game.

PVGs COET, Department of Information Technology 2012-13

Chapter 1

Introduction

We tried to investigate the use of Bluetooth in developing J2ME application. It uses the context of developing a game application to demonstrate the functionality of Bluetooth. The game will be programmed using J2ME, and include wireless multiplayer functions.

1.1

Motivation

As the handheld devices are getting richer and richer, their capacity, resolution processing power, advanced OS demands us to develop something new for these devices. Increasing craze of mobile applications, available tools to develop them, available testing environment, increasing market demand made it possible to design new application for the mobile devices. Lack of richness in the available applications in the of network gamming (bluetooth networked, Wi-Fi networked, GPRS networked) made us to add required richness in the bluetooth multiplayer mobile game. We studied lots of mobile games, looked for their graphics, their networking functions, available resources, web sources, available papers for the bluetooth network and gaming, we established the base for the development of our game application. According to the same we gathered its requirements, analyzed them, designed, implemented and tested through all the SDLC phases.

1.2

Need

As the current trend is changing, people especially kids are looking forward for exciting cum thrilling experiences in and around the environment. Mobile can be one of the assets which provide a lot of entertainment to the user. So we decided why not mobile be made more exciting for the user? Hence we decided to develop Bluetooth Networked Racing Game using J2ME. The need for this game is, as games available in market are just P2P games. Impact of this is only two players can connect to each other device and play the game. So, in order to make a gaming LAN we are implementing this game. We tried to have Personal Computer gaming experiences on the mobile, with rich graphics, additional players connected through mobile bluetooth network. At the same time, we tried to nd out new application area of bluetooth piconet. The main purpose of our application not only is the networked game but the extension of bluetooth piconet.
PVGs COET , Department of Information Technology 2012-13 2

Chapter 1

Introduction

The Bluetooth Networked Racing Game is a game which will provide features like single player as well as multiplayer. Multiplayer will be able to connect to the server via bluetooth link. It will contain a server to which the slaves or client will be connected. The synchronization will be carried through this server.

1.3

Basic Concept

We are implementing Bluetooth Networked Racing Game using J2ME which will allow more than 2 users to connect in a network and compete.

PVGs COET , Department of Information Technology 2012-13

Chapter 2

Literature Survey

Chapter 2 Literature Survey


2.1 Scope of the Study

The literature survey is conducted for the period 2012 - 2013. It includes the articles of journals, papers, magazines. In addition to above searches, bibliography of journal article are also reviewed for more sources as well as websites and consulted various eminent experts.

2.2

Technologies catering same concepts

KORA games Rally Pro

2.3

Advantages, Disadvantages and Limitations

Multiplayer. Only P2P i.e. only 2 players can connect and play. Time consuming.

2.4
2.4.1

Reviews
Emerging Security Threats for Mobile Platforms

Delac, G.; Silic, M.; Krolo, J. MIPRO, 2011 Proceedings of the 34th International Convention Publication Year: 2011 , Page(s): 1468 - 1473

PVGs COET, Department of Information Technology 2012-13

Chapter 2

Literature Survey

The proliferation of smart-phone devices, with ever advancing technological features, has brought the issue of mobile device security back into focus. Mobile devices are rapidly becoming attractive targets for malicious attacks due to signicant advances in both hardware and operating systems. The modern mobile platforms, like Android, iOS and Symbian, increasingly resemble traditional operating systems for PCs. Therefore, the challenges in enforcing smart-phone security are becoming similar to those present in PC platforms. By installing malicious content, smart-phones can be infected with worms, trojan horses or other virus families, which can compromise users security and privacy or even gain complete control over the device. Additionally, the improvements in smart-phone features introduce new types of security concerns. By compromising mobile OS, malicious applications can access voicerecording devices, cameras, intercept SMS messages or gain location information. Such security breaches severely compromise users privacy. In this paper we present an analysis of contemporary mobile platform threats and give an in-depth overview of threat mitigation mechanisms built into state of the art mobile operating systems. 2.4.2 The Platform of Quick Development of Mobile 3D Game

Zhao Jieyi; Tang Min; Tong Ruofeng; Dong Jinxiang Computer Science and Computational Technology, 2008. ISCSCT 08. International Symposium on Volume: 2 Digital Object Identier: 10.1109/ISCSCT.2008.331 Publication Year: 2008 , Page(s): 226 - 229 Cited by: 1

The platform of quick development of mobile 3D game can be used to reduce the mobile 3d phone games develop-cycle. With this platform, the developers can break out of the complexity of programming. Thus more efforts will be putted into enriching contents of the game itself. The core of the platform of quick development of mobile 3D game is the ability of conguration, which can be divided into the following parts. The rst part is the implementation of a 3D mobile game template in the environment of Symbian OS and Nokia Series 60 platform. The example game is a rst-person shooting (FPS) game using OpenGL ES. The second part is to analyze the whole structure of the game systems, and to extract the parameters of the game which can be
PVGs COET , Department of Information Technology 2012-13 5

Chapter 2

Literature Survey

customized. According to the extracted part, we make the customized XML documents. Finally we use custom tools to customize the game. The tools modify the XML data following the programmers intention and use the XML data to rewrite the game source codes and to build a new version of the game. 2.4.3 The Study for the Extension of Bluetooth Ring Network

Multimedia and Information Technology (MMIT), 2010 Second International Conference on Date of Conference: 24-25 April 2010 Author(s): Chung-Hsin Liu Dept. of Comput. Sci., Chinese Culture Univ., Taipei, Taiwan Shi-Wei Dai

Bluetooth is a short distance and low-power wireless transmission technology. Although the application of Bluetooth technology, models, mainly in a piconet (Piconet) within the means of communication, but I believe in the near future after the more popular Bluetooth chips, decentralized network (Scatternet) the application of model will continue to emerge. For example, in a meeting among the many people involved with each other viaBluetooth scatter-net formation. However, to achieve Scatternet related applications is obviously necessary to rst solve the network data transmission problems between devices. NS2 software used in this paper to simulate in a Bluetooth piconet, the Bluetooth packet transmission by analysis of transmission over the packet transmission path, packet transmission delays or lost, to nd solutions related to the corresponding methods to increase the efciency of data transfer, so that Bluetoothnetwork to improve the stability of the overall transmission. 2.4.4 Other related work

Multiplayer Gaming with Bluetooth

Bluetooths performance characteristics better suit multiplayer gaming than slower, intermittent wide-area connections over TCP/IP. Most important, message latency is much smaller with Bluetooth, ranging from 40 to 400 milliseconds on average, and degrades in proportion to the size and number of

PVGs COET , Department of Information Technology 2012-13

Chapter 2

Literature Survey

messages transmitted on the network. This exceeds on average the best performance of TCP/IP on the newly deployed 3G wireless networks. Bluetooth connections are also more robust in the face of interference, and dropped connections due to loss of signal are rare. Bluetooth connectivity is sometimes called personal area networking, and the personal nature of the interaction patterns force a simplied network topography. A Bluetooth network is called a piconet and consists of one or more client devices connected to a single master device. The master device is therefore responsible for all message routing on the piconet. Each device on a piconet gets a unique identier based on a three-bit address space, which effectively enforces a maximum number of eight devices on a single piconet. Up to seven client devices can connect to a master device to form a piconet. Some devices may further limit the number of devices on a piconet. Consult the bluetooth.connected.devices.max property of the Local Device class to determine the maximum number of devices allowed by a device.

PVGs COET , Department of Information Technology 2012-13

Chapter 3

Proposed System

Chapter 3 Proposed System


3.1 Problem Statement

The problem of only P2P gaming is permitted which affects game user and the impact of this is only two players are able to play. So in order to solve a successful solution would be a game which will permit more than two players to play. Our game application is application where two or more mobile users in Bluetooth range can establish personal LAN and Race with opponents. The need for this game is, as games available in market are just P2P games. Impact of this is only two players can connect to each other device and play the game. So, in order to make a gaming LAN we are implementing this game.

3.2

Goals

While designing the application, our only aim was to enable multiple players to join the single game session using bluetooth and play the game. In this only server member is allowed to select the track which is applicable for all. But while selecting the vehicle, decision will be individual one. User can select his/her own vehicle which he wants. Providing attractive graphics, collision detections, timing information, rank wise data after the race, providing details about the playtime rank of the player, playing background track were the secondary goals.

PVGs COET, Department of Information Technology 2012-13

Chapter 3

Proposed System

3.3

Objectives

Our only objective is to nd out new area of application where bluetooth functionality provided in the devices can be used up to great extent. Apart from the project related concepts we studied bluetooth protocol stack. Multiplayer requires two or more JSR-82. Its possible to connect up to seven clients to single server, although this depends on the phone in use. All clients need starting before the server and some phones are more suitable to act as server. Following are few devices supporting JSR-82 specication: Nokia Samsung Motorola Sony Ericson,etc.

3.4

Features

3D vehicles and environment Multiplayer Ease in handling Thrill and challenging

3.5

Scope

Initially we have limited the scope: Limited no of clients i.e. only 3 No continuation No dynamic entry Compatible with JAVA enabled devices

PVGs COET , Department of Information Technology 2012-13

Chapter 3

Proposed System

3.6

Constraints

Following are the few constraints in the game: Device should be java enabled Device should have bluetooth functionality Atleast two players are needed Devices must support JSR-82 specications.

PVGs COET , Department of Information Technology 2012-13

10

Chapter 4

Research Methodology

Chapter 4 Research Methodology


4.1 Steps to carry out project work

A full SDLC lifecycle is followed while developing the project. Waterfall model and Iterative model is mainly used.
Software development life cycle

First of all a total plan was estimated about the project. Then requirement gathering was carried out which were required for nding the details of the project. After that analysis of the required information was done so that it will be used in development. After this step coding and testing was done simultaneously. And iteratively the game was nally developed. Following approaches are used while implementing our project to achieve the goals: Map Generation using LEVEL EDITOR. Remote Parameters Passed to the Server as Data. These are used as actual parameters for the home methods. Collision detection using square generation technique. P-2-P link management with the server.

PVGs COET, Department of Information Technology 2012-13

11

Chapter 4

Research Methodology

Here are some most important methods that helped in managing multiple connctions during the game session: LocalDevice.getProperty(bluetooth.sd.trans.max ) Returns maximum number of devices that devices can connect to. LocalDevice.getProperty(bluetooth.connected.devices.max ) The maximum number of connected devices. LocalDevice.getProperty (bluetooth.connected.inquiry) Is inquiry allowed during a connection: true or false.

PVGs COET , Department of Information Technology 2012-13

12

Chapter 5

Sotware Requirements and Specications

Chapter 5 Sotware Requirements and Specications


5.1 Introduction

The purpose of this document is to collect, analyze and dene high-level needs and features of the Bluetooth Networked 3D Racing Game. It focuses on the capabilities needed by the stakeholders, and the target users, and why these needs exist. 5.1.1 Purpose

Entertainment Learning Reduce mental stress 5.1.2 References

Beginning J2ME from novice to professionals: Jason Salas. Articial Intelligence: George Luger 5.1.3 Overview

Game will contain following menus:


New Game

Single player Multiplayer

PVGs COET, Department of Information Technology 2012-13

13

Chapter 5 Options

Sotware Requirements and Specications

Car Track
Help Quit

Yes No

5.2
5.2.1

Positioning
Problem Statement
Table 5.1: Problem Statement The problem of Only P2P gaming is permitted Affects Game user The impact of which is only 2 players are able to join A successful solution would be the game which will permit up to 7 players in bluetooth range.

5.2.2

Product Position Statement


Table 5.2: Product Positioning Statement Mobile users wants thrill, play multiplayer game Bluetooth Networked 3D Racing Game entertainment, person to interact other games eg. KORA Not only entertain but also provide thrill and make user to tackle different challenges, allow multiplayer gaming.

For Who The That provides Unlike Our product

5.3

Product Overview

The BLUETOOTH NETWORKED 3D RACING GAME is a game which provides features as single player or multiplayer. Multiplayer will be able to
PVGs COET , Department of Information Technology 2012-13 14

Chapter 5

Sotware Requirements and Specications

connect to the server via bluetooth link. It will contain a server to which several clients will be connected. Synchronization will be carried out using this server. 5.3.1 Product Perspective

This game is an independent stand-alone product. It is totally self-contained.


Hardware Interfaces

Game will be executed over java enabled mobile having bluetooth facility.
Software Interfaces

J2ME NOKIA IDE for Java ME (Eclipse) v1 JDK1.0.6

Summary of capabilities

Table 5.3: Customer Support System Customer Benet Supporting Features Supportive documentary Knowledge base assists support personnel in quickly identifying known xes and workarounds Customer satisfaction is Problems are uniquely itemized, improved because nothing falls classied and tracked throughout the through the cracks resolution process. Automatic notication occurs for any aging issues. Management can identify Trends and take an high level review.

Assumptions and Dependency

Multiplayer game will be played within the specied bluetooth range.

PVGs COET , Department of Information Technology 2012-13

15

Chapter 5 Product Requirements

Sotware Requirements and Specications

Java enabled handset having bluetooth facility. Development environment NOKIA IDE for Java ME (Eclipse) v1 5.3.2 Hardware and software requirements

Hardware Requirement

Table 5.4: Hardware Requirements Processor Pentium 4 RAM Minimum 256 MB HDD Minimum 40 GB

The Java ME APIs for Bluetooth are targeted at devices characterized as follows: 512 K minimum total memory available (ROM/Flash and RAM). Application memory requirements are additional. Bluetooth network connection. Compliant implementation of the Java ME Connected Limited Device Conguration (CLDC).
Sotware Requirement

Table 5.5: Software Requirements Platform Windows XP, Windows 7 Languages Java J2ME

5.3.3

Performance Requirements

Response time. Loading screen should not take more than 5 seconds to load.

PVGs COET , Department of Information Technology 2012-13

16

Chapter 5

Sotware Requirements and Specications

5.3.4

Environmental Requirements

Java Enabled device Bluetooth dongle The mobile Bluetooth-based game we developed is deployed using clientserver system architecture. The software that generates the game world runs continuously on a server, and players connect to it via client software. The client software may provide access to the entire playing world. The Bluetooth standard allows up to seven slaves devices and a master to form a centralized ad hoc network called a piconet. In our mobile Bluetooth-based game, the master can be allocated by all its clients. When there is a high density of clients around, we have to interconnect the multiple close-by piconets to form a scatternet. The Bluetooth standard does not specify a specic scatternet formation algorithm. 5.3.5 Advantages

More than 2 players can connect each other. It will provide entertainment. Compatible with any handset. Loading process is faster than other games. Less error prone around 99.99 5.3.6 Disadvantages

Might lead to an exception in some condition. Bluetooth is mandatory. In case of server incompatibility it may hamper smooth working of the game.

PVGs COET , Department of Information Technology 2012-13

17

Chapter 5

Sotware Requirements and Specications

Figure 5.1: System Architecture

The mobile Bluetooth-based game we developed is deployed using clientserver system architecture. The software that generates the game world runs continuously on a server, and players connect to it via client software. The client software may provide access to the entire playing world. The Bluetooth standard allows up to seven slaves devices and a master to form a centralized ad hoc network called a piconet. In our mobile Bluetooth-based game, the master can be allocated by all its clients. When there is a high density of clients around, we have to interconnect the multiple close-by piconets to form a scatternet. The Bluetooth standard does not specify a specic scatternet formation algorithm

PVGs COET , Department of Information Technology 2012-13

18

Chapter 5

Sotware Requirements and Specications

5.3.7

Applications

Can act as client server model if modied. Many users may compete with each other simultaneously. 5.3.8 UML Diagrams

UML was meant to be a unifying language enabling IT professionals to model computer applications. The primary authors were Jim Rumbaugh, Ivar Jacobson, and Grady Booch, who originally had their own competing methods (OMT, OOSE, and Booch). Eventually, they joined forces and brought about an open standard. (Sound familiar? A similar phenomenon spawned J2EE, SOAP, and Linux.) One reason UML has become a standard modeling language is that it is programming-language independent. (UML modeling tools from IBM Rational are used extensively in J2EE shops as well in .NET shops.) Also, the UML notation set is a language and not a methodology. This is important, because a language, as opposed to a methodology, can easily t into any companys way of conducting business without requiring change. Since UML is not a methodology, it does not require any formal work products (i.e., artifacts in IBM Rational Unied Process lingo). Yet it does provide several types of diagrams that, when used within a given methodology, increase the ease of understanding an application under development. There is more to UML than these diagrams, but for my purposes here, the diagrams offer a good introduction to the language and the principles behind its use. By placing standard UML diagrams in your methodologys work products, you make it easier for UML-procient people to join your project and quickly become productive. The most useful, standard UML diagrams are: use case diagram, class diagram, sequence diagram, state chart diagram, activity diagram, component diagram, and deployment diagram. In software engineering, a class diagram in the Unied Modeling Language (UML) is a type of static structure diagram that describes the structure of a system by showing the systems classes, their attributes, and the relationships between the classes. This diagram shows various classes or main entities involved in the system and also their relationship with each other. It depicts the attributes and operations each class can carry out, individually and with help of other classes in the system designed.

PVGs COET , Department of Information Technology 2012-13

19

Chapter 5

Sotware Requirements and Specications

A use case diagram in the Unied Modeling Language (UML) is a type of behavioral diagram dened by and created from a Use-case analysis. Its purpose is to present a graphical overview of the functionality provided by a system in terms of actors, their goals (represented as use cases), and any dependencies between those use cases. The main purpose of a use case diagram is to show what system functions are performed for which actor. Roles of the actors in the system can be depicted. A sequence diagram in Unied Modeling Language (UML) is a kind of interaction diagram that shows how processes operate with one another and in what order. It is a construct of a Message Sequence Chart. A sequence diagram shows object interactions arranged in time sequence. It depicts the objects and classes involved in the scenario and the sequence of messages exchanged between the objects needed to carry out the functionality of the scenario. Sequence diagrams typically are associated with use case realizations in the Logical View of the system under development. Activity diagram in Unied Modeling Language (UML) is a kind of interaction diagram that shows how activities are carried out in synchronization with one another and in what order. It is a construct of a Flow Chart. A activity diagram shows object interactions arranged in time sequence. It depicts the objects and classes involved in the scenario and the activities exchanged between the objects needed to carry out the functionality of the scenario.

PVGs COET , Department of Information Technology 2012-13

20

Chapter 5

Sotware Requirements and Specications

Figure 5.2: Class Diagram

The class diagram consists of three entities viz. player, game and gameengine. Player and Game engine both are associated with game entity. A player may be either client and server.Each entity consists of its own different methods.

PVGs COET , Department of Information Technology 2012-13

21

Chapter 5

Sotware Requirements and Specications

Figure 5.3: Use Case Diagram

The use case diagram two actors client and server. Both actors have different use cases as per their role in game. Game is extended as it is being provided by third party.

PVGs COET , Department of Information Technology 2012-13

22

Chapter 5

Sotware Requirements and Specications

Figure 5.4: Sequence Diagram

The sequence diagram consists of 6 entities. Out of which aster and slave are the physical entities which actually deals with the game.And remaining four are internally executed. Different messages exchanged are shown using line and the acknowledgement is displayed using dashed lines.

PVGs COET , Department of Information Technology 2012-13

23

Chapter 5

Sotware Requirements and Specications

Figure 5.5: Activity Diagram

The above activity diagram shows the ow of the game. How the user has to navigate through game is shown using the different activites and interactions. It shows both the single player and multiplayer activities. And at last both are connected to the game engine.

PVGs COET , Department of Information Technology 2012-13

24

Chapter 6

Implementation

Chapter 6 Implementation
6.1
6.1.1

Implementation
Bluetooth

Bluetooth is one of the wireless communication protocols. It is mainly used for short distance and in devices with low power consumption. With the help of Bluetooth, you can communicate in an Omni-directional manner of up to 30 feet at 1 Mb/s. JSR 82 is based on version 1.1 of the Bluetooth Specication. Bluetooth is the rst open, non-proprietary standard for developing Bluetooth applications using Java programming language. It hides the complexity of the Bluetooth protocol stack behind a set of Java APIs, that emphasis on application development rather than the low-level details of Bluetooth. This specication includes basic support for at least, the following Bluetooth protocols: RFCOMM OBEX Service Discovery protocols L2CAP (Logical Link Control and Adaptation Protocol) Additional protocol support may be added in future versions. The specication is primarily targeted at native Bluetooth protocols.

PVGs COET, Department of Information Technology 2012-13

25

Chapter 6

Implementation

6.1.2

API Description

Java APIs for Bluetooth dene two packages that depend on the CLDC javax.microedition.io.*; package: javax.bluetooth: core Bluetooth API javax.obex: APIs for the Object Exchange (OBEX) protocol OBEX APIs are dened independently of the Bluetooth transport layer and packaged separately. Each of the above packages represents a separate optional package, which means that a CLDC implementation can include either package or both. MIDP enabled devices are expected to be the kind of devices to incorporate this specication.
Table 6.1: JSR 82 - Bluetooth API Name Description bluetooth.api.version Supported version of Bluetooth wireless technology. The current version is 1.1. obex.api.version Supported version of Bluetooth wireless technology. The current version is 1.1. bluetooth.l2cap.receiveMTU.max maximum ReceiveMTU size in bytes supported in L2CAP. bluetooth.connected.devices.max maximum number of connected devices. bluetooth.connected.inquiry Is inquiry allowed during a connection: true or false. bluetooth.connected.page Is paging allowed during a connection: true or false. bluetooth.connected.inquiry.scan Is inquiry scanning allowed during a connection: true or false. bluetooth.connected.page.scan Is page scanning allowed during a connection: true or false. bluetooth.master.switch Is master/slave switch allowed: true or false. bluetooth.sd.trans.max Maximum number of concurrent service discovery transactions. bluetooth.sd.attr.retrievable.max Maximum number of service attributes to be retrieved per service record.

6.1.3

Protocols

Bluetooth API javax.bluetooth denes the following protocol for communication:

PVGs COET , Department of Information Technology 2012-13

26

Chapter 6

Implementation

L2CAP RFCOMM

Logical Link Control and Adaptation Protocol (L2CAP)

JSR-82 denes the L2CAPConnectionNotier and L2CAPConnection interfaces for sending and receiving packets over L2CAP channels. These are derived from the CLDC Generic Connection Framework interface Connection. An L2CAP server is created by calling Connector.open() with an appropriate server connection string. The format of the string is dened by JSR-82. The connector string begins with the protocol prex btl2cap:// and may contain parameters related to a master/slave preference, or security parameters (authentication, encryption, and authorization). It may also contain parameters related to the applications preference for a desired Maximum Transmit Unit (MTU) size in the send and/or receive directions. An L2CAPConnectionNotier object is returned when opening a server connection. The method acceptAndOpen() can be used to accept connections from remote clients. L2CAP packets are sent or received using the send and receive methods of class L2CAPConnection. An application using L2CAP connections must provide its own ow control if needed. L2CAP clients are created in a similar way with method Connector.open() using a client connection string.
Radio Frequency Communication (RFCOMM)

RFCOMM connections provide reliable, bidirectional, stream-oriented communication. In JSR-82, the API is based on the StreamConnectionNotier and StreamConnection interfaces of the Generic Connection Framework dened for Connected Limited Device Conguration (CLDC). An RFCOMM server is created by calling Connector.open() with an appropriate server connection string. The format of the string is dened by JSR-82. The connector string begins with the protocol prex btspp:// and may contain parameters related to a master/slave preference, or security parameters (authentication, encryption, and authorization). A StreamConnectionNotier object is returned when opening a server connection and its acceptAndOpen() method can be used to accept connections from remote clients. Input and output streams are used to read or write data on a connection. RFCOMM clients are created in a similar
PVGs COET , Department of Information Technology 2012-13 27

Chapter 6

Implementation

way with method Connector.open() using a client connection string. 6.1.4 Bluetooth Communication

Bluetooth application has to carry out the following parts for communication: stack initialization, setting discovery mode, device discovery, service discovery, and connection. Stack initialization In Bluetooth device, the Bluetooth stack is used for controlling the device. So this should be initialized rst before starting. After the initialization, device will be ready for use. In JSR 82, specication consists of LocalDevice class. This is also called as basic entry point. LocalDevice class helps in initializing the JSR 82 stack. This is also used to control the local Bluetooth settings. LocalDevice class provides the lowest level of access to the Bluetooth stack. LocalDevice class provides with the ability to query information about your own Bluetooth device. To initialize Bluetooth stack, get the LocalDevice reference by calling static method LocalDevice.getLocalDevice() localDevice = LocalDevice.getLocalDevice(); Joinong an existing game From a programming standpoint, joining an existing game is a simple matter of advertising the clients availability for the game. Hosts will scan the vicinity for all clients that advertise this specic service. A service is identied by a universally unique identier (UUID) that is known in advance to the applications that wish to communicate. The UUID class represents a UUID and can convert a UUID to and from its string representation. A UUID is basically an arbitrary number, and because they can be very large, just picking one at random gives a very good chance of getting a number no other Bluetooth developer in the galaxy is using. Applying some simple algorithms to the generation of the UUID, incorporating the current time and the network address of your computer, for instance, practically guarantees that the UUID is truly unique.

PVGs COET , Department of Information Technology 2012-13

28

Chapter 6

Implementation

6.1.5

Code Snippets

Device Inquiry

Device Discovery

PVGs COET , Department of Information Technology 2012-13

29

Chapter 6 Service Discovery

Implementation

The SDP denes how a Bluetooth clients application shell acts to discover available Bluetooth servers services and their characteristics. The protocol denes how client can search for a service based on specic attributes without the client knowing anything of the available services. The SDP provides means for discovery of new services become becoming available when the client enters an area where a Bluetooth server is operating. The SDP also provides functionality for detecting when a service is no longer available.

PVGs COET , Department of Information Technology 2012-13

30

Chapter 6 Registering a Service

Implementation

Opening a connection

6.1.6

J2ME and Bluetooth

J2ME provides several classes to aid developers in adding Bluetooth functionality to their applications. These classes are contained within the J2ME.bluetooth package. The classes are used to gain information about the Bluetooth capaPVGs COET , Department of Information Technology 2012-13 31

Chapter 6

Implementation

bilities of the device on which the software is running, seek other devices and services, then make and receive connections. The APIs are somewhat similar to java APIs. One of the fundamental aims of the game is to implement reusable packages and interfaces. The following information will be useful for everyone wishing to develop beyond the interfaces and into the classes that will actually do the Bluetooth programming in our game. Local Device: The LocalDevice class provides the basic functions for gaining information about the Bluetooth capabilities of the host device. These functions include: getBluetoothAddress(); - String getDiscoveryAgent(); - DiscoveryAgent getFriendlyName(); - String The Bluetooth address is set by the device itself. The Friendly Name is set by the user. The function returning the DiscoveryAgent is the way in which discovery services can be accessed. Discovery and Discovery Listeners: The Discovery Agent is responsible for the discovery functions of the local device. To access the DiscoveryAgent class, one must get the Local Device from a static method of the LocalDevice class and then retrieve the DiscoveryAgent as: DiscoveryAgent myDiscAg = LocalDevice.getLocalDevice ().getDiscoveryAgent (); A class implementing the DiscoveryListener interface must have the following methods: deviceDiscovered(RemoteDevice rd, DeviceClass dc) inquiryCompleted(int discType) servicesDiscovered(int trans, ServiceRecord[] svRc) serviceSearchCompleted(int trans, int respCode)

PVGs COET , Department of Information Technology 2012-13

32

Chapter 6

Implementation

6.1.7

Snapshots

PVGs COET , Department of Information Technology 2012-13

33

Chapter 6

Implementation

PVGs COET , Department of Information Technology 2012-13

34

Chapter 6

Implementation

PVGs COET , Department of Information Technology 2012-13

35

Chapter 6

Implementation

6.2
6.2.1

Testing
Introduction and test plan

Software testing validates the developed software to demonstrate that it performs its functions in accordance with its design. The software test workow manages the process testing and feedback during the integration and test stage. 6.2.2 Goals And Objectives

Software testing is an investigation conducted to provide stakeholder with information about the quality of the product or service under test. One of the goals of software testing is to provide an objective, independent view of the software to allow the business to appreciate and understand the risks of software implementation. 6.2.3 Goals And Objectives

The scope of software testing often includes examination of as well as execution of that code in various environments and conditions as well as examining the aspects of code: does it do what it is suppose to do and do what it needs to do. In the current culture of software development, a testing organization may be separate from the development team. There are various roles for testing team members. Information derived from software testing may be used to correct the process by which the software is developed. 6.2.4 White Box Testing

White box testing is when the tester has the access to the internal data structures and algorithms including the code that implement these. 6.2.5 Black Box Testing

This testing method focuses on the functional requirement of the software. It attempts to nd out the error of the categories such as incorrect or missing functions, interface errors, error in data structure, performance error and initialization and termination errors.

PVGs COET , Department of Information Technology 2012-13

36

Chapter 6

Implementation

6.2.6

Test Cases And Results

Test Cases

Id 1 2 3 4 5

Name Device Discovery Service Discovery Events Multiple connections Server Failure

Table 6.2: Test Cases Input Expected output Bluetooth On Device Found Found Devices Devices Paired Key Pressed Data tranferred and dispalyed Multiple Devices Connected Network Disconnected

6 7 8

Client Failure Score Exchange Latency

Data Transfer

Message sent to other devices Score data sent and displayed Should be less near to 70ms

Observed Output Device Found Devices Paired Data tranferred repainted Connected Network disconnected and Message displayed Message displayed Score displayed Variable Latency

Results

All above test cases have been tested on NOKIA devices and have been passed. It may happen that other devices may fail in some of the test cases like Device Discovery Service Discovery Opening Multiple Connections Variable Latency

PVGs COET , Department of Information Technology 2012-13

37

Chapter 7

Project Planning And Scheduling

Chapter 7 Project Planning And Scheduling


7.1 Project Planning

Project planning consists of following three aspects: Scope: We have decided to develop a game which will allow more than two players to connect in a bluetooth network and play the game. It will have tracks and cars which will be selected by the user as per his or her choice. The games which are available in market are just two player multiplayer game. So inorder to avoid , a multiplayer game is developed which will avoid this problem. Estimation: The requirements are estimated as per the need of the game. The cost of the project will be the subject to the decision of the stake holders. Risk Analysis: A risk analysis involves identifying the most probable threats to the project and analyzing the related vulnerabilities of the project to these threats. Few risk are in case if server fails another may be bluetooth latency.

7.2

Scheduling

The project schedule is as follows: The project topic was decided in the mid of July.

PVGs COET, Department of Information Technology 2012-13

38

Chapter 7

Project Planning And Scheduling

Figure 7.1: Schedule Diagram

Related requirements were gathered till mid of October and were analyzed as well as elicitated. Designing part was done in September. Actual implementation was started in December and iteratively the game was developed.

PVGs COET , Department of Information Technology 2012-13

39

Chapter 8

Conclusion And Future Work

Chapter 8 Conclusion And Future Work


8.1 Conclusion

Multiplayer gaming is one of the emerging technology in the era. Multiplayer gaming can be done using LAN, WiFi, and Bluetooth. Multiplayer game can be played on both computer as well as on the mobile device. Multiplayer gaming can be easily carried over computer due its capability and processing power. But in case of mobile its somewhat difcult. In case of a mobile device only P2P gaming can be easily done using Bluetooth. So to extend the limit, we decided to develop a game which will allow more than two users to connect their mobile over a single network and play multiplayer game. The network named as Bluetooth LAN is used. Due to this, the game can be played anywhere and at any time if the devices are within the bluetooth range. Thus, going through all steps of SDLC cycle, we successfully implemented BLUETOOTH NETWORKED RACING GAME.

8.2

Future Work

Extending piconet to the scatternet So that more than players can be connected belonging to different piconets Creating superior graphics Providing attractive 3D look Creating logs of the game sessions
PVGs COET, Department of Information Technology 2012-13 40

Chapter 8

Conclusion And Future Work

Providing sound effects Giving Choice of different vehicles other than cars Allowing communication using Wi-Fi technology

PVGs COET , Department of Information Technology 2012-13

41

Chapter 8

REFERENCES

References
[1] T. Gu, H.K. Pung, D.Q. Shang :A service-oriented middleware for building context-aware services, Journal of Network ad Computer Applications 20 1-18, Elsevier, 2005B. [2] Schilit, N. Adams, R. Want : Context-Aware Computing Applications, Proceedings of Mobile Computing Systems and Applications, Santa Cruz, CA, December 1994. Pages 85-90, IEEE Computer Society. [3] T. Salonidis, P. Bhagwat, L. Tassiulas, R. LaMaire : Distributed Topology Construction of Bluetooth Personal Area Networks, Proceedings of IEEE INFOCOMM, Anchorage, Alaska, USA 2001. [4] C. Law, K.Y. Siu : A Bluetooth Scatternet Formation Algorithm, Proceedings of the IEEE Symposium on Ad Hoc Wireless Networks 2001Goss J.D., Leinbach T.R. (1996) Focus groups as alternative research practice, Area 28 (2): 115-23. [5] A. Soylu, P. Causmaecker, P. Desmet : Context and Adaptivity in Pervasive Computing Environments: Links with Software Engineering and Ontological Engineering, Journal of Software, Vol 4, No 9 (2009) [6] C.B. Kumar, P.J. Kline, T.J. Thompson : Bluetooth Application Programming with JAVA APIs, Morgan Kaufmann Publishers, 2004. [7] B. Kumar: JSR-82: Java APIs for Bluetooth. Available at : http://www.jcp.org/en/jsr/detail?id=82. Promoter Members of Bluetooth SIG: Specication of the Bluetooth System-Core. Version 1.1, Bluetooth SIG, Inc. [8] A. Soylu, P. Causmaecker, P. Desmet : Context and Adaptivity in Pervasive Computing Environments: Links with Software Engineering and Ontological Engineering, Journal of Software, Vol 4, No 9 (2009) [9] S. Basagni, C.Petrioli : A Scatternet Formation Protocol for ad hoc Networks of Bluetooth Devices, Proceedings of IEEE VTC Spring 2002.
PVGs COET, Department of Information Technology 2012-13 42

Appendix User Manual Following are the steps to be carried out while playing the game. Copy Race.jar application to your device Open Race.jar le Select play game option Select multiplayer Select one of the option i.e. Client or Server As our application follows Client-Server architecture, so player performs one of the two roles. He could be in either server role or client role. In case user is in Server role then he must perform following steps : Select server option, you may be prompted to switch your bluetooth on. Wait for clients to get connected. for the user referrence, number of connections your device supports is displayed in the down-left corner. the NOKIA devices on which we tested this application supports seven connections. Some devices sopport four connections. On the exceptional side, device may not support multple connection. All the client devices running game application will be synchronized with the server and the total nuber of devices will be displayed on the down-right corner of the screen. Once clients are connected, Server is prompted to select vehicle type and then track. If this procedure is successful, game session will be started. And being server, you can compete with the other client players.

Number of exceptions and messages may occur such as Bluetooth communication error, Array out of bound, no device found, Client disconnected etc.

In case user is in Client role then he must perform following steps : Select Client option, you may be prompted to switch your bluetooth on. It takes hardly 3-4 secs. to nd the server. Once Server is found, you will beprompted to accept the connection request. Once request is accepted, you must select your vehicle. And wait for server to start the game session. Once the server has selected the track and started game, you just go and compete with others. Number of exceptions and messages may occur such as Bluetooth communication error,Server not found, Server disconnected etc.

Glossary Abbreviation J2ME: Java 2 Mobile Micro Edition IDE : Integrated Development J2ME: Java 2 Mobile Micro Edition IDE : Integrated Development JDK: Java Development Kit 3D: 3 dimensional P2P: Peer to Peer UML: Unied Modeling Language LAN: Local Area Network

Você também pode gostar