Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Felgo Live Code Reloading: Web Editor

Run this example on your Android and iOS phone now, with the Felgo Live Scripting mobile app!

import Felgo 3.0 import QtQuick 2.0 App { NavigationStack { Page { title: qsTr("BLE Battery") Rectangle { anchors.centerIn: parent width: parent.width * 0.6 height: parent.height * 0.8 radius: dp(30) border.color: 'black' border.width: dp(5) Rectangle { anchors.bottom: parent.bottom width: parent.width height: parent.height * batteryCharacteristic.value / 100 color: batteryCharacteristic.value > 80 ? 'green' : (batteryCharacteristic.value > 30 ? 'orange' : 'red') radius: parent.radius } } AppText { anchors.centerIn: parent text: batteryCharacteristic.value + '%' fontSize: dp(15) } } } BluetoothLeManager { discoveryRunning: true BluetoothLeDevice{ id: myBleDevice BluetoothLeService { uuid: 0x180F // Battery Service BluetoothLeCharacteristic { id: batteryCharacteristic uuid: 0x2A19 // Battery Characteristic dataFormat: 4 // 0x04 for uint8 onValueChanged: { // Value updates console.log('Battery Level Changed', value) } onValidChanged: { // Read initial value once characteristic is valid if (valid) { read() } } } } onConnectedChanged: { // Reconnect logic if (!connected) { console.log('Trying to reconnect') connect() } } } onDeviceDiscovered: { // Match device with service UUID if (device.services.indexOf('{0000180f-0000-1000-8000-00805f9b34fb}') > -1) { myBleDevice.setDevice(device, true) discoveryRunning = false } } } }

1. Download Felgo Live Scripting app

2. Open the app and add the displayed Dev ID here.

QML Hot Reload on all Platforms

With Felgo Live, you can reload code changes in real-time on any connected device. While this web editor is just for demonstration purposes, you can use hot reloading also for development on your desktop.

Download the Felgo Developer App app to run your code on Android and iOS, from Windows, macOS or Linux.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded