<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Moritz Haarmann's Blog &#187; simpleyeteffective</title>
	<atom:link href="http://momo.brauchtman.net/tag/simpleyeteffective/feed/" rel="self" type="application/rss+xml" />
	<link>http://momo.brauchtman.net</link>
	<description>for the sake of completeness!</description>
	<lastBuildDate>Fri, 27 Aug 2010 14:00:07 +0000</lastBuildDate>
	<language>de</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Business ideas: Which is the right one?</title>
		<link>http://momo.brauchtman.net/2009/09/business-ideas-which-is-the-right-one/</link>
		<comments>http://momo.brauchtman.net/2009/09/business-ideas-which-is-the-right-one/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 16:40:24 +0000</pubDate>
		<dc:creator>momo</dc:creator>
				<category><![CDATA[personal]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[useless]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[improvingtheworld]]></category>
		<category><![CDATA[simpleyeteffective]]></category>
		<category><![CDATA[useful]]></category>

		<guid isPermaLink="false">http://momo.brauchtman.net/?p=405</guid>
		<description><![CDATA[Honestly, I don&#8217;t know. But from what I can tell, the ones solving problems people have, even if they were not aware before, are the ones working. The other ideas usually don&#8217;t. What are problems worth solving? I&#8217;d define a problem worth solving as something that has 3 attributes: It is persistent, in a sense [...]]]></description>
			<content:encoded><![CDATA[<p>Honestly, I don&#8217;t know. But from what I can tell, the ones solving problems people have, even if they were not aware before, are the ones working. The other ideas usually don&#8217;t. What are problems worth solving?</p>
<p>I&#8217;d define a problem worth solving as something that has 3 attributes: It is persistent, in a sense that it reoccurs too many times, that it has an impact on some activity or workflow. That is something worth resolving. Another point is the &#8220;factor of annoyance&#8221;. Remember the  Microsoft&#8217;s Paperclip? High factor of annoyance. One dialog asking for a bit of love in the form of a ok-button? Not that annoying. But keep in mind, that&#8217;s all a very subjective rating. So if you find Dialog Boxes more annoying than speaking Paperclips, just change the order accordingly.</p>
<p>The third factor is the most important one: the Time spent working around. The attributes mentioned above may be pointless if it takes no time to work around the issue. If something takes a serious amount of time to be worked around, solved, corrected or understood, it&#8217;s time to do something. Recently, GMail and my Mac synced. The result was a Address Book disaster. Time to correct it: 3 hours. That&#8217;s a problem.</p>
<p>Anything that&#8217;s built to return money should solve a problem or improve something. Anything else? Naaa..That&#8217;s my point. What is yours?</p>
]]></content:encoded>
			<wfw:commentRss>http://momo.brauchtman.net/2009/09/business-ideas-which-is-the-right-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Donation-Buttons not working, thinking about other ways to collect Payment for Open Source Projects</title>
		<link>http://momo.brauchtman.net/2009/04/donation-buttons-not-working-thinking-about-other-ways-to-collect-payment-for-open-source-projects/</link>
		<comments>http://momo.brauchtman.net/2009/04/donation-buttons-not-working-thinking-about-other-ways-to-collect-payment-for-open-source-projects/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 00:34:09 +0000</pubDate>
		<dc:creator>momo</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[improvingtheworld]]></category>
		<category><![CDATA[simpleyeteffective]]></category>

		<guid isPermaLink="false">http://momo.brauchtman.net/?p=344</guid>
		<description><![CDATA[So finally I&#8217;m starting to write something that will certainly end up being tagged as &#8216;simpleyeteffective&#8217; or &#8216;improvingtheworld&#8217;, hopefully both is true. There is to date no working revenue model and system for people contributing to open source projects. First of all I want to clearify that from my point of view, it&#8217;s not about [...]]]></description>
			<content:encoded><![CDATA[<p>So finally I&#8217;m starting to write something that will certainly end up being tagged as &#8216;simpleyeteffective&#8217; or &#8216;improvingtheworld&#8217;, hopefully both is true.</p>
<p>There is to date no working revenue model and system for people contributing to open source projects. First of all I want to clearify that from my point of view, it&#8217;s not about money creating free software, it&#8217;s partially fun, maybe a result of paid work or simply a productive hobby, yet we are living in a world where money counts. So we are happily spending money for everything, while trying to fade out the fact that a lot of stuff we use in our daily lives ( and just be it some free and open source server software we don&#8217;t use directly ) is a result of people working for free, out of idealism or whatever.</p>
<p>We need something to show those people our respect. While I&#8217;ve been donating like .. 3 times in my live ( each time about 2-5€ ), there are certainly people donating more, and people donating less or not at all. And it depends on how well a project is organised, a good marketing and mostly the project size, it&#8217;s highly unlikely that a simple cli-tool meant to be used for just one specific task will be a vital target for money transfers.</p>
<p>So what about a pool, a common adress to receive donations with a ( fair, as far as possible ) system to distribute those amounts among active projects. I haven&#8217;t thought about a precise system on how to split those amounts, yet I&#8217;m sure that capable people will be able to do so, in a fair manner, which is a cornerstone of this project.</p>
<p>Factors influencing the distribution could take e.g. project activity, team size, download counts etc. into account, although the different uses demand a highly customisable system.</p>
<p>What do you think about it ( Still hoping for comments ) ?</p>
]]></content:encoded>
			<wfw:commentRss>http://momo.brauchtman.net/2009/04/donation-buttons-not-working-thinking-about-other-ways-to-collect-payment-for-open-source-projects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Missing Link: Update Contact Image in Mac&#8217;s Address Book using Gravatar</title>
		<link>http://momo.brauchtman.net/2009/03/missing-link-update-contact-image-in-macs-address-book-using-gravatar/</link>
		<comments>http://momo.brauchtman.net/2009/03/missing-link-update-contact-image-in-macs-address-book-using-gravatar/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 17:39:59 +0000</pubDate>
		<dc:creator>momo</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[gravatar]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[simpleyeteffective]]></category>

		<guid isPermaLink="false">http://momo.brauchtman.net/?p=319</guid>
		<description><![CDATA[It&#8217;s that simple. just download the bundle, drop it to Library/Address Book Plug-Ins/ and restart Address Book. Once you click on an E-Mail address of one of your contacts, it will update the image using gravatar.com . Have fun. Update There is a version available for Snow Leopard now, just check out the new post.]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s that simple. just download <a href="http://momo.brauchtman.net/wp-content/uploads/2009/03/gravatarizebundle.zip">the bundle</a>, drop it to Library/Address Book Plug-Ins/ and restart Address Book. Once you click on an E-Mail address of one of your contacts, it will update the image using gravatar.com .</p>
<p>Have fun.</p>
<p><strong>Update</strong></p>
<p>There is a version available for Snow Leopard now, just check out the <a href="http://momo.brauchtman.net/2009/12/gravatar-address-book-support-updated-for-snow-leopard/">new post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://momo.brauchtman.net/2009/03/missing-link-update-contact-image-in-macs-address-book-using-gravatar/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Implementing a Ruby-Based LDAP-Server</title>
		<link>http://momo.brauchtman.net/2009/02/implementing-a-ruby-based-ldap-server/</link>
		<comments>http://momo.brauchtman.net/2009/02/implementing-a-ruby-based-ldap-server/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 15:10:44 +0000</pubDate>
		<dc:creator>momo</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[simpleyeteffective]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://momo.brauchtman.net/?p=306</guid>
		<description><![CDATA[Oh yes. Good question. Why would anyone want to implement a LDAP Server? Besides the fact the OpenLDAP is a pain to set up and isn&#8217;t really rewarding in terms of perfomance, there are situations demanding LDAP Access to data residing in some kind of RDBMS. And that&#8217;s my motivation. After seriously thinking about doing it [...]]]></description>
			<content:encoded><![CDATA[<p>Oh yes. Good question. Why would anyone want to implement a LDAP Server? Besides the fact the OpenLDAP is a pain to set up and isn&#8217;t really rewarding in terms of perfomance, there are situations demanding LDAP Access to data residing in some kind of RDBMS. And that&#8217;s my motivation.</p>
<p>After seriously thinking about doing it all by myself, I plugged in Google to get some answers. And there is ruby-ldapserver, hosted at rubyforge. Unfortunately. the project seems pretty dead, nevertheless the Alpha 0.3.1 Version released there works fine, although without SASL support, only simple ( plain bind ) works. </p>
<p>How to use it? It&#8217;s very straightforward. Download the package, see that it&#8217;s in your path, and ready to rock. The package includes a few examples, showing off the beauty of the lib and ruby. That is how you implement a fully working LDAP Server ( okay, doing nothing, but works. )</p>
<pre lang="RUBY">
class MyLdapOperations < LDAP::Server::Operation

  def search(basedn, scope, deref, filter)
    puts scope
    puts basedn
    puts deref
    puts filter[1]
  end

  def simple_bind(version,dn,password)
    puts "Auth: #{dn} + #{password}"
    puts version
  end

end
s = LDAP::Server.new(
	:port			=> 1234,
	:nodelay		=> true,
	:listen			=> 10,
#	:ssl_key_file		=> "key.pem",
#	:ssl_cert_file		=> "cert.pem",
#	:ssl_on_connect		=> true,
 <img src='http://momo.brauchtman.net/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> peration_class	=> MyLDAPOperations
)
s.run_tcpserver
s.join
</pre>
<p>You launch it, and it works. Certainly worth giving it a try, and a good piece to start if you want to get involved in the OS community.</p>
]]></content:encoded>
			<wfw:commentRss>http://momo.brauchtman.net/2009/02/implementing-a-ruby-based-ldap-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails Plugin: Superdumper, helps you visualize your database schema</title>
		<link>http://momo.brauchtman.net/2009/02/rails-plugin-superdumper-helps-you-visualize-your-database-schema/</link>
		<comments>http://momo.brauchtman.net/2009/02/rails-plugin-superdumper-helps-you-visualize-your-database-schema/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 05:53:08 +0000</pubDate>
		<dc:creator>momo</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[improvingtheworld]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[simpleyeteffective]]></category>

		<guid isPermaLink="false">http://momo.brauchtman.net/?p=294</guid>
		<description><![CDATA[You know the problem. You are agile like hell. You don&#8217;t bother doing complicated diagrams to show somebody what you&#8217;re doing. That&#8217;s okay. But sometimes, you need to show off what you&#8217;ve been struggling with, and if that day comes, this little rakefile can save some time. Simply , Unpack this file ( tar bz [...]]]></description>
			<content:encoded><![CDATA[<p>You know the problem. You are agile like hell. You don&#8217;t bother doing complicated diagrams to show somebody what you&#8217;re doing. That&#8217;s okay. But sometimes, you need to show off what you&#8217;ve been struggling with, and if that day comes, this little rakefile can save some time.</p>
<p>Simply , Unpack <a href="http://momo.brauchtman.net/wp-content/uploads/2009/02/superdumptar.tbz">this file ( tar bz btw )</a> in your rails app&#8217;s root folder and call rake db:superdumper. This will create a file called database.dot in your root folder, containing your database scheme, including associations, in the so-called &#8220;dot&#8221; format, used by the open-source <a href="http://www.graphviz.org/">GraphViz</a> package as input. If you don&#8217;t have that package, install it, via ports or apt or whatever applies to your platform. </p>
<p>In Detail what you have to do is here ( assuming you unpacked the file already.. )<br />
 </p>
<pre lang="SHELL">rake db:superdumper</pre>
<p>This task will automatically dump your scheme and call GraphViz, resulting in a pdf file in the root of your app with the name database.pdf. If it&#8217;s not your database schema smiling at you, let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://momo.brauchtman.net/2009/02/rails-plugin-superdumper-helps-you-visualize-your-database-schema/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Bose Support: best in town</title>
		<link>http://momo.brauchtman.net/2009/02/bose-support-best-in-town/</link>
		<comments>http://momo.brauchtman.net/2009/02/bose-support-best-in-town/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 15:47:17 +0000</pubDate>
		<dc:creator>momo</dc:creator>
				<category><![CDATA[useless]]></category>
		<category><![CDATA[industry]]></category>
		<category><![CDATA[simpleyeteffective]]></category>
		<category><![CDATA[useful]]></category>

		<guid isPermaLink="false">http://momo.brauchtman.net/?p=284</guid>
		<description><![CDATA[After 1 year of heavy usage my Tripod Earplugs finally died, just as my MacBook. The difference is that I just went to the Bose retail store today, showed my damaged ones, and without a further question they just gave me a new box. Rocks.]]></description>
			<content:encoded><![CDATA[<p>After 1 year of heavy usage my Tripod Earplugs finally died, just as my MacBook. The difference is that I just went to the Bose retail store today, showed my damaged ones, and without a further question they just gave me a new box. Rocks.</p>
]]></content:encoded>
			<wfw:commentRss>http://momo.brauchtman.net/2009/02/bose-support-best-in-town/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Still working on usabilitizing the Web: ideas, cont&#8217;d</title>
		<link>http://momo.brauchtman.net/2009/01/still-working-on-usabilitizing-the-web-ideas-contd/</link>
		<comments>http://momo.brauchtman.net/2009/01/still-working-on-usabilitizing-the-web-ideas-contd/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 16:54:39 +0000</pubDate>
		<dc:creator>momo</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[idea]]></category>
		<category><![CDATA[improvingtheworld]]></category>
		<category><![CDATA[simpleyeteffective]]></category>
		<category><![CDATA[thoughts]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[useful]]></category>

		<guid isPermaLink="false">http://momo.brauchtman.net/?p=271</guid>
		<description><![CDATA[Hello, today I continue my list of ideas which would make the Web and Computers in General way more easier and safer to use. Although it won&#8217;t change anything, I just want to make you think about it and let me know your opinion. I&#8217;m still a bit frustrated that there is nothing like a [...]]]></description>
			<content:encoded><![CDATA[<p>Hello, today I continue my list of ideas which would make the Web and Computers in General way more easier and safer to use. Although it won&#8217;t change anything, I just want to make you think about it and let me know your opinion.</p>
<p>I&#8217;m still a bit frustrated that there is nothing like a general file metadata format. While every OS nowadays has its own metadata-supplying filesystem, there doesn&#8217;t seem to be a way to exchange that information or reuse it. Neither to publish it online, in a useful manner. I was thinking about a format that enables one to store almost arbitrary information in for a file. Album art, MD5-hashes, Author information, keywords. Anything that helps to categorize a file. Thus, a download would start by clicking on the metadata file, a nice screen would popup showing the file type, the supplied information, giving you the ability to get a quick overview about a file.</p>
<p>This could help to prevent the download of malicious software etc.. And it would help to store files correctly without user interaction. As a teacher of mine noticed correctly, it&#8217;s impossible to store and organize files in a useful way using the old-school directory-filename scheme, plus the good old 3-char extension, e.g. avi or txt. Something more sophisticated is needed, and would add a bit more usability to this web.</p>
<p>This is once again just a rough idea, and I would love to hear your comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://momo.brauchtman.net/2009/01/still-working-on-usabilitizing-the-web-ideas-contd/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sharer, Giver, whatever, Filesharing</title>
		<link>http://momo.brauchtman.net/2009/01/sharer-giver-whatever-filesharing/</link>
		<comments>http://momo.brauchtman.net/2009/01/sharer-giver-whatever-filesharing/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 22:09:31 +0000</pubDate>
		<dc:creator>momo</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[improvingtheworld]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[simpleyeteffective]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://momo.brauchtman.net/?p=242</guid>
		<description><![CDATA[A short note on a previous post where I talked about my project of a simple File-Sharing applications that basically works using drag&#8217;n'drop and some zeroconf to find other peers. I wasn&#8217;t exactly surprised to find something that matches that description pretty well, but here it is, it&#8217;s called giver and should run on any [...]]]></description>
			<content:encoded><![CDATA[<p>A short note on a previous post where I talked about my project of a simple File-Sharing applications that basically works using drag&#8217;n'drop and some zeroconf to find other peers. I wasn&#8217;t exactly surprised to find something that matches that description pretty well, but here it is, it&#8217;s <a href="http://code.google.com/p/giver/">called giver</a> and should run on any platform that has support for some kind of .net/mono framework. I haven&#8217;t tried it yet, but I&#8217;ll sure give it a shot and tell you about it.</p>
<p>I&#8217;m already thinking about dropping the Java-project and instead do a client for the giver-protocol in Cocoa. I would be excited to have someone reporting about the actual use of giver! Moritz.</p>
]]></content:encoded>
			<wfw:commentRss>http://momo.brauchtman.net/2009/01/sharer-giver-whatever-filesharing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Improving readers user experience by adding links to related external blogs</title>
		<link>http://momo.brauchtman.net/2009/01/improving-readers-user-experience-by-adding-links-to-related-external-blogs/</link>
		<comments>http://momo.brauchtman.net/2009/01/improving-readers-user-experience-by-adding-links-to-related-external-blogs/#comments</comments>
		<pubDate>Sat, 10 Jan 2009 16:17:04 +0000</pubDate>
		<dc:creator>momo</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[idea]]></category>
		<category><![CDATA[improvingtheworld]]></category>
		<category><![CDATA[simpleyeteffective]]></category>
		<category><![CDATA[useful]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://momo.brauchtman.net/?p=204</guid>
		<description><![CDATA[Everyone is used to Google&#8217;s AdSense system offering relevant ads instead of providing static banners. This system not only affects the acceptance of advertising on blogs, but also enhances the user experience. Being able to access relevant products or content by one click is certainly a much more attractive and modern way of offering ads. [...]]]></description>
			<content:encoded><![CDATA[<p>Everyone is used to Google&#8217;s AdSense system offering relevant ads instead of providing static banners. This system not only affects the acceptance of advertising on blogs, but also enhances the user experience. Being able to access relevant products or content by one click is certainly a much more attractive and modern way of offering ads. <span id="more-204"></span></p>
<p>Could a similar system be also built for free blog-to-blog linking? I guess there are many blogs out there dealing with almost the same topics from time to time, and I think it&#8217;s a pity that there is no automated way ( i know of ) to link these blogs based on the post contents. While a hard restraint for such a service to work would be that it is free and easy to customise, many bloggers focusing on their readers would embrace such a system. Once again, free and without any commercial background.</p>
<p>Edit: I guess someone&#8217;s done some cool work here, the plugin is called <a href="http://www.bluehatseo.com/new-wordpress-plugin-pingcrawl/">Ping Crawl</a> and links to related posts and also pings them. Nice! Edit, 2: Ping Crawl to be quite uncontrollable and since it actually just looks at your tags, it&#8217;s not working well. Though text analysis is certainly hard to do, it&#8217;s the only way, I&#8217;m afraid.</p>
<p>This is another one of my ideas, and I&#8217;d be really glad if I could only realise one of them. If you want to help me out, please please please contact me.</p>
]]></content:encoded>
			<wfw:commentRss>http://momo.brauchtman.net/2009/01/improving-readers-user-experience-by-adding-links-to-related-external-blogs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zeroconf made easy: Bonjour for Java, Part 2, Client Implementation</title>
		<link>http://momo.brauchtman.net/2009/01/zeroconf-made-easy-bonjour-for-java-client-implementation/</link>
		<comments>http://momo.brauchtman.net/2009/01/zeroconf-made-easy-bonjour-for-java-client-implementation/#comments</comments>
		<pubDate>Fri, 09 Jan 2009 08:04:14 +0000</pubDate>
		<dc:creator>momo</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[Add new tag]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[simpleyeteffective]]></category>
		<category><![CDATA[useful]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://momo.brauchtman.net/?p=190</guid>
		<description><![CDATA[I&#8217;ve been writing about the server side implementation aspects of Bonjour for Java a while ago, and I promised to explain the client side, which is a bit more tricky. The reasons therefore is that it makes heavy use of asynchronous callbacks, leaving you no other choice but to implement some interfaces and understand the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been writing about the<a href="http://momo.brauchtman.net/2008/12/zeroconf-made-easy-using-bonjour-for-java/"> server side implementation aspects of Bonjour for Java </a>a while ago, and I promised to explain the client side, which is a bit more tricky. The reasons therefore is that it makes heavy use of asynchronous callbacks, leaving you no other choice but to implement some interfaces and understand the way things work behind the curtain.<span id="more-190"></span></p>
<p>So what is the client&#8217;s task? In our example it is to find, that is discover, services and make them accessible to our application. Of course, it uses the same mDNSResponder facilites discussed previously. To mention it again, mDNSResponder is, from our point of view, the single instance taking care about all actions required to either register, discover or browse services. And caused by the way it works ( by &#8220;talking&#8221; to the other peers on your network ) it can&#8217;t provide instant answers to requests made, that&#8217;s why asynchronous callbacks are required.</p>
<p>We used that killerapp example, and I&#8217;m going to continue with that, though any other name can of course be used.</p>
<p>I assume you already imported the apple package and read about how to install it if you&#8217;re unable to compile your class file.</p>
<pre lang="JAVA">import com.apple.dnssd.*;</pre>
<p>Before actually starting to putting it all together, let&#8217;s have a look at two interfaces that are important for our work. The one is BrowseListener, which actually defines the callbacks to call when a service is either lost or found.</p>
<pre lang="JAVA">public void serviceFound(DNSSDService browser,
                         int flags,
                         int ifIndex,
                         java.lang.String serviceName,
                         java.lang.String regType,
                         java.lang.String domain)

public void serviceLost(DNSSDService browser,
                        int flags,
                        int ifIndex,
                        java.lang.String serviceName,
                        java.lang.String regType,
                        java.lang.String domain)</pre>
<p>The other interface which is used to provide our application with the data necessary to connect to a discovered service using standard Java Sockets, is ResolveListener. This interface defines only one callback, serviceResolved</p>
<pre lang="JAVA">public void serviceResolved(DNSSDService resolver,
                            int flags,
                            int ifIndex,
                            java.lang.String fullName,
                            java.lang.String hostName,
                            int port,
                            TXTRecord txtRecord)</pre>
<p>which is called whenever Bonjour was apple to resolve a service. Of course, because of the BaseListener interface, operationFailed must be implemented, too. Let&#8217;s do something useful now.</p>
<p>First of all, we have to enable Bonjour and tell it what to call in case it finds something. It&#8217;s best done by having a Class which handles all the discovery stuff. So whatever your class is, just implement the interface BrowseListener, as the ResolveListener callbacks will be implemented using anonymous classes later. For me, the skeleton looks like this:</p>
<pre lang="JAVA">public class Discover implements BrowseListener {
	// the constructor.
	public Discover(){

	}

	public void serviceLost(DNSSDService browser, int flags, int ifIndex,
				String serviceName, String regType, String domain) {
	}

	public void serviceFound(DNSSDService browser, int flags, int ifIndex,
				String serviceName, String regType, String domain) {
	}

        public void operationFailed(DNSSDService arg0, int arg1) {
		// this one is required by BaseListener, which is the parent of all other Listener Interfaces.
	}
}</pre>
<p>Now I&#8217;m going to initialise Bonjour&#8217;s browsing capabilities in the constructor. Take care, It throws an exception if something goes wrong. It&#8217;s up to you what to do with it.</p>
<pre lang="JAVA">	public Discover(){
		try {
			browser = DNSSD.browse("_killerapp._tcp", this);
		} catch (DNSSDException e) {
			// do something fancy here.
		}
	}</pre>
<p>The method browse requires two arguments, the name of the service you are browsing for, and the callback handler, which is the calling object in that case. Bonjour handles the rest for us, and either one of the methods serviceFound or serviceLost gets called accordingly.</p>
<p>Assuming you are lucky and Bonjour finds a service with that name, serviceFound will be called. To resolve the found service to an IP address and a port, you need to call DNSSD.resolve, a method with the following signature</p>
<pre lang="JAVA">public static DNSSDService resolve(int flags,
                                   int ifIndex,
                                   java.lang.String serviceName,
                                   java.lang.String regType,
                                   java.lang.String domain,
                                   ResolveListener listener)
                            throws DNSSDException</pre>
<p>It&#8217;s okay to fill 0 in flags, for further meaning just read the <a href="http://developer.apple.com/documentation/Java/Reference/DNSServiceDiscovery_JavaRef/index.html">Javadoc</a>. Because our serviceFound method is already called with most of the required arguments, it&#8217;s quite easy to implement the resolve process.</p>
<pre lang="JAVA">DNSSD.resolve(0, ifIndex, serviceName, regType, domain, new ResolveListener(){
				public void serviceResolved(DNSSDService resolver, int flags, int ifIndex,
				String fullname, String hostname, int port, TXTRecord txtRecord){
					InetAddress theAddress;
					try {
						theAddress = InetAddress.getByName(hostname);
					} catch (UnknownHostException e) {
						// ouch..
					}
				}

				public void operationFailed(DNSSDService arg0, int arg1) {
					// ouch, again!
				}
			});</pre>
<p>So what&#8217;s happening here is that we create an anonymous class to handle the callbacks, which should look familiar if you&#8217;ve been doing some AWT stuff. Once the resolve process was successful, the serviceResolved method is called, and we resolve the hostname given there to create an InetAddress object filled with all the information we want to know.</p>
<p>And yes, that&#8217;s it. The same applies for the serviceLost method, which has the same signature, and it&#8217;s up to you what to do with that address object from now on! Hope this helped you a bit.</p>
]]></content:encoded>
			<wfw:commentRss>http://momo.brauchtman.net/2009/01/zeroconf-made-easy-bonjour-for-java-client-implementation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->