Development of Bluetooth from mobile phone to PC [3] -- Implementation of Bluetooth-based double play

Source: Internet
Author: User

This mini game is implemented based on Bluetooth communication (a bit redundant), with a C/S structure, but not AI. The process is to enable the server first, and then start the game after the client connection is successful. It is also worth mentioning that each time the client starts a sub-account, it is also a new start! Due to the time spent watching movies and going out to play in the past few daysProgramThe details are not very considerate. I hope you will forgive me later ~

The following figure shows the running game interface in the simulator:

A brief description of the project's directory structure and functions:

---- Bluetooth // package that encapsulates the Bluetooth function

--- Blueclientservice. Java // encapsulates the class of the client's Bluetooth service to implement the runnable and discoverylistener interfaces.

--- Blueserverservice. Java // encapsulates the Bluetooth service class on the server to implement the runnable interface.

--- Btconnection. Java // responsible for Bluetooth connection operations

---- Components // component class, including some interface classes

--- Gamezone. Java // game Main Interface

--- Indexform. Java // first interface, select a type, such as client or server

---- Logic // package the game logic

--- Gamelogic. Java // game logic class

--- Controller. Java // responsible for interaction between game logic and Bluetooth Communication

---- MIDlet // MAIN package

--- Fivechessgame. Java // program entry class

 

Although the program is smallCodeThere are a lot of data, and I will not post it here. Source program:/files/royenhome/fivechessgame.rar

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.