DroidBridge
June 27, 2012
DroidBridge is a digital version of popular cards game Contract Bridge, for Android (2.3.3 or higher). It is used to play the game with three other players having it installed in their Android device, once they all connect with DroidBridge Game Server.
The app communicates with DroidBridge Game Server over Java Socket
. Data exchange between client and server takes place
in JSON format and follows DroidBridge Communication Protocol v1.0.
Overview
DroidBridge is an Android game that I took up as my summer internship project during Master’s program. The game is based around a popular cards game Contract Bridge, which is played by 4 players together. As it is a multi-player game, back in the year 2012 when I worked on the project, there was nothing like Google Play Game Services. In order to create such a turn-based multiplayer game, I was required to create Game Server, apart from actual Android game client.
DroidBridge game uses Java’s Socket
APIs to connect with DroidBridge Game Server, and uses
DroidBridge Communication Protocol
for exchanging game data across players and server. The protocol design is inspired from HTTP itself, i.e. it requires 3-way
handshake to complete before establishing the connection.
DroidBridge Game
The Game, due to its simple design, doesn’t make use of any gaming engine to render its UI, it is created purely using Android SDK, thus by manipulating graphical images on user interaction. Such simple implementation allows game to be run on any low-end Android device, and also makes it easier to port game for future versions of Android. Download Game design document from here.
DroidBridge Game Server
DroidBridge Game Server is where the Game connects to, from user’s device using Socket connection, the Game server interface is created using Java Swing, the interface provides only two actions, Start Server and Stop Server, and a table showing all the connected game sessions, names of player in each session and game status. Having a Game Server which allows socket-based connection and purely JSON-based communication protocol, it is easier to reuse the Game server for any type of client as long as the client is following the protocol. Download Game Server design document from here.