maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   SailfishOS (https://talk.maemo.org/forumdisplay.php?f=52)
-   -   Background service in SailfishOS (https://talk.maemo.org/showthread.php?t=93363)

smoku 2014-06-20 21:46

Background service in SailfishOS
 
I am working on Pebble Watch support for SailfishOS.
Current implementation requires having an application open which talks to the smar****ch proxying call notifications etc. which is not very robust.
I would rather have some background service I don't have to remember to launch. Preferably D-Bus activated.
What is the suggested way of implementing such service in Nemo/Sailfish?

balisingh 2014-06-21 02:51

Re: Background service in SailfishOS
 
Haha It sensored smar t w a t ch.

coderus 2014-06-21 06:28

Re: Background service in SailfishOS
 
what problem in using dbus services? it's best way to do it :)

smoku 2014-06-21 07:31

Re: Background service in SailfishOS
 
Quote:

Originally Posted by coderus (Post 1430444)
what problem in using dbus services? it's best way to do it :)

No problem really. QtDBus Adaptors are great.
Just asking whether it is the right way to go with Sailfish?

nieldk 2014-06-21 08:04

Re: Background service in SailfishOS
 
Quote:

Originally Posted by smoku (Post 1430452)
No problem really. QtDBus Adaptors are great.
Just asking whether it is the right way to go with Sailfish?

it depends, fx, you need to consider if you want your stuff on Jolla store (or openrepos ;) )

coderus 2014-06-21 08:06

Re: Background service in SailfishOS
 
there are nothing to consider. if you want to make background service you can't be published in Harbour. There are no other way :)

nieldk 2014-06-21 08:55

Re: Background service in SailfishOS
 
Quote:

Originally Posted by coderus (Post 1430454)
there are nothing to consider. if you want to make background service you can't be published in Harbour. There are no other way :)

Sure there is something to consider.
But, if wanting to use dbus, then the decision is not-jolla-store :P

coderus 2014-06-21 09:13

Re: Background service in SailfishOS
 
any background daemons are not allowed for Harbour. There are nothing to consider ;)

magullo 2014-06-21 09:27

Re: Background service in SailfishOS
 
Quote:

Originally Posted by coderus (Post 1430458)
any background daemons are not allowed for Harbour. There are nothing to consider ;)

So for an app like that, one should keep app open and listen for dbus events?
I'm willing to do something simpler for a push button like pressy, so was wondering how get started.

m4r0v3r 2014-06-21 10:33

Re: Background service in SailfishOS
 
is this due to unfinished APIs or a final say as in, this stance will never change? If so time to go back to Android...

smoku 2014-06-21 11:55

Re: Background service in SailfishOS
 
Please do not derail the thread.

coderus 2014-06-21 14:13

Re: Background service in SailfishOS
 
@m4r0v3r what is your question about?

javispedro 2014-06-21 14:38

Re: Background service in SailfishOS
 
But who cares about the store? Chum is where the money is.

coderus 2014-06-21 14:44

Re: Background service in SailfishOS
 
@m4r0v3r if you asking why store not allowing background services answer is simple: because dbus daemons can be started as root, and there are no checkings if you starting it as regular user or root, and because of that it's just forbidden at all :)

javispedro 2014-06-21 14:51

Re: Background service in SailfishOS
 
Quote:

Originally Posted by coderus (Post 1430495)
@m4r0v3r if you asking why store not allowing background services answer is simple: because dbus daemons can be started as root, and there are no checkings if you starting it as regular user or root, and because of that it's just forbidden at all :)

No, that's not true for user/session services.

I suspect the problem is that there's no task manager/service control UI to lay blame to a specific program.

Besides, opportunistic suspend makes daemons completely useless.

nieldk 2014-06-21 17:27

Re: Background service in SailfishOS
 
Quote:

Originally Posted by javispedro (Post 1430496)
Besides, opportunistic suspend makes daemons completely useless.

not entirely true, but close enough. At best it makes daemons run unreliably. At least without nasty hooks.

smoku 2014-06-21 18:49

Re: Background service in SailfishOS
 
Quote:

Originally Posted by javispedro (Post 1430496)
Besides, opportunistic suspend makes daemons completely useless.

That's not a problem for Pebble daemon, as long as ring/sms/notification wakes up the device :)

smoku 2014-06-21 18:58

Re: Background service in SailfishOS
 
Quote:

Originally Posted by javispedro (Post 1430493)
Chum is where the money is.

Care to elaborate where exactly is that money?

m4r0v3r 2014-06-22 12:05

Re: Background service in SailfishOS
 
Quote:

Originally Posted by coderus (Post 1430495)
@m4r0v3r if you asking why store not allowing background services answer is simple: because dbus daemons can be started as root, and there are no checkings if you starting it as regular user or root, and because of that it's just forbidden at all :)

thats exactly what am asking, thank you :)

do daemons not run effectively due to wakelocks? or atleast how deep sleep is implemented through wakelocks??

javispedro 2014-06-23 15:09

Re: Background service in SailfishOS
 
Quote:

Originally Posted by smoku (Post 1430520)
That's not a problem for Pebble daemon, as long as ring/sms/notification wakes up the device :)

It will only wake the device for less than a second, unless you or someone else takes a wakelock. (Which are also forbidden in store btw).
If your BT connection is e.g. parked, or has been lost, etc. your program will take more time than what the system needs to display the notification, and will then happily proceed to suspend while your program hasn't yet forwarded the notification to the watch.

MartinK 2014-06-24 21:12

Re: Background service in SailfishOS
 
Well, considering all the current Jolla store limitations, I would advise Sailfish OS application developers:
Don't care about the Harbor limitations and make your application as awesome as possible instead! :)

I understand the while the limitations are there (apps not breaking due to upgrade, missing API versioning, fear of increased power consumption, missing security mechanisms, etc.) but at the same time they pretty much limit any non trivial application that actually does something useful from being included in the Jolla store.

The best way to improve the current situation is in my opinion to just build awesome applications that make use of the "banned" functionality and publish them on OpenRepos (or any other suitable place of your liking). As OpenRepos has detailed application download statistics this will clearly show how popular your app is and how many users the Jolla store is missing.

This could be a good incentive to either make Jolla to reconsider the limitations (or fix the shortcomings that require them) or might even make OpenRepos the one true Sailfish OS application repository (some might feel that this has already happened) in place of the Jolla store, thus also solving the issue. :)

smoku 2014-06-24 21:23

Re: Background service in SailfishOS
 
Shouldn't just putting rpm on the web and making it "clickable" from the Jolla browser be enough?
Why do we need OpenRepos?

coderus 2014-06-25 02:22

Re: Background service in SailfishOS
 
OpenRepos just because awesome Warehouse client and update package notifications :)

smoku 2014-06-25 06:25

Re: Background service in SailfishOS
 
Quote:

Originally Posted by coderus (Post 1430926)
OpenRepos just because awesome Warehouse client and update package notifications :)

Makes sense. :-)

But still I would advice newcomers, that when it comes to distribution, they could throw an rpm anywhere on the web. Just make that damn app.
I've seen having to understand stuff like OBS, repos etc. to discourage new devs as too complicated.
After a few releases, they will grow into OpenRepos. :)

nodevel 2014-06-25 06:42

Re: Background service in SailfishOS
 
Quote:

Originally Posted by smoku (Post 1430935)
Makes sense. :-)

But still I would advice newcomers, that when it comes to distribution, they could throw an rpm anywhere on the web. Just make that damn app.
I've seen having to understand stuff like OBS, repos etc. to discourage new devs as too complicated.
After a few releases, they will grow into OpenRepos. :)

I thought the original suggestion was an irony :)

There are dozens of reasons why this approach is wrong. It's the Windows' "search for an .exe and pray it's not infected way"... I'd rather have newcomers unable to install any apps at all than having them trust random rpm's all over the internet.

The bad thing is, OpenRepos are currently broken (and don't get me wrong, I do use them) as they have no source verification, but psychologically act as an authority (so in the end it is worse, since people are in fact downloading random .rpm's from the internet, but do no feel like they do). Let's hope this changes once they are connected to OBS (plus there's chum!).



Back to the topic
, I've looked into timedclient-qt5 and it should be quite easy to create a GUI like Alarmed on Maemo 5 to schedule background jobs. Timedclient-qt5 even seems more powerful than Alarmed, but unfortunately lacks proper documentation.


All times are GMT. The time now is 14:21.

vBulletin® Version 3.8.8