O'Reilly logo

App Inventor for Android: Build Your Own Apps — No Experience Required! by Jason Tyler

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 9: BlueChat: A Bluetooth Chat Client

In This Chapter

• Setting up and using simple Bluetooth connections

• Using procedures with parameters

• Updating and controlling text in dynamic labels

BlueChat is a simple chat client/server. With it, two previously paired devices can send text messages to each other. As with the previous project, this project builds a base level of functionality and then challenges you to create added functionality. BlueChat can set up the client/server connection between only two devices — adding a third device is a whole different level of complexity.

The Bluetooth component in App Inventor is a low-level component. This means that it has a great deal of power and functionality, but also a great deal of complexity. Two Bluetooth components can be placed from the Not Ready for Prime Time palette. One is the Bluetooth server, the other the Bluetooth client. Only one of each is needed for two-way connectivity between your devices. However, in the BlueChat application, you use both components so that either device can initiate the connection.

Creating the BlueChat Application

While creating the BlueChat application, you will learn the basics of establishing a connection between two Bluetooth devices and then passing a basic text string between them. Many complexities are involved in Bluetooth communications. The functionality included with the App Inventor components can handle most common scenarios. However, in this project, you strip Bluetooth communication ...

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