SailfishOS / Qt - how to have my application called at a given date, say a few weeks from now

StackOverflow https://stackoverflow.com/questions/22424631

Вопрос

I am currently developing a reminder application for SailfishOS. There's one thing I haven't been able to figure out yet:

Is there a possibility to register with the OS for a specific date (and maybe an ID), so that my app will be invoked to do its reminder thing? This should also be working when my app has been stopped or the phone has been rebooted, so I assume that a QML Timer will probably not be an option.

Ideally I am looking for a QML/JavaScript solution (if possible), because my C++ skills are non-existent. I have also been browsing repository of some open source projects, but haven't found a solution yet.

Links to relevant source repositories are also very appreciated...

Это было полезно?

Решение

Since you do not seem to have any C++ experience, I recommend not to write any Qt daemon for this task launched by systemd.

I suggest to follow this thread to invoke your application at the date and time desired:

How to add automated tweets via a cron job to WordPress

It is writing about tweets, but I would imagine the concept to be similar. After all, as far as I am aware Jolla intends to remain as much vanilla as possible based on the Mer stack.

Unfortunately, Sailfish OS is currently using an outdated systemd, so you cannot yet use systemd-cron since that requires at least sytemd 197. Although, as far as I know they are working on an update. That will bring the nicer future for your use case.

As indicated in the comments, if you do not have C++ experience, this is probably the easiest route. There will be no direct QML bindings for QProcess, etc, as you would need it.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top