Kullanıcı Kılavuzu

Connect Bluetooth

Connect Bluetooth

Connect Bluetooth action is used to establish a connection between your mobile application and a specific Bluetooth device. This action is the basic connection step for applications that receive data from Bluetooth-enabled devices, control devices, or read from sensors.

Technical Specifications

  • Bluetooth Device Connection: Establishes a connection between the application and a specific Bluetooth device.
  • UUID Definition: Provides access to specific features of the targeted Bluetooth device with service and characteristic definitions.
  • Real-Time Communication: Enables data exchange after connection.
  • Mobile Compatibility: The action only works on mobile platforms (Android and iOS).
  • Bluetooth Data Source Integration: Works directly integrated with the Bluetooth type data source.

Connect Bluetooth Action Application Steps

1. Adding a Bluetooth Data Source

  • Log in to the Kuika platform.
  • Open your mobile project from the Apps screen.
  • Go to the Datasources module from the left menu.
  • Open the new data source screen using the + icon on the left. Then select Bluetooth as the Datasource Type.
  • Fill in the required fields:
    • Device Name (required): The visible name of the device
    • Device ID (optional): The unique ID of the device
    • Device Address (optional): The Bluetooth address of the device (e.g., 00:1A:2B:3C:4D:5E)
  • Click the CREATE button to create the data source.

2. Defining the Bluetooth Method

  • Click the ADD NEW METHOD button located at the top right of the created data source.
  • Fill in the following fields:
    • Name: The name of the method you are creating
    • Service ID: Identifies the service on the device
    • Characteristic ID: Identifies the specific data field
    • Characteristic Type: Select one of the options: Read, Write, Notify, Indicate
  • Click the SAVE button.

3. Adding the Connect Bluetooth Action

  • Click on the method you created.
  • In the Properties panel on the right:
    • + ADD ACTION → Custom → userguide123 → Select the Connect_bluetooth action.
  • After configuring the action, click the SAVE button to complete the process.

Parameter Definitions

There are no special parameters to configure in the Connect Bluetooth action. The action establishes a direct connection using the device information from the defined data source.

Usage Scenario: Connecting to a Smart Scale

A health app automatically enters data by retrieving the user's weight from a scale via Bluetooth. The first step in this process is for the app to connect to the scale device via Bluetooth.

1. Go to the UI Design module.

  • Add a Button element.
  • Set the button name to “Connect to Scale” in the Properties panel.

2. When this button is clicked, add the following action from the + ADD ACTION menu to connect to the scale device:

  • OnClick → Custom → Kuika → Connect_bluetooth.
  • Select SmartScale_BT as the data source.

3. As the follow-up action:

  • If the connection is successful, the Read method is executed, the weight data is retrieved from the scale, and displayed on the screen.
  • With this flow, when the user clicks the “Connect to Scale” button, the device connects to the scale, and the weight information is automatically retrieved and displayed on the application interface.

Connect Bluetooth Action Advanced Customizations

  • Post-Connection Data Reading: After the Connect action is successful, real-time data can be retrieved from the device using the Read or Notify process.
  • Conditional Flow: By checking the connection status, data can be retrieved if the connection is successful, and the user can be notified if it is unsuccessful.
  • Multi-Device Support: If the user needs to connect to multiple devices, a structure can be set up to connect to the dynamically selected device.
  • Automatic Connection: When the application is opened, an automatic connection can be made to the defined device.

Technical Risks and Precautions

  • Device Unavailable Error: If the device is not turned on or the application cannot find the device, the connection cannot be established. The user should be notified.
  • Platform Compatibility: iOS and Android devices may behave differently depending on their Bluetooth versions. Compatibility tests should be performed.
  • Connection Timeout: If a connection to the device cannot be established, the action should not enter an infinite wait state but should return an error after a certain period of time.
  • Permission Missing: If the application does not have the necessary Bluetooth and location permissions, the connection process will fail. It is recommended to check BluetoothPermissionIsGiven beforehand.

The Connect Bluetooth action enables you to integrate your mobile application with Bluetooth hardware. It provides an ideal connection mechanism for scenarios such as receiving data from Bluetooth-enabled devices, sending data to devices, or communicating with sensors. It enriches the user experience and enables real-world interaction.

Other Related Content

No items found.

Glossary

No items found.

Alt Başlıklar