O'Reilly logo

Near Field Communication with Android Cookbook by Vitor Subtil

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Inviting a friend to play a game – Part 2

In the Inviting a friend to play a game – Part 1 recipe in Chapter 7, Sharing Content across Devices, we were able to share Bluetooth information between two devices. In Part 2, we will use that information to connect the devices and start a noughts and crosses game.

How to do it...

We will use the BluetoothService class to handle Bluetooth communication and send simple text messages between the devices:

  1. Open Eclipse and create a new Android application project named NfcBookCh9Example4 and package named nfcbook.ch9.example4.
  2. Import the files from the Inviting a friend to play a game – Part 1 recipe in Chapter 7, Sharing Content across Devices, or if preferred, continue following this recipe in the same project. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required