The Felgo 3.11.0 update brings many new features like Speech-to-Text capabilities, an image provider to preview PDFs, network service discovery with ZeroConf and the ability to search the Felgo Live Server log output. It also includes many improvements and fixes added during the development of Felgo 4.
- Use Speech-to-Text on Android and iOS
- Image Provider to Preview PDF Pages
- Discover Network Services with ZeroConf (Bonjour)
- Search the Felgo Live Server Log Output
- Android 12+ Support: Updates to Felgo Plugins
- More Features and Improvements
Make sure you update to Felgo 3.11 to benefit from all the improvements and fixes until you are ready to migrate to Felgo 4.
Use Speech-to-Text on Android and iOS
Speech recognition technology has become increasingly popular and practical across a wide range of applications, from voice assistants to transcription services. The recently introduced SpeechToText QML API empowers you to integrate speech-to-text capabilities directly into your Qt Quick code.
The API relies on the inherent power of the native Android and iOS platform APIs and Frameworks, ensuring a smooth and efficient integration process on both platforms. With a few lines of code, you can activate voice input and capture spoken language within your application.
import Felgo 3.0
import QtQuick 2.15
App {
NavigationStack {
Page {
title: "Speech to Text"
AppButton {
id: button
anchors.horizontalCenter: parent.horizontalCenter
flat: false
enabled: SpeechToText.recognitionAvailable
text: !SpeechToText.recognitionActive ? "Start" : "Stop"
onClicked: {
if(!SpeechToText.recognitionActive)
SpeechToText.startSpeechToText("en-US")
else
SpeechToText.stopSpeechToText()
}
}
Connections {
target: SpeechToText
enabled: SpeechToText.recognitionAvailable
onSpeechToTextResult: (result, isFinal) => {
recognized.text = result
}
}
AppText {
id: recognized
width: parent.width
anchors.top: button.bottom
anchors.bottom: parent.bottom
verticalAlignment: Text.AlignTop
}
}
}
}
All available system locales and transcription features of the underlying platform, like on-device or online transcription, are supported. See the documentation for more information on the necessary project configuration for iOS and Android.
Image Provider to Preview PDF Pages
The PDFPage Image Provider is a versatile tool that lets you transform PDF pages into images. It is especially useful to show preview thumbnail images of your PDF files, or to build a light-weight PDF viewer. Simply specify the image source attribute with an image://pdfpage/ URL and you are ready to go:
AppImage {
source: "image://pdfpage/" + pdfPath
}
You can also choose the page you want to display:
AppImage {
source: "image://pdfpage/" + pdfPath + ":" + pageNumber
}
Discover Network Services with ZeroConf (Bonjour)
The Bonjour/ZeroConf protocols allow devices to broadcast their active network services. By scanning the local network, your macOS, iOS and Android applications can get information about the service type, IP addresses and port, and other attributes.
You can use ZeroConf::startNetworkServiceDiscovery() to start searching for services in the active network:
import QtQuick 2.0
import Felgo 3.0
App {
id: app
readonly property string serviceTypeAllServices: "_services._dns-sd._udp."
readonly property bool searching: ZeroConf.networkServiceDiscoveryActive
property var foundServices: ({})
Component.onCompleted: ZeroConf.startNetworkServiceDiscovery(serviceTypeAllServices)
NavigationStack {
id: stack
ListPage {
title: "Service types"
emptyText.text: "Searching for service types..."
model: Object.values(foundServices).filter(service => !service.resolved)
delegate: AppListItem {
text: modelData.name
detailText: modelData.type
onSelected: showServiceType(modelData)
}
}
}
Component {
id: servicesPage
ListPage {
title: "Services for: " + serviceType
model: Object.values(foundServices).filter(service => service.type === serviceType)
emptyText.text: "Searching for services..."
required property string serviceType
onPushed: {
console.log("Start search for type:", serviceType)
ZeroConf.stopNetworkServiceDiscovery()
ZeroConf.startNetworkServiceDiscovery(serviceType)
}
onPopped: {
ZeroConf.stopNetworkServiceDiscovery()
ZeroConf.startNetworkServiceDiscovery(serviceTypeAllServices)
}
delegate: AppListItem {
text: modelData.name
detailText: {
return "Type: %1\nDomain: %2\nHost: %3\nPort: %4\nAddresses: %5\nAttributes: %6"
.arg(modelData.type)
.arg(modelData.domain)
.arg(modelData.hostName)
.arg(modelData.port)
.arg(JSON.stringify(modelData.addresses, null, " "))
.arg(JSON.stringify(modelData.attributes, null, " "))
}
}
}
}
Connections {
target: ZeroConf
function onNetworkServiceDiscovered(serviceData) {
console.log("Network service discovered:", JSON.stringify(serviceData, null, " "))
foundServices[serviceData.name] = serviceData
foundServicesChanged()
}
function onNetworkServiceRemoved(serviceData) {
console.log("Network service removed:", JSON.stringify(serviceData, null, " "))
delete foundServices[serviceData.name]
foundServicesChanged()
}
}
function showServiceType(serviceModel) {
// the service search returns the type property like "_udp.local.", containing protocol and domain
// split it to get the protocol, and add it to the service name
var elems = serviceModel.type.split(".")
var serviceType = "%1.%2.".arg(serviceModel.name).arg(elems[0])
stack.push(servicesPage, { serviceType: serviceType })
}
}
See the ZeroConf documentation for more information and relevant platform-specific integration steps.
Search the Felgo Live Server Log Output
Another highly requested and useful feature finally made it into this update: The Felgo Live log search. As your project grows, the Qt Quick console log can quickly get large, which makes it hard to find your desired log lines in the Felgo Live Server.
You can now activate a search panel in the Felgo Live Server. Press CTRL-F to open the search panel at the bottom of the window. The log search supports case-sensitive or -insensitive search, regular expressions and moving between the results. You can also select text from the log before hitting CTRL-F to directly search with your selection.
Android 12+ Support: Updates to Felgo Plugins
As the Android ecosystem evolves and APIs change, applications and SDKs have to make sure to follow the latest requirements. To support Android 12 and later, several updates to Felgo Plugins were made to use the latest native frameworks. This includes the OneSignal Plugin, Notification Plugin, Firebase Plugin, AdMob Plugin, Chartboost Plugin, Flurry Plugin and Facebook Plugin.
You do not need to change anything in your code. Just make sure to clean your project and create a fresh build after you installed Felgo 3.11.0.
More Features and Improvements
Felgo 3.11.0 includes many more improvements, for example:
- The NativeUtils::share functionality for iOS and Android is updated to properly support sharing text, web links or files with the native share dialog of the latest OS versions.
- The JsonListModel now provides a syncModelToSource method to write changes to the internal structure of the model back to the JSON source.
For all relevant changes, features, and fixes of recent Felgo updates, please check out the changelog.
How to Update Felgo
Try out these new features by following these steps:
- Open the Felgo SDK Maintenance Tool in your Felgo SDK directory.
- Choose “Update components” and finish the update process to get this release as described in the Felgo Update Guide.
- Update Felgo
If you haven’t installed Felgo yet, you can do so now with the latest installer from here. Now you can explore all of the new features included in this release!
More Posts Like This
Release 3.10.0: Native Support for NFC Tags, Network Connection Type & Inline AdMob Banners, Qt Creator 7.0.2
Release 3.9.2: WhatsApp Messenger Demo, Clear the Live Reload Cache and Control the App Navigation Flow
Release 3.9.1: Publish Qt Apps as Android App Bundle on Google Play and Configure Icon Sizes in the Felgo Theme
Release 3.9.0: Improved UX with Overlays & Tooltips and WebAssembly Browser Communication
Release 3.8.0: Call Native APIs from QML with JavaScript, Build for the Raspberry Pi and Update to Qt 5.15.2