Developing apps for Toon

Forum about forum-provided applications on Toon

Moderators: marcelr, TheHogNL, TerrorSource, Toonz

Developing apps for Toon

Postby hvxl » Sat Feb 23, 2019 4:48 pm

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 26 times
Last edited by hvxl on Mon Jul 08, 2019 4:26 pm, edited 1 time in total.
Schelte
hvxl
Senior Member
Senior Member
 
Posts: 1190
Joined: June 2010

Re: Developing apps for Toon

Postby Toonz » Sat Feb 23, 2019 5:16 pm

Wish I had this when I started..... Top!
member of the Toon Software Collective
User avatar
Toonz
Forum Moderator
Forum Moderator
 
Posts: 1113
Joined: December 2016

Re: Developing apps for Toon

Postby mvdbr4nd » Mon Jun 24, 2019 12:38 pm

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 :-(
mvdbr4nd
Starting Member
Starting Member
 
Posts: 3
Joined: June 2019

Re: Developing apps for Toon

Postby Toonz » Mon Jun 24, 2019 2:18 pm

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
member of the Toon Software Collective
User avatar
Toonz
Forum Moderator
Forum Moderator
 
Posts: 1113
Joined: December 2016

Re: Developing apps for Toon

Postby mvdbr4nd » Mon Jun 24, 2019 9:35 pm

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
mvdbr4nd
Starting Member
Starting Member
 
Posts: 3
Joined: June 2019

Re: Developing apps for Toon

Postby Toonz » Tue Jun 25, 2019 9:37 am

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
member of the Toon Software Collective
User avatar
Toonz
Forum Moderator
Forum Moderator
 
Posts: 1113
Joined: December 2016

Re: Developing apps for Toon

Postby mvdbr4nd » Tue Jun 25, 2019 7:41 pm

Thanks a lot, having some logging really helps to spot some syntax issues ;-) which indeed was the case here :roll:
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?
mvdbr4nd
Starting Member
Starting Member
 
Posts: 3
Joined: June 2019

Re: Developing apps for Toon

Postby hvxl » Mon Jul 08, 2019 4:31 pm

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.
Schelte
hvxl
Senior Member
Senior Member
 
Posts: 1190
Joined: June 2010

Re: Developing apps for Toon

Postby Templar » Sun Jul 21, 2019 3:55 pm

I am trying to import the module QtWebSockets 1.1

But the app doesn't load and I get the following error:
file://qmf/qml/apps/slimmemeter/SlimmemeterScreen.qml:4 module "QtWebSockets" is not installed


Is there a way to check which Qt modules are installed?
Templar
Member
Member
 
Posts: 122
Joined: March 2011
Location: Netherlands

Re: Developing apps for Toon

Postby hvxl » Sun Jul 21, 2019 4:08 pm

To use websockets you have to manually install a library. See: https://www.domoticaforum.eu/viewtopic. ... 600#p89600
Schelte
hvxl
Senior Member
Senior Member
 
Posts: 1190
Joined: June 2010


Return to Toon Apps

Who is online

Users browsing this forum: No registered users and 0 guests