![]() |
How to create Qt service?
Hi,
My requirement is to create a Qt based backend service that runs when the device boots and call a function periodically (say every 15 minutes). Very similar to a cron tab. So far I could find QDBus and QtMobility service framework modules that shows how to implement a service. It is not clear from the documentation weather these services can be run as daemons or the service die after serving the client request. Can somebody provide a qt way of creating service that runs as daemon and doesn't hurt device battery? Any example projects or code snippets would be much appreciated. Thanks, Sateesh. |
Re: How to create Qt service?
Hi
You can use QtService, you can download it from qt.nokia.com. I'm using it in one of my projects, and it works great with QtMobility and QDBus, only problem I had was when trying to use anything from user space (calendar in my case), as this is a service, it does not have readily access to user space. Kim |
Re: How to create Qt service?
Quote:
It may be instructed to perform certain functionality by "poking" it using an IPC mechanism like DBus. If you intend your service to be cross platform to Windows or Mac, then you should use QtService. Installing and starting the service is heavily dependent on the target OS: eg. Most Linux variants have upstart / init.d / event.d, Windows would require you to setup registry entries or invoke SCM. |
Re: How to create Qt service?
Thanks for the leads about QTSevice. If QTService doesn't work in user space, I am afraid I cant use it. I will look at the QTService api closely.
To clarify what exactly what I am trying to achieve, I have a qt application that can sync Google contacts with N900 device contacts. I am trying to set it up as a service so that the service can call the sync function every 15 minutes without user interaction. Cross platform functionality is not my primary concern at this time. This service needs to run under the user space and be started every time the device is rebooted. I am not sure if init.d/event.d scripts always run as root or if they can be configured to run under user space. I will have another UI client that will poke the service to modify the update frequency etc.. Thanks, Sateesh. |
Re: How to create Qt service?
All of QT is user space. Do not even think of using it in kernel mode.
Also: I have a google contacts API parser ready in case you're interested. I was supposed to work on a google contacts sync tool, but I've pushed it back until my other project is in better shape. |
Re: How to create Qt service?
Why not just use a QTimer instance?
|
Re: How to create Qt service?
Quote:
If the service is started (by init.d or upstart) as root user, the service will see the address book of root account instead of the intended default user account. Do you know if init.d or event.d scripts can start a process as default user? I am noob to the Qt Programming. I would love to get the GData parser if you have available. Please PM me or post the link to this thread. Thanks, Sateesh. |
Re: How to create Qt service?
Quote:
If this not CPU intensive, I will proceed with this option. Thanks, Sateesh. |
Re: How to create Qt service?
There's a cron-like daemon running on the device:
http://wiki.maemo.org/Documentation/...larm_Framework |
Re: How to create Qt service?
Quote:
|
All times are GMT. The time now is 00:59. |
vBulletin® Version 3.8.8