Page 1 of 1

Growl Java API

Posted: Wed May 14, 2008 4:44 pm
by stringbean
As part of my work I was looking into adding Growl support for our Java application but as many people are aware Apple removed the APIs that it depended on (bad Apple :x ). This has prompted me to write a simple Java API to wrap the native Cocoa calls.

So far I've tested it using Java 5 and Java 6 (64-bit) on Mac OS X 10.5. The Makefiles are configured to build ppc/i386/x86_64 and should work on 10.4 (although you will need to build it on 10.5). The API should degrade gracefully if it is run on a non-Mac system - it won't throw any errors, blow up or anything like that.

Basic code usage is shown below:

Code: Select all

Growl growl = GrowlUtils.getInstance("My Funky Java App");
growl.addNotification("Something has happened", true);
growl.register();

// snip
growl.sendNotification("Something has happened", "Notification!", "Wake up lazy bones!");


A quick and dirty example app is included in the source that you can run with:

Code: Select all

ant run


Hopefully this will be of use to people. If the Growl devs are willing I would like to get this included in the main Growl SDKs (after the kinks are ironed out).

Re: Growl Java API

Posted: Wed May 14, 2008 8:18 pm
by The_Tick
Go ahead and start posting on our mailing list about this one. I think it'd be a great addition with say, 1.1.4 or 1.2.

Re: Growl Java API

Posted: Thu May 15, 2008 3:11 pm
by stringbean
Posting a new version of the API. This version now includes the ability to register notification click callbacks.

edit: added attachment

Re: Growl Java API

Posted: Wed Apr 01, 2009 10:42 am
by chamerling
Nice work. Is is planned to get it in the Growl developper toolkit? If not you should publish it on a source code repository.
Thanks for that.

Re: Growl Java API

Posted: Sat Apr 18, 2009 2:10 am
by boredzo

Re: Growl Java API

Posted: Wed Nov 04, 2009 11:22 am
by hais
Has any progress been made on this API since? I'm actually more interested in the dummy class for non-macos systems.