Published:

Jarle Aase

Monthly update, June 2024

bookmark 3 min read

Projects

stbl

stbl is an acronym for "Static Blog". It is a command-line application for Linux I made 8 years ago. I wanted a new website for my freelance work that was adaptive to various screen sizes, but without all the JavaScript or any backend programming. I wrote a pretty decent CMS back in the 2000s. This time around I wanted a simple system that is easy to maintain, and that can be served by any web-server. So I wrote a simple application in C++ that take a bunch of markdown files with a magic header and creates a website with navigation, tags, images scaled to various screen sizes and rss.

The only real paint-point was a buggy markdown parser (I used an open source parser that used boost.spirit to parse markdown). This month I spent a few hours replacing that with a pretty nice markdown library cmark-gfm. When I was at it, I also added support for colorizing the source code snippets on my sites using a command line app written in go, Chroma. It took me less than one day of work, and I am frankly quite pleased with the result.

Now I just need to add a few new templates, and I can start telling people about stbl :)

Next-App

Next-app is a GTD application for desktop and mobile.

The focus this month has been to make the time blocks in the calendar usable. As in nice to use. And to make the app work on Android.

Developing a QT/QML app that works on desktop and Android turned out to be non-trivial. The biggest problem was to find the relevant information about how to make an Android app. For example, it took me a full days work to figure out how to get the Android manifest file right with QT. Lets just say that Github Copilot and ChatGPT was less than helpful. I wasted considerably time trying to make whatever they made up, work.

The next problem was testing it in a mobile environment. The Android emulator is well integrated into QT Creator. However, under kUbuntu the QT/QML app fails to show some of the text elements on the screen in the emulator. So I got visually empty trees, dropdown lists and menus. I tested it on two machines, one with AMD CPU and graphics, and one with Intel. Both had the same problem. Fortunately I was able connect my phone in USB mode (after setting the required permissions on the machine), so I can test the application there. I also added a compile time switch to run the Android specific .qml files on my desktop. That speeded up the general work a lot! I really wish .qml files was ran trough the C++ preprocessor so I could use #ifdef ... and #define ... in the QML code!

The latest QT version at the time I write this is 6.8. There is a regression in the gRPC support for Android (missing QT components), so I have to use 6.7.2 for the Android work.

The awesome outcome (for me) this month is that I can now use the core features of Next-App both on my Linux desktop and on my Android phone!

Android version of Nextapp

Once I started adopting Nextapp to Android, I became clear that I needed to split the screen to work efficiently. QML has a component for that. However, if I want to use that out of the box, I have to make one dual view for each use-case. For example to show a tree of lists and actions, or a list of actions and current work-sessions or current work sessions and a calendar. I want a little more flexibility, where the user can choose what views to use or combine. QML can do that, but only if I use stacks of views. If I want maximum flexibility, I would need two instances of each view, each instantiated with its own C++ model during application start up.

That is not what I want. I don't want any more instances of anything than the user will actually use, and I want lazy instantiation so the application starts up as fast as possible. The solution was to write another QML component in C++. It can show one or two views at one time. When the user change the view selection, the component will re-use the views if they are instantiated, or insatiate them as needed. The user can select which pane that will contain which view, and the component will just rearrange the composition, using the same instances.

This short video-recording from my Android phone shows how it appears on screen. You can even listen to my dogs barking loudly in joy!

Research and blogging

I updated my gRPC blog series with an article about QT's new gRPC support.

Books Completed

No books completed this month. I'm currently studying X64 assembly language. I'm reading a brick of a book that took more than 1 month to get trough.