RTL.Desktop Beacon Cast Demo Sample

Contents

The sample shows how to use the TBeacon component in a client application to scan for beacon devices. The sample also demonstrates how to take some actions on a specific beacon device, defined by GUID, Major and Minor parameters, when the proximity is inmediate (below 0.5 meters).

To have this sample working and showing values, you need a beacon device.

Description

This is a sample of a server - client application that uses tethering and beacon technology. Beacon transmitters use Bluetooth 4.0 technology to send specific information to nearby devices based on location.

The server and client applications connect to each other using tethering components. Start the server to enable the tethering manager to allow communication with the client application.

The TBeacon component on the client scans for beacon devices, when the beacon device with the parameters defined on the server is found and the proximity to the device is below 0.5 meters, remote actions are executed to take and get a screenshot from the server.

How to Use the Sample

Navigate to the location given above and open DesktopBeaconCast.groupproj. The group contains two projects, the server and the client application. Run the server on a computer and then deploy the client to a mobile device.

Select the target platform. The application works with iOS and Android.

Note: See Using Beacons for more information about client platform support for Beacons.

Press F9 or choose Run > Run.

Click Connect to start the automatic connection between tethering managers.

Approach the mobile to the beacon associated to the server that you want to present on the client application. Once you are close enough to the beacon, a remote screenshot from the server is created and sent to the client by using tethering.

Implementation

The client application lists all the available servers after clicking Connect. The client is notified about the beacon parameters associated with all the available servers. The parameters that identify a specific beacon, that is GUID, Major, and Minor, are stored in a shared resource on the server application. The method used to get the information from the server resource is GetRemoteResourceValue.

The TTetheringAppProfile component is used on the server and the client to create tethering profiles. The Group property allows the connection between the server and the client. There is an action defined on the server profile, actFullShot to create and save the screenshot as a resource. The client uses GetRemoteResourceValue to load the image to the client.