Developing apps for Toon
Moderators: marcelr, TheHogNL, Toonz
Developing apps for Toon
I did some investigation to figure out how to develop my own Toon apps. Because more people seem to be looking for this kind of information, I turned my notes into a short manual. It is by no means complete, but should hopefully help to get aspiring developers started. I will update the document if I discover additional interesting items.
- Attachments
-
- DevelopingToonApps.pdf
- Updated: Jul 8, 2019
- (195.39 KiB) Downloaded 1789 times
Last edited by hvxl on Mon Jul 08, 2019 5:26 pm, edited 1 time in total.
Schelte
Re: Developing apps for Toon
Wish I had this when I started..... Top!
member of the Toon Software Collective
Re: Developing apps for Toon
Hi,
Thanks for this great manual. However i seem to get stuck a little. the globals.qml is no longer present in the latest firmware . 5.5.7 (toonstore works as well as the apps availible in the store). I want to create my own apps as well and used this manual. However Tile's do not show op not even with the most trivial demo project. Anyone else that has this issue with the 5.5.7 software?
The app I want to create is somewhat similar to the hass app. but this time for Pilight. or to make it more generic an App that just POST's to a URL with a json string as argument. So you can create tiles (or screen) with buttons that you can use to invoke pilight actions or other services f.e. olisto connectors.
qmlc files are not created uppon restart gui. And there is no logging![Sad :-(](./images/smilies/icon_sad.gif)
Thanks for this great manual. However i seem to get stuck a little. the globals.qml is no longer present in the latest firmware . 5.5.7 (toonstore works as well as the apps availible in the store). I want to create my own apps as well and used this manual. However Tile's do not show op not even with the most trivial demo project. Anyone else that has this issue with the 5.5.7 software?
The app I want to create is somewhat similar to the hass app. but this time for Pilight. or to make it more generic an App that just POST's to a URL with a json string as argument. So you can create tiles (or screen) with buttons that you can use to invoke pilight actions or other services f.e. olisto connectors.
qmlc files are not created uppon restart gui. And there is no logging
![Sad :-(](./images/smilies/icon_sad.gif)
Re: Developing apps for Toon
Hi,
there has been some changes since version 4.22.7 in the way Toon is starting apps.
From 4.22.7 Toon started using so called 'qml resource files' in which all qml resources are located.
We have modified the resource files in a way that also custom apps will be loaded if a number of conditions are met.
The file globalq.qml is not used for that anymore.
Our resource files will load custom apps if and only if:
- the app folder name does not contain the "-" character
- the app folder has only lowercase characters (is actually a requirement for inclusion in the ToonStore later on)
- the app folder contains a file named <FolderApp.qml>, starting with an uppercase character, example ../apps/toonstore/ToonstoreApp.qml
When meeting these requirements the resourcefile will try to start the app, results of that can be tracked in the log files (either console.log or redirect to a file).
N.B. Note that also the way images are processed has changed. Images must be included in the drawables.rcc resource file or our own resourcefile.
Best way forward when starting app development is too use one of the existing builtin images.
We can add your custom images to the resourcefiles later on....
Hope this helps.
Kind regardz,
Toonz
there has been some changes since version 4.22.7 in the way Toon is starting apps.
From 4.22.7 Toon started using so called 'qml resource files' in which all qml resources are located.
We have modified the resource files in a way that also custom apps will be loaded if a number of conditions are met.
The file globalq.qml is not used for that anymore.
Our resource files will load custom apps if and only if:
- the app folder name does not contain the "-" character
- the app folder has only lowercase characters (is actually a requirement for inclusion in the ToonStore later on)
- the app folder contains a file named <FolderApp.qml>, starting with an uppercase character, example ../apps/toonstore/ToonstoreApp.qml
When meeting these requirements the resourcefile will try to start the app, results of that can be tracked in the log files (either console.log or redirect to a file).
N.B. Note that also the way images are processed has changed. Images must be included in the drawables.rcc resource file or our own resourcefile.
Best way forward when starting app development is too use one of the existing builtin images.
We can add your custom images to the resourcefiles later on....
Hope this helps.
Kind regardz,
Toonz
member of the Toon Software Collective
Re: Developing apps for Toon
I did all that but no success even a simple demoApp demoTile for some reason is doenst work on the latest firmware. Also icon I used the one also used by the buienradar app (Just for testing). Killall qt-gui should be enough right?
I'll check the logs to see if anything shows up
I'll check the logs to see if anything shows up
Re: Developing apps for Toon
can you post your app here (in a zipfile)?
BTW: easiest method of logging is via the inittab:
qtqt:245:respawn:/usr/bin/startqt >/var/log/qt 2>&1
The qt log file will be started from scratch again after every gui restart.
Do not keep logging switched on for a longer period on a Toon 1 as it consumes too much available diskspace (can grow 5Mb per day easily).
But for dev purposes it works perfectly
BTW: easiest method of logging is via the inittab:
qtqt:245:respawn:/usr/bin/startqt >/var/log/qt 2>&1
The qt log file will be started from scratch again after every gui restart.
Do not keep logging switched on for a longer period on a Toon 1 as it consumes too much available diskspace (can grow 5Mb per day easily).
But for dev purposes it works perfectly
member of the Toon Software Collective
Re: Developing apps for Toon
Thanks a lot, having some logging really helps to spot some syntax issues
which indeed was the case here
Small note I did have to do a restart completely. killall qt-gui was not enough.
Anyone have any experience using QT designer for these qml files?
Does that have benefits?
![Wink ;-)](./images/smilies/icon_wink.gif)
![Rolling Eyes :roll:](./images/smilies/icon_rolleyes.gif)
Small note I did have to do a restart completely. killall qt-gui was not enough.
Anyone have any experience using QT designer for these qml files?
Does that have benefits?
Re: Developing apps for Toon
You don't have to completely restart Toon. But after editing /etc/inittab, you will have to tell the system to reload the updated inittab. This can be done with the command: init q
I have added this information to the document.
I have added this information to the document.
Schelte
Re: Developing apps for Toon
I am trying to import the module QtWebSockets 1.1
But the app doesn't load and I get the following error:
But the app doesn't load and I get the following error:
Is there a way to check which Qt modules are installed?file://qmf/qml/apps/slimmemeter/SlimmemeterScreen.qml:4 module "QtWebSockets" is not installed
Re: Developing apps for Toon
To use websockets you have to manually install a library. See: viewtopic.php?f=103&t=12332&p=89600#p89600
Schelte
Toon app for flamingo switches ?
Is there anyone who has tried to build an app to manage smart switches fromflamingo (Action retailer in the Netherlands ?
https://www.action.com/nl-nl/p/flamingo ... bediening/
This cheap stuff really works and is an afordable option to start with home domotic.
The sets are very cheap and the inside electronic can easely be dismantled and adapted onto other stuff![Smile :)](./images/smilies/icon_smile.gif)
https://www.action.com/nl-nl/p/flamingo ... bediening/
This cheap stuff really works and is an afordable option to start with home domotic.
The sets are very cheap and the inside electronic can easely be dismantled and adapted onto other stuff
![Smile :)](./images/smilies/icon_smile.gif)
Re: Developing apps for Toon
Not possible from the toon directly but you can use domoticz (and rfxcon) https://www.twoenter.nl/blog/domotica/p ... -domoticz/
Ofcourse, you then can switch the domoticz buttons from the Toon with the domoticzboard toon app
Ofcourse, you then can switch the domoticz buttons from the Toon with the domoticzboard toon app
Member of the Toon Software Collective
Re: Developing apps for Toon
Hi all,
Some great stuff here on this forum!
I've read the DevelopingToonApps manual. But I could not find anything about using the QT webengine.
I think it would be cool to be able to make a simple browser application to serve pages hosted on a machine on the local network.
Resources:
https://doc.qt.io/qt-5.12/qtwebengine-overview.html
doc.qt.io/qt-5/qtwebengine-webengine-qu ... ample.html
But since I'm not a QT developer (and have no access to that IDE) I have no idea if that is even possible. Any thoughts?
Some great stuff here on this forum!
I've read the DevelopingToonApps manual. But I could not find anything about using the QT webengine.
I think it would be cool to be able to make a simple browser application to serve pages hosted on a machine on the local network.
Resources:
https://doc.qt.io/qt-5.12/qtwebengine-overview.html
doc.qt.io/qt-5/qtwebengine-webengine-qu ... ample.html
But since I'm not a QT developer (and have no access to that IDE) I have no idea if that is even possible. Any thoughts?
Re: Developing apps for Toon
Is it possible to use Qt Creator ( https://www.qt.io/blog/2017/05/24/qt-cr ... 0-released ) for GUI creation?
Re: Developing apps for Toon
Only for easy layout testing but not more than that I am afraid. A lot of qml compontents used in the Toon are custom made (or extended on top of existing ones). But yes, it is possible to create a nice layout using qt creator and then translate that into your toon custom app code.
Member of the Toon Software Collective