Growl Java API

The Growl forums have moved to Google Groups, this forum is read only.
Locked
User avatar
stringbean
Harmless
Posts: 2
Joined: Mon May 12, 2008 10:04 pm
Location: Manchester, UK
Contact:

Growl Java API

Post 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).
Attachments
growl-java.tar.gz
(8.72 KiB) Downloaded 3345 times
Stringbean
Qualified Software Simian
User avatar
The_Tick
Cocoaforge Admin
Posts: 4642
Joined: Thu Dec 02, 2004 6:06 am
Contact:

Re: Growl Java API

Post 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.
User avatar
stringbean
Harmless
Posts: 2
Joined: Mon May 12, 2008 10:04 pm
Location: Manchester, UK
Contact:

Re: Growl Java API

Post by stringbean »

Posting a new version of the API. This version now includes the ability to register notification click callbacks.

edit: added attachment
Attachments
growl-java-0.1.tar.gz
(10.38 KiB) Downloaded 2652 times
chamerling
Harmless
Posts: 2
Joined: Wed Apr 01, 2009 10:36 am

Re: Growl Java API

Post 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.
User avatar
boredzo
Cocoaforge Admin
Posts: 796
Joined: Mon Dec 06, 2004 7:49 am
Contact:

Re: Growl Java API

Post by boredzo »

hais
Harmless
Posts: 1
Joined: Wed Mar 12, 2008 9:55 am

Re: Growl Java API

Post by hais »

Has any progress been made on this API since? I'm actually more interested in the dummy class for non-macos systems.
Locked