O'Reilly logo

Beginning iPad™ Application Development by Wei-Meng Lee

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

Chapter 15. Bluetooth Programming

WHAT YOU WILL LEARN IN THIS CHAPTER:

  • How to use the various APIs within the Game Kit framework for Bluetooth communications

  • How to look for peer Bluetooth devices using the GKPeerPickerController class

  • How to send and receive data from a connected device

  • How to implement Bluetooth voice chat

The iPad comes with built-in Bluetooth functionality, allowing it to communicate with other Bluetooth devices, such as Bluetooth headsets, iPhone, iPod touch, and iPad. This chapter shows you how to write iPad applications that use Bluetooth to communicate with another device, performing tasks such as sending and receiving text messages, as well as voice chatting. Daunting as it may sound, Bluetooth programming is actually quite simple using the iPhone SDK. All the Bluetooth functionalities are encapsulated within the Game Kit framework.

Note

To test the concepts covered in this chapter, you need two devices iPads, iPhones (3G or 3GS), or iPod touches (second generation or later) running iPhone OS 3.0 or later.

USING THE GAME KIT FRAMEWORK

One of the neat features available in the iPhone SDK is the Game Kit framework, which contains APIs that allow communications over a Bluetooth network. You can use these APIs to create peer-to-peer games and applications with ease. Unlike other mobile platforms, using Bluetooth as a communication channel in the iPad is way easier than expected. In this section, you will learn how to build a simple application that allows two iPad ...

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