Using libpurple with Java
rlaager at wiktel.com
Wed May 23 12:36:41 EDT 2007
On Wed, 2007-05-23 at 18:45 +0500, M Khalid wrote:
> Is it possible to use libpurple with Java. I know there is JNI
> available. But I am wondering if somebody has gone through all the
> pain of creating header file and compiling libpurple.
I doubt anyone has. I happened to have done some stuff with JNI at one
point, so I've thought (a little) about how this might work... I have no
time or desire to actually do this, but I can provide some tips.
If I was going to do this, I'd first see if there was something more
automatic. If not, then I'd create Java classes for all the public
libpurple APIs I wanted to wrap (e.g. PurpleBuddy). I'd have public
methods (that made it look as if everything was implemented in Java),
then have those call private native methods, which I'd implement in a
thin glue layer around libpurple. You would want to use a class
initializer to load libpurple.so, probably by way of some indirect class
(PurpleBuddy uses some protected PurpleImpl factory class that loads
libpurple.so once from its class initializer).
A quick Google search yielded this, which may be relevant...
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 189 bytes
Desc: This is a digitally signed message part
More information about the Devel