Skip to main content
Unpublished Paper
Analyzing Wi­Fi P2P in the context of a hangman game
Pervavise Systems Research Report (2015)
  • William L Honig, Loyola University Chicago
Abstract

Wi­Fi P2P , which complies with the Wi­Fi Alliance's Wi­Fi Direct™ certification

2 3

program, is a relatively new addition to wireless communications systems. It is now

supported in Android operating system (since version 4.0). In theory, Wi­Fi Direct offers

advantages for ad hoc communications between mobile apps. A key goal of this project

was to evaluate the ability of Wi­Fi P2P for interconnecting mobile apps by using a

common game suitable to mobile screens and devices.

The application allows the user to interconnect two devices using Wi­Fi P2P and

play the classic hangman game. The players search for devices that already have the

game installed using Wi­Fi P2P service discovery and when it finds one, it can send a

connection request to connect with the peer device. The peer device can choose to either

accept or decline the connection request. When the two devices are connected, the game

starts and the players can establish a socket connection using each of their device

configurations and exchange messages with each other. The players take turns in

guessing words. The player who initiates the connection goes first and gets to specify a

word, which the second player has to guess, and a hint (displayed to player 2). The second

player tries to guess the letters of the word and player 1 decides whether the letter is in the

word or not. With every wrong guess, a part the man is hanged. The game ends if the

second player guessed the word or if the hangman diagram is completed. The total score

is displayed at the end of a game session. Any player can end the game session at any

time.

This paper illustrates the software architecture, the method of adding Wi­Fi direct to

your Android application, an understanding of a few pieces of code from the project and

lastly learnings and future scope. A key finding of this project is that the application needs

to run in the foreground in both devices while trying to establish a connection with a peer

device.

Keywords
  • Mobile Systems,
  • WiFi Direct,
  • Games,
  • Android
Publication Date
February 1, 2015
Citation Information
William L Honig. "Analyzing Wi­Fi P2P in the context of a hangman game" Pervavise Systems Research Report (2015)
Available at: http://works.bepress.com/william_honig/3/