Knocking up quick SailfishOS applications.
I've picked up my Xperia again, and have been giving Sailfish a fair shake. This involved writing code to replace the apps I left behind on Android, and looking at code I wrote around 2013.
Setting up the SDK was a ball-ache, that's the main note.
Getting the phone into development mode was straight forward, and the build/install process is done with well-tested tools. That is to say, QtCreator uses qmake to build the project as an RPM, which is then copied to the phone over SSH, and installed with a sensible package manager that pulls down dependencies.
Sailfish is on an old version of Qt, and that doesn't seem to be changing.
QtCreator is just fine. It works.
Icinga has a well-documented JSON API, so it's a natural first application to write. On Android I've made us of anag, which is proprietary software, so the issues I have with it are (practically) unfixable. Here's my notes on the development process and the app:
Rather than implement everything Misskey needs (the API is, again, well-documented) - I instead leveraged Sailfish's 'WebView', and only used the API for fetching information for the Cover page.
I wrote a music player named 'Shanty' back in 2013-ish. The stock music player depended on indexing metadata, and my collection was well-enough organised to not need that. On top of this, album art in my collection is stored as 'folder.jpg'. Usually around 1400x1400 pixels in size. Indexers tend not to handle album-art-as-individual-files well.
Shanty was okay. It had some obvious problems, both in terms of code and functionality. But for a first-attempt at developing any sort of application, it would have been a passing grade (without merit).
Porting shanty was difficult. I'd made design decisions at the time that worked, given how Sailfish worked (for example, triggering cover actions by pressing on the cover and swiping). I'd also (seemingly) implemented a convoluted signal-passing system that would propagate state down the page-stack. Understanding the UI code was easy, understanding the long series of conditions I'd written to handle shuffle, replay (track/album) - was not. Some code ended up being redundant (as the QML Audio component has improved over time).
Having written the two small apps above, I took to writing Shanty again from scratch. This time calling it 'Music'.
Depending on a very specific library hierarchy made it incredibly easy. I've used the same \~/music/genre/album/01.234. title.ext for over a decade now - why support anything else?
The Qt 5.6 Audio component still doesn't support flac metadata, seemingly. So the path is used instead. This means no artist, album artist, composer, or year. But I have nowhere to display them anyway.
There is no seeking. Or previous track. Previous might be implemented - the requirements are already there. Seeking likely wont, as I don't think I've ever used it.
I'm not depending on the Nemo Thumbnail component for the album view. Instead I have a 172x172 folder.jpg.thumb for each album. I might explore that at some point.
Pause-on-headphone-removal works without any code. Which is a nice improvement.