Kullanıcı Kılavuzu

Bluetooth Is Open

Bluetooth Is Open

The Bluetooth Is Open action is used to check whether Bluetooth is turned on on the mobile device. It allows you to check the Bluetooth status of the device before triggering Bluetooth-powered functions of your application. If Bluetooth is turned off, the user can be shown a warning or the operation can be stopped.

Technical Specifications

  • Bluetooth Status Check: Checks whether Bluetooth is turned on on the device.
  • Warning Message: A warning can be shown to the user if Bluetooth is turned off.
  • Mobile Compatibility: Action only works on mobile projects.
  • Custom Method Support: It works by connecting to methods specific to Bluetooth data sources added via Datasource.

Bluetooth Is Open Action Implementation 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 add new datasource screen via the + icon on the left. Then select Bluetooth as Datasource Type.
  • Device Name is mandatory, Device ID and Device Address are optional.
  • Registration is completed by clicking the CREATE button.

2. Defining a New Method

  • Enter the added data source.
  • Select ADD NEW METHOD.
  • Define the required fields: Name, Characteristic ID, Service ID, Characteristic Type.
  • SAVE saves the method.

3. Adding Bluetooth Is Open Action

  • Click on the method you created.
  • Select + ADD ACTION → Custom → userguide123 → BluetoothIsOpen_bluetooth from the Properties panel on the right.

Parameter Definitions

  • showAlert (Boolean): Specifies whether to show a warning message to the user if Bluetooth is turned off. Example: true
  • alertMessage (String): The content of the alert message to be shown to the user. Example: “Please turn on Bluetooth”

Usage Scenario: Bluetooth Control on Mobile Device

On an application screen, we want to add a button to prompt the user to turn on Bluetooth. When the user presses the “Scan with Bluetooth” button, a warning will be shown if Bluetooth is not turned on on the device.

1. Switch to the UI Design module.

  • Add a Button element.
  • In the Properties panel, name the button as “Scan with Bluetooth”.

2. To start the scanning process when this button is clicked + ADD ACTION menu:

OnClick → Custom → Kuika → BluetoothIsOpen_bluetooth action.

3. Action configuration:

Enter the parameters of the action as follows:

  • showAlert: true
  • alertMessage: “Please turn on Bluetooth”

After these steps, when the user presses the button, a warning message will be displayed on the screen if Bluetooth is not turned on on the device.

Bluetooth Is Open Action Advanced Customizations

  • Conditional Action Chain: If Bluetooth is off, the transaction can be stopped; if it is on, the data sending action can be triggered.
  • Multi-Platform Control: Different alerts can be shown depending on the type of mobile device (Android/iOS).
  • Data Transfer Delay: Delay can be added to wait for Bluetooth to become active.

Technical Risks and Control

  • Mobile Support Requirement: Action only works on mobile devices; it should not be used in a web environment.
  • Bluetooth Access Authorization: The app must have permission to use Bluetooth.
  • Real-Time State: If the user turns Bluetooth on and off during the action, the action flow should be designed accordingly.

Other Related Content

No items found.

Glossary

No items found.

Alt Başlıklar