Send notification java

So, I don't want to reinvent what is already invented, but I want to make a app which sends you a notification if you do something. I have been trying to find someone's source code for a notification extension, but am unable to find anything. Any ideas?

Thanks for the answer, but I don't get it. Can You put a code snippet? Just saying I tried this, but it gives me an error when I try to export it.

Did you click on the first link? There are 2 .java files

Also see this one: