Use Wi-Fi Direct to Control Remote Cursors

We’ve already implemented the remote cursors app earlier in this chapter in Connect Two Android Devices via Bluetooth. In order to compare Wi-Fi Direct to Bluetooth, we’ll implement the same remote cursor app, replacing its Bluetooth peer-to-peer networking functionality with Wi-Fi Direct. Large portions of the code are identical to the Bluetooth version of the sketch shown here and here, so we will focus only on the code that we’ll change from Bluetooth to Wi-Fi Direct.

Using Wi-Fi Direct, we’ll be able to use the OSC protocol again to send data to remote devices, as we’ve already done in Network an Android with a Desktop PC.

Modify the Main Tab

Get Rapid Android Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.