Usage Scenario: Connection Check Before Data Transmission

In a health app, when the user clicks the “Get Data” button, the Bluetooth connection of the blood pressure monitor is checked before data is retrieved from the device. If the device is not connected, a warning is displayed to the user, and then the connection process is initiated.

1. Go to the UI Design module.

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

2. When this button is clicked, add the following from the + ADD ACTION menu for connection checking:

  • OnClick → Custom → Kuika → IsConnected_bluetooth action.

3. Conditional Actions:

  • If connected:
  • → Add the Custom → Kuika → GetDataFromDevice_bluetooth action (data is retrieved from the device).
  • If not connected:
  • → Notify the user with the Notify action:
    • title: “Warning”
    • message: “Please connect the device.”
    • type: “warning”
    • → Then trigger the Custom → Kuika → Connect_bluetooth action (the connection process to the device is initiated).

With this scenario, the user does not encounter a direct data retrieval error when the device is not connected; the system first checks the connection, connects if necessary, and then proceeds with data retrieval.