[Kde-pim] Using Akonadi on other platforms than KDE

Kevin Krammer kevin.krammer at gmx.at
Mon Sep 6 10:20:11 BST 2010


Hi Greg,

On Monday, 2010-09-06, Gregory Schlomoff wrote:
> Hello guys,
> 
> As some of you may already be aware, we are a small startup building a
> cross-platform email client with Qt. We are using KIMAP (with the KDE
> dependencies stripped out so it depends only on Qt) to fetch the mail data,
> and started writting a few lines of code to implement basic caching.

Just as a side note:I think there have been some changes recently in KIMAP 
trunk to support servers which do not support or do not correctly advertise 
the UIDPLUS extension.

> So, let's get to the point. In an *ideal* world; we would like to be able
> to:
> 
> 1. git clone git://[some kde url]/akonadi

This is currently SVN 
(svn://anonsvn.kde.org/home/kde/trunk/kdesupport/akoandi) though KDE will be 
switching to git most likely somewhen later this year.
There are also source releases available for download on 
http://download.akonadi-project,.org)

> 2. run CMake, or qmake, or whatever.

We are using CMake

> 3. get a nice akonadi.lib file that we could link against our program

The Akonadi server comes with a kind of internal library that contains low 
level protocol related code. It is being used by KDE's client library which 
(as Tobias pointed out) is KDE's kdepimlibs module.

> 4. Spend some time reading the documentation, and learn how to use the API.

The documentation of KDE's client library is on http://api.kde.org/ and there 
are some tutorials on KDE's developer Wiki TechBase [1].

As Tobias mentioned, KDE's client library is using KDE infrastructure (e.g. 
MIME type handling) and was designed to fit into KDE's style of handlig 
asynchronous I/O operations (job based API).

> Of course, I realize we do not live in an ideal world. In the real world,
> here's what happening:
> 
> 1.  I followed the instructions here
> http://techbase.kde.org/Projects/PIM/MS_Windows#Building
> 2. After executing step 4 - emerge kdepimlibs I've got a somewhat scaring
> 11+ Gb of data in my previously empty kderoot directory, and the the build
> process has failed on "Linking CXX shared module
> ..\bin\kdewebkitwidgets.dll [...] fatal error LNK1120: 20 unresolved
> externals"

Sometimes Windows builds break through introduction of new code that builds 
well on Unix based operating systems but fails on Windows.
You could trying to use the kde-4.5 category to build th 4.5 branch or try 
emerging the failing module again a bit later.

> If anyone knows how I can fix this issue, that would be very useful. But
> the point that I want to bring to this mailing list is that from what I
> understand, Akonadi has been designed to be desktop-agnostic, but there is
> almost no information on how to reuse it on other platforms than KDE.

KDE is currently the only user we know of and it has the most complete client 
libray implementation [2].
One of the design goals was to not impose any techology or licencing 
restrictions on clients, e.g. not using Qt or not licencing LGPL compatible.

> We are willing to put some time and some development effort into this, but
> we need some pointers.
> 
> - What are the general steps to use akonadi as a library for a program?

I don't think anybody has attempted something like this yet.
The architecture is centered around having Akonadi as a separate process, e.g. 
to have only one process accessing on-disk cache (no unreliable file locking), 
provide change notifications on per-item level, have a technology and licence 
barrier, etc.

> - Is that a good idea at all? Since Akonadi is designed to serve as a
> central cache for several PIM apps, does it make any sense to try to use it
> a library for a stand-alone app ?

Probably not as a library (see above), but you could use it as a service for 
just one app.
You'll have to install it separately and use a different D-Bus session bus but 
is doable. In fact I have exactly that for a Windows setup of an application I 
am working on.

> - How functional is Akonadi, as of now? I recall installing the whole KDE
> for windows, a few months ago, and trying to use KMail. It was unusable.
> Lots of messages about Akonadi server not being started. I suppose this is
> fixed by now, but I am somewhat insecure about how easy to use /
> streamlined Akonadi really is. My first impression (again, this was a
> *first*
> impression, and months ago) was that it was somewhat bloated. On the other
> hand, people are building Akonadi for mobile devices, so this seems to
> suggest it's pretty clean and tight.

I didn't have a lot of problems with startup on either Linux or Windows [3] so 
far, so I guess that has been a problem of earlier versions.
And it does indeed look a bit huge on first sight but any other system with 
comparable feature set would end up very close as well.
Providing a data type agnostic, single point of access, two-way cache is 
always going to require quite some code and runtime resources.

Depending on whether some of the features are not needed, e.g. no offline 
capabiltities, it might be possible to make a smaller implementation of the 
rest.
However, as you pointed out, the current implementation so far does fine even 
on mobile devices, though one of the people working on really restricted ones 
(e.g, WinCE based) might have some additional insight into this.

Cheers,
Kevin

[1] 
http://techbase.kde.org/Development/Tutorials#Personal_Information_Management_.28Akonadi.29

[2] There is a pretty good Python based library to demonstrate the viability 
of creating a separate implementation native to a different technology stack.

[3] I had some initial issues with running my own session bus, but that got 
fixed by the KDE/Windows developers pretty quickly: 
http://lists.kde.org/?t=128275265000003&r=1&w=2
-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20100906/1d3ff37d/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list