<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" xml:lang="en" xml:base="http://www.workreloaded.com/wp-atom.php">
	<title type="text">Work Reloaded</title>
	<subtitle type="text">Free your mind</subtitle>

	<updated>2012-04-24T13:48:12Z</updated>

	<link rel="alternate" type="text/html" href="http://www.workreloaded.com" />
	<id>http://www.workreloaded.com/feed/atom/</id>
	

	<generator uri="http://wordpress.org/" version="3.3.2">WordPress</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/WorkReloaded" /><feedburner:info uri="workreloaded" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry>
		<author>
			<name>Sonja</name>
						<uri>https://plus.google.com/10117358299211429082</uri>
					</author>
		<title type="html"><![CDATA[Java Memory Optimization &amp; Server Resources]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WorkReloaded/~3/vfHj3cVgsdM/" />
		<id>http://www.workreloaded.com/?p=967</id>
		<updated>2012-02-06T12:43:28Z</updated>
		<published>2012-02-06T10:25:23Z</published>
		<category scheme="http://www.workreloaded.com" term="development" /><category scheme="http://www.workreloaded.com" term="java" />		<summary type="html"><![CDATA[I&#8217;ve learned a bit about Java and also about Linux this past week-end. I finally found out, what it was that kept me from going forward with the deployment of my web application. I kept getting OOM errors when starting &#8230; <a href="http://www.workreloaded.com/2012/02/java-memory-optimization-server-resources/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></summary>
		<content type="html" xml:base="http://www.workreloaded.com/2012/02/java-memory-optimization-server-resources/">&lt;p&gt;&lt;a title="Not much here by yashima, on Flickr" href="http://www.flickr.com/photos/yashima/6810858901/"&gt;&lt;img class="alignleft" src="http://farm8.staticflickr.com/7018/6810858901_004f3db1bf_m.jpg" alt="[Photo: Not much here]" width="240" height="160" /&gt;&lt;/a&gt;I&amp;#8217;ve learned a bit about Java and also about Linux this past week-end. I finally found out, what it was that kept me from going forward with the deployment of my web application. I kept getting &lt;a href="http://stackoverflow.com/questions/8540467/out-of-memory-on-tomcat-shutdown"&gt;OOM errors when starting up a second java process&lt;/a&gt; on my virtual server. Even stackoverflow users, thorough and diligent as they are, could not provide me with a solution. (&lt;em&gt;In the end it turned out however that one had provided me with the right information, he just could not know that I was unable to apply it, due to the configuration of the server.&lt;/em&gt;)&lt;/p&gt;
&lt;p&gt;To begin here are a few quick notes on java memory usage and two nice articles: &lt;a href="http://javahowto.blogspot.com/2006/06/6-common-errors-in-setting-java-heap.html"&gt;common errors&lt;/a&gt; and an &lt;a href="http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html"&gt;overview of JVM Options&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;span id="more-967"&gt;&lt;/span&gt;Typically &amp;#8211; with past projects &amp;#8211; we had the problem, that java did not reserve enough memory for the application. So we would try to give it a larger heap. One does this with the Xmx and Xms options. These two are the most commonly used VM options:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;-Xmx sets the maximum heap size, but it does not limit the amount of memory the VM may use&lt;/li&gt;
&lt;li&gt;-Xms sets the initial heap size&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So you might want to start your vm with these java options:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;export JAVA_OPTS="-Xmx64M -Xms64M"&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This time however I had a new problem:&lt;strong&gt; I seemed to not have enough memory on my virtual server.&lt;/strong&gt; I had been sure that 2GB was sufficient to run a small java web application with a few users for my first alpha test (and it is, but not as smooth as I want it to).&lt;/p&gt;
&lt;p&gt;With Xmx and Xms you can not limit the VM. When starting up tomcat the Sun VM would immediately grab 300MB of physical memory. After some searching I found another helpful parameter, some of you might remember this one from trying to keep Eclipse from devouring your development system:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;-XX:MaxPermSize=128m&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Because the other options only limit the heap size (what your programs use). This one actually limits the VM itself. After adding this to my JAVA_OPTS I found that the VM would finally grab only about 190M (sum of heap size and perm size).&lt;/p&gt;
&lt;p&gt;I was however still having trouble running a second java process. Not even java -version would run without throwing my favorite error:&lt;/p&gt;
&lt;p&gt;&lt;code&gt; java.lang.OutOfMemoryError: Cannot create GC thread. Out of system resources.&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This should have told me. I am writing this article because with that search phrase I did not find a solution. It took me many hours of debugging to arrive at the point where I understood what was wrong and could finally approve the correct answer on stackoverflow.&lt;/p&gt;
&lt;p&gt;I was confused because &lt;tt&gt;top&lt;/tt&gt; was telling me there was at least 1GB of memory available (this being a virtual server that would not necessarily be true I guess but since the problem appeared consistently I am quite sure the physical memory is actually available). Even when java was down to &amp;lt;200MB and there was more than 1GB of memory available I kept getting OOM errors (btw the open Jdk used a lot less memory than the sunJdk in my tests). Finally I managed to produce OOM errors even from simple shell commands and that is what led me to the right solution. OOM for me meant &amp;#8220;out of (physical) memory&amp;#8221;. I never looked at the actual error message: &amp;#8220;could not create thread&amp;#8221;. Because there are other resources that may not be available that are also counted among the memory resources.&lt;/p&gt;
&lt;p&gt;On most systems there is a neat little command that shows you a lot about your systems resource configuration:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;ulimit -a&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;On my system ulimit told me that the number of user processes aka threads was unlimited. Well and that is a lie. Because it is not. The virtualization software enforces a hard limit from outside the container. You cannot necessarily see that inside the container. In my case I had access to the &amp;#8220;Parallels Power Panel&amp;#8221; and finally saw under &lt;tt&gt;Resources -&amp;gt; Memory -&amp;gt; Primary System Parameters&lt;/tt&gt; that the value &lt;tt&gt;numproc&lt;/tt&gt; had a hard limit of 96. If you have a real server the answers on stackoverflow should provide you with helpful hints how to fix this, if you have a virtual server you can call your hosting provider and ask if 96 was a mistake by chance because it is a ridiculously low value. (I also should have seen the Ressource Alerts for numproc, but I didn&amp;#8217;t &amp;#8230; as I said I learned a lot this past week-end)&lt;/p&gt;
&lt;p&gt;Run &lt;tt&gt;top&lt;/tt&gt; and toggle to thread view with &lt;tt&gt;shift-h&lt;/tt&gt; and it shows you which of your applications uses up how many of your threads. Here&amp;#8217;s a quick overview what was going on on my system:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;named ~10 threads&lt;/li&gt;
&lt;li&gt;mysql ~10 threads&lt;/li&gt;
&lt;li&gt;apache ~10 threads&lt;/li&gt;
&lt;li&gt;tomcat/java ~30 threads&lt;/li&gt;
&lt;li&gt;misc resource eaters: cron, sshd, init, syslogd&lt;/li&gt;
&lt;li&gt;each login with ssh and subsequent sudo su eats up your processes&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So the more I was debugging the worse my problems got. When I am not logged in and I just started my services my system is using about 50-60 threads just doing nothing. There is no traffic to speak of, as  I am not yet hosting anything.&lt;/p&gt;
&lt;p&gt;It cannot even run jenkins because java seems to need an awful lot of threads when starting up and jenkins of course needs to run mvn or ant to build and so starts up a second java vm which is really expensive as I now know.&lt;/p&gt;
&lt;p&gt;Most of the programs above could possibly be made to use fewer threads for a small test server like this. Which is what I will do for now and then I&amp;#8217;ll be thinking about different hosting options.&lt;/p&gt;
&lt;p&gt;End of story: &lt;em&gt;This morning I called the support and asked if by chance the value for numproc was an error, since I could not find the small print that might have told me so before ordering such a crippled (but indeed rather cheap) server. But alas I was informed that this was as it should be and the server was meant for testing, I should probably go for an upgrade. I totally understand how companies have to make money. You need a low barrier of entry to get people to sign-up for something cheap and then make them upgrade to more expensive servers quickly. Well done, in that aspect! Most people will never find out what it is that is not working. However with this ridiculously low limit I have lost my trust in that the other virtual servers would be adequate. I am not well-versed enough in server hosting to know in advance all possible limits that I would need to check before ordering one of the more powerful servers and when running a few calculations in the end AWS might be cheaper (ulimit -a tells me they allow 1024 threads on the 1-year-free micro instance). Another alternative might be a root server over which I have full control.&lt;/em&gt;&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/WorkReloaded/~4/vfHj3cVgsdM" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.workreloaded.com/2012/02/java-memory-optimization-server-resources/#comments" thr:count="2" />
		<link rel="replies" type="application/atom+xml" href="http://www.workreloaded.com/2012/02/java-memory-optimization-server-resources/feed/atom/" thr:count="2" />
		<thr:total>2</thr:total>
	<feedburner:origLink>http://www.workreloaded.com/2012/02/java-memory-optimization-server-resources/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Sonja</name>
						<uri>https://plus.google.com/10117358299211429082</uri>
					</author>
		<title type="html"><![CDATA[Automate your Android builds comfortably]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WorkReloaded/~3/8lKzVOICrD4/" />
		<id>http://www.workreloaded.com/?p=880</id>
		<updated>2011-10-06T10:01:26Z</updated>
		<published>2011-09-23T15:46:11Z</published>
		<category scheme="http://www.workreloaded.com" term="android" /><category scheme="http://www.workreloaded.com" term="apps" /><category scheme="http://www.workreloaded.com" term="development" /><category scheme="http://www.workreloaded.com" term="work less" />		<summary type="html"><![CDATA[Or: How to set up your Android app&#8217;s Multi Module Maven build as Eclipse project. This week I spend a few hours searching for a solution for automated Android builds with Maven. I want to launch my first paid app &#8230; <a href="http://www.workreloaded.com/2011/09/android-build-automation/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></summary>
		<content type="html" xml:base="http://www.workreloaded.com/2011/09/android-build-automation/">&lt;h2&gt;Or: How to set up your Android app&amp;#8217;s Multi Module Maven build as Eclipse project.&lt;/h2&gt;
&lt;p&gt;&lt;a href="http://www.flickr.com/photos/yashima/6089867255/" title="So schön ist die Eifel by yashima, on Flickr"&gt;&lt;img src="http://farm7.static.flickr.com/6200/6089867255_272a749852_m.jpg" width="240" height="160" alt="So schön ist die Eifel" class="alignleft" &gt;&lt;/a&gt; This week I spend a few hours searching for a solution for automated Android builds with Maven. I want to launch my first paid app with minimum fuss. There is a free version of the app on the market already and now I want to use a multi module Maven project to manage both a free and a paid version of the same app comfortably. I am a lazy programmer after all.&lt;/p&gt;
&lt;p&gt;Since it was not quite the trivial endeavour I had hoped &amp;#8211; but of course not expected &amp;#8211; it to be, I decided to write this up as an article for myself and of course for all the other Android developers out there who don&amp;#8217;t want to waste time setting up projects when they could be gold-plating their apps &lt;img src='http://www.workreloaded.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /&gt; &lt;/p&gt;
&lt;p&gt;You are probably only reading this after you have already created your app and have everything running from Eclipse. And it works, too, up to a certain point. I only started on automated builds when it started hurting me to not have them. So I won&amp;#8217;t cover setting up a fresh project. You should have some working knowledge of Maven and Android. I will assume you have both setup Android and Maven projects in the past.&lt;/p&gt;
&lt;p&gt;This article assumes that you have an Android project without an automated build somewhere. If you don&amp;#8217;t have one just create a new Android project in Eclipse, this will give you a HelloWorld app and everything that is necessary to follow the instructions in this article. Please don&amp;#8217;t recycle your project, you can easily copy over your classes and resources later. Start from scratch with the setup until you have understood what is going on &amp;#8211; there&amp;#8217;ll be less crying if you don&amp;#8217;t break your working project along the way. If you really want to do this on an existing project, tag now!&lt;br /&gt;
&lt;span id="more-880"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h3&gt;Step 0: Install all necessary Eclipse plugins.&lt;/h3&gt;
&lt;p&gt;These being: &lt;a href="http://eclipse.org/m2e/"&gt;m2eclipse&lt;/a&gt;, &lt;a href="http://rgladwell.github.com/m2e-android/"&gt;m2e-android&lt;/a&gt; plugin and of course &lt;a href="http://developer.android.com/sdk/eclipse-adt.html"&gt;android&lt;/a&gt;. You may have to modify your .m2/settings.xml. I added the following lines, so I can call mvn android:deploy on the command line:&lt;/p&gt;
&lt;pre class="brush: xml; title: ; wrap-lines: true; notranslate"&gt;
&amp;lt;pluginGroups&amp;gt;
  &amp;lt;pluginGroup&amp;gt;com.jayway.maven.plugins.android.generation2&amp;lt;/pluginGroup&amp;gt;
&amp;lt;/pluginGroups&amp;gt;
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;What didn&amp;#8217;t work:&lt;/strong&gt; I also experimented with using the existing android archetypes by adding them to .m2/archetype-catalog.xml. Those didn&amp;#8217;t quite work out the way I wanted to.&lt;br /&gt;
&lt;strong&gt;What worked for me:&lt;/strong&gt; So I reverted to a mostly manual set-up, that I will describe in the following steps.&lt;/p&gt;
&lt;h3&gt;Step 1: Setup the root project &amp;amp; the build&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Create a fresh Maven project in Eclipse.&lt;/li&gt;
&lt;li&gt;Select pom-root as archetype.&lt;/li&gt;
&lt;li&gt;Set a GroupId and an ArtifactId.&lt;/li&gt;
&lt;li&gt;You will get an empty project containing only the most basic of poms.&lt;/li&gt;
&lt;li&gt;Add properties to pom.xml&lt;/li&gt;
&lt;li&gt;Add (Android) dependencies to pom.xml&lt;/li&gt;
&lt;li&gt;Configure build plugins&lt;/li&gt;
&lt;li&gt;Add modules&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;First you are going to modify the root pom.xml to include most things you will need for your build.&lt;/p&gt;
&lt;p&gt;You will need a few &lt;strong&gt;properties&lt;/strong&gt; but not all those I have listed (for example the encoding properties). If you have questions regarding these, please don&amp;#8217;t hesitate to ask, I&amp;#8217;ll respond in the comments.&lt;/p&gt;
&lt;pre class="brush: xml; title: ; wrap-lines: true; notranslate"&gt;
  &amp;lt;properties&amp;gt;
        &amp;lt;android.sdk.path&amp;gt;/opt/android/&amp;lt;/android.sdk.path&amp;gt;
        &amp;lt;rt.jar.path&amp;gt;${java.home}/jre/lib/rt.jar&amp;lt;/rt.jar.path&amp;gt;
        &amp;lt;jsse.jar.path&amp;gt;${java.home}/jre/lib/jsse.jar&amp;lt;/jsse.jar.path&amp;gt;
        &amp;lt;android.version&amp;gt;2.2.1&amp;lt;/android.version&amp;gt;
        &amp;lt;android.platform&amp;gt;7&amp;lt;/android.platform&amp;gt;
        &amp;lt;android.emulator.name&amp;gt;ExampleEmulatorName&amp;lt;/android.emulator.name&amp;gt;
        &amp;lt;maven.android.plugin.version&amp;gt;2.9.0-beta-5&amp;lt;/maven.android.plugin.version&amp;gt;
        &amp;lt;!-- not necessary but nice --&amp;gt;
        &amp;lt;project.build.sourceEncoding&amp;gt;UTF-8&amp;lt;/project.build.sourceEncoding&amp;gt;
        &amp;lt;project.reporting.outputEncoding&amp;gt;UTF-8&amp;lt;/project.reporting.outputEncoding&amp;gt;
    &amp;lt;/properties&amp;gt;
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Dependencies&lt;/strong&gt; are the easy part, these are the ones you will need. Of course you may need additional ones, it should still be easy &lt;img src='http://www.workreloaded.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /&gt; &lt;/p&gt;
&lt;pre class="brush: xml; title: ; wrap-lines: true; notranslate"&gt;
	&amp;lt;dependencies&amp;gt;
		&amp;lt;dependency&amp;gt;
			&amp;lt;groupId&amp;gt;com.google.android&amp;lt;/groupId&amp;gt;
			&amp;lt;artifactId&amp;gt;android&amp;lt;/artifactId&amp;gt;
			&amp;lt;version&amp;gt;${android.version}&amp;lt;/version&amp;gt;
			&amp;lt;scope&amp;gt;provided&amp;lt;/scope&amp;gt;
		&amp;lt;/dependency&amp;gt;
		&amp;lt;dependency&amp;gt;
			&amp;lt;groupId&amp;gt;com.google.android&amp;lt;/groupId&amp;gt;
			&amp;lt;artifactId&amp;gt;android-test&amp;lt;/artifactId&amp;gt;
			&amp;lt;version&amp;gt;${android.version}&amp;lt;/version&amp;gt;
			&amp;lt;scope&amp;gt;provided&amp;lt;/scope&amp;gt;
		&amp;lt;/dependency&amp;gt;
	&amp;lt;/dependencies&amp;gt;
&lt;/pre&gt;
&lt;p&gt;The next part is more complicated, it contains the &lt;strong&gt;build&lt;/strong&gt;. My build contains two important plugins:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;the &lt;a href="http://code.google.com/p/maven-android-plugin/"&gt;maven-android-plugin&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;the &lt;a href="http://maven.apache.org/plugins/maven-jarsigner-plugin/"&gt;maven-jarsigner-plugin&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I broke the build in three parts to explain what it does (that&amp;#8217;s what I was missing for most of the &lt;a href="http://code.google.com/p/maven-android-plugin/wiki/LinksBlogsAndMore"&gt;existing articles&lt;/a&gt;). The first part is easy: I am configuring the &lt;strong&gt;maven-compiler-plugin&lt;/strong&gt; to use my favoured version of java.&lt;/p&gt;
&lt;pre class="brush: xml; highlight: [2]; title: ; wrap-lines: true; notranslate"&gt;
&amp;lt;build&amp;gt;
  &amp;lt;pluginManagement&amp;gt;
    &amp;lt;plugins&amp;gt;
      &amp;lt;plugin&amp;gt;
        &amp;lt;groupId&amp;gt;org.apache.maven.plugins&amp;lt;/groupId&amp;gt;
        &amp;lt;artifactId&amp;gt;maven-compiler-plugin&amp;lt;/artifactId&amp;gt;
          &amp;lt;configuration&amp;gt;
          &amp;lt;source&amp;gt;1.6&amp;lt;/source&amp;gt;
          &amp;lt;target&amp;gt;1.6&amp;lt;/target&amp;gt;
        &amp;lt;/configuration&amp;gt;
      &amp;lt;/plugin&amp;gt;
      ...
&lt;/pre&gt;
&lt;p&gt;Please note that I am placing the plugins inside &lt;strong&gt;pluginManagement&lt;/strong&gt; tags, this means I am only configuring the plugins here. If my modules need any of them they will have to be added to the build of the respective module. I am doing this because I may have different builds for my modules.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;I need to rant about this for a moment: it took me a while to figure out the difference between using the pluginManagement vs putting plugins directly in build. Nobody ever tells you about it and it seems to be universal knowledge except most people I know copy without knowing what this all means, which leads to weird builds where a lot of default values are re-configured for example. People just keep fiddling around until it &amp;#8220;works somehow&amp;#8221;. This leads to unstable code. So because we are all lazy copy-pasters, I am trying to explain some the stuff that everybody seems to think is self-evident &amp;#8211; most often it is not. This also helps me learn more about Maven while writing this &lt;img src='http://www.workreloaded.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /&gt;  If you have any questions regarding this article please ask. It can only be improved by the questions people ask!&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;So that needed to be said.&lt;/p&gt;
&lt;p&gt;The second part hopefully is more interesting. This is the &lt;strong&gt;android maven plugin&lt;/strong&gt; configuration:&lt;/p&gt;
&lt;pre class="brush: xml; highlight: [21]; title: ; wrap-lines: true; notranslate"&gt;
      ...
      &amp;lt;plugin&amp;gt;
        &amp;lt;groupId&amp;gt;com.jayway.maven.plugins.android.generation2&amp;lt;/groupId&amp;gt;
        &amp;lt;artifactId&amp;gt;maven-android-plugin&amp;lt;/artifactId&amp;gt;
        &amp;lt;version&amp;gt;${maven.android.plugin.version}&amp;lt;/version&amp;gt;
        &amp;lt;configuration&amp;gt;
          &amp;lt;sdk&amp;gt;&amp;lt;platform&amp;gt;${android.platform}&amp;lt;/platform&amp;gt;&amp;lt;/sdk&amp;gt;
          &amp;lt;emulator&amp;gt;
            &amp;lt;avd&amp;gt;${android.emulator.name}&amp;lt;/avd&amp;gt;
          &amp;lt;/emulator&amp;gt;
        &amp;lt;/configuration&amp;gt;
	&amp;lt;executions&amp;gt;
	  &amp;lt;execution&amp;gt;
	    &amp;lt;id&amp;gt;alignApk&amp;lt;/id&amp;gt;
	    &amp;lt;phase&amp;gt;package&amp;lt;/phase&amp;gt;
	    &amp;lt;goals&amp;gt;
	      &amp;lt;goal&amp;gt;zipalign&amp;lt;/goal&amp;gt;
	    &amp;lt;/goals&amp;gt;
	  &amp;lt;/execution&amp;gt;
          &amp;lt;execution&amp;gt;
            &amp;lt;goals&amp;gt;
              &amp;lt;goal&amp;gt;deploy&amp;lt;/deploy&amp;gt;
            &amp;lt;/goals&amp;gt;
          &amp;lt;/execution&amp;gt;
	&amp;lt;/executions&amp;gt;
        &amp;lt;extensions&amp;gt;true&amp;lt;/extensions&amp;gt;
      &amp;lt;/plugin&amp;gt;
      ...
&lt;/pre&gt;
&lt;p&gt;I added the zipalign because either the market or the emulator complains, if you don&amp;#8217;t optimize the apk this way. I am also configuring the name of the emulator I use. This is something that will differ for your system because whoever setup the android environment will have created an avd and given it a name. Maybe it is possible to create an avd with the maven plugin to have a standardized environment. If not this should probably go inside an environment specific (or personal) properties file (I am not covering this in this article).&lt;/p&gt;
&lt;p&gt;Maven &lt;a href="http://maven.apache.org/pom.html#Extensions"&gt;extensions&lt;/a&gt; (see last line of configuration) are explained here. It seems this is needed so the plugin will actually execute as part of the build. If you delete this line the modules will complain they don&amp;#8217;t know how to build apks. (As you can see I don&amp;#8217;t quite get it. So please enlighten me if you do).&lt;/p&gt;
&lt;p&gt;There are many more configuration options for this plugin. I am trying to create a minimal version that works. The rest of the setup is complicated enough.&lt;/p&gt;
&lt;p&gt;The final plugin is needed, because I want to be able to automate uploading to the market: &lt;strong&gt;the jar signer&lt;/strong&gt;. This is not android specific, nevertheless here&amp;#8217;s a sample configuration. You should probably add the signing properties to a property file, you can also add them to the build like my lazy self did (not in this example however, you can do this as an easy exercise at home).&lt;/p&gt;
&lt;pre class="brush: xml; title: ; wrap-lines: true; notranslate"&gt;
      ...
      &amp;lt;plugin&amp;gt;
        &amp;lt;artifactId&amp;gt;maven-jarsigner-plugin&amp;lt;/artifactId&amp;gt;
        &amp;lt;version&amp;gt;1.2&amp;lt;/version&amp;gt;
	&amp;lt;configuration&amp;gt;
	  &amp;lt;removeExistingSignatures&amp;gt;true&amp;lt;/removeExistingSignatures&amp;gt;
	  &amp;lt;archiveDirectory /&amp;gt;
	  &amp;lt;includes&amp;gt;&amp;lt;include&amp;gt;target/*.apk&amp;lt;/include&amp;gt;&amp;lt;/includes&amp;gt;
          &amp;lt;archive&amp;gt;${project.build.directory}/${project.build.finalName}.${project.packaging}&amp;lt;/archive&amp;gt;
          &amp;lt;certs&amp;gt;true&amp;lt;/certs&amp;gt;
          &amp;lt;keystore&amp;gt;${sign.keystore}&amp;lt;/keystore&amp;gt;
          &amp;lt;alias&amp;gt;${sign.alias}&amp;lt;/alias&amp;gt;
          &amp;lt;storepass&amp;gt;${sign.storepass}&amp;lt;/storepass&amp;gt;
          &amp;lt;keypass&amp;gt;${sign.keypass}&amp;lt;/keypass&amp;gt;
	&amp;lt;/configuration&amp;gt;
	&amp;lt;executions&amp;gt;
	  &amp;lt;execution&amp;gt;
	    &amp;lt;id&amp;gt;signing&amp;lt;/id&amp;gt;
	    &amp;lt;goals&amp;gt;
	      &amp;lt;goal&amp;gt;sign&amp;lt;/goal&amp;gt;
  	    &amp;lt;/goals&amp;gt;
	    &amp;lt;phase&amp;gt;package&amp;lt;/phase&amp;gt;
	  &amp;lt;/execution&amp;gt;
	&amp;lt;/executions&amp;gt;
      &amp;lt;/plugin&amp;gt;
    &amp;lt;/plugins&amp;gt;
  &amp;lt;/pluginManagement&amp;gt;
&amp;lt;/build&amp;gt;
&lt;/pre&gt;
&lt;p&gt;This is what&amp;#8217;s inside the root project. I also placed the keystore there and all the graphics that have accumulated for the project: screenshots, inkscape files for icons etc.&lt;/p&gt;
&lt;h3&gt;Step 2: Creating the basis with a library project&lt;/h3&gt;
&lt;p&gt;My goal is to have two apps that can be deployed: a free version and a paid version. The common stuff will be placed in a so-called Android Library project. What else I do with these, how they differ and how I manage activating the paid functions is not covered here, this is purely the setup. Library Projects are special Android projects that will be imported into other Android projects. They differ from a simple Java module or jar-file in that they are imported as source: both the Java code and all the resources! Also you can override resources from a Library Project in your app project but the resources have to have the same name and need to be placed in the same filename &amp;#8211; this is due to the way resources are packed into your apk (you might remember R.java?).&lt;/p&gt;
&lt;p&gt;To create the library project simply create a Maven module by right-clicking on your parent project and selecting &amp;#8220;New Maven Module Project&amp;#8221; from the &amp;#8220;Maven&amp;#8221; sub menu. Skip archetype selection, we&amp;#8217;ll do this manually. &lt;strong&gt;Packaging is &amp;#8216;apklib&amp;#8217;&lt;/strong&gt;. This will create a very basic module that starts off with an error message &amp;#8220;Unknown packaging: apklib&amp;#8221;. So the first thing you need to do is to add the maven-android-plugin to the build of the library project:&lt;/p&gt;
&lt;pre class="brush: xml; title: ; wrap-lines: true; notranslate"&gt;
&amp;lt;build&amp;gt;
  &amp;lt;plugins&amp;gt;
    &amp;lt;plugin&amp;gt;
      &amp;lt;groupId&amp;gt;com.jayway.maven.plugins.android.generation2&amp;lt;/groupId&amp;gt;
      &amp;lt;artifactId&amp;gt;maven-android-plugin&amp;lt;/artifactId&amp;gt;
        &amp;lt;configuration&amp;gt;
          &amp;lt;attachSources&amp;gt;true&amp;lt;/attachSources&amp;gt;
        &amp;lt;/configuration&amp;gt;
    &amp;lt;/plugin&amp;gt;
   &amp;lt;/plugins&amp;gt;
&amp;lt;/build&amp;gt;
&lt;/pre&gt;
&lt;p&gt;The error should be gone. Before you can add (by copying or developing) your code and resources and of course AndroidManifest.xml you should edit two files .project and .classpath. Because right now this can be a maven build as much as you want to, but it is &amp;#8211; at least according to Eclipse &amp;#8211; not an Android project, actually it is not even a Java project because we skipped archetype selection.&lt;/p&gt;
&lt;p&gt;So here&amp;#8217;s a sample &lt;strong&gt;.project&lt;/strong&gt;:&lt;/p&gt;
&lt;pre class="brush: xml; title: ; wrap-lines: true; notranslate"&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;
&amp;lt;projectDescription&amp;gt;
	&amp;lt;name&amp;gt;example-lib&amp;lt;/name&amp;gt;
	&amp;lt;comment&amp;gt;&amp;lt;/comment&amp;gt;
	&amp;lt;projects&amp;gt;
	&amp;lt;/projects&amp;gt;
	&amp;lt;buildSpec&amp;gt;
                &amp;lt;buildCommand&amp;gt;
		&amp;lt;name&amp;gt;com.android.ide.eclipse.adt.ResourceManagerBuilder&amp;lt;/name&amp;gt;
			&amp;lt;arguments&amp;gt;
			&amp;lt;/arguments&amp;gt;
		&amp;lt;/buildCommand&amp;gt;
		&amp;lt;buildCommand&amp;gt;
			&amp;lt;name&amp;gt;com.android.ide.eclipse.adt.PreCompilerBuilder&amp;lt;/name&amp;gt;
			&amp;lt;arguments&amp;gt;
			&amp;lt;/arguments&amp;gt;
		&amp;lt;/buildCommand&amp;gt;
                &amp;lt;buildCommand&amp;gt;
			&amp;lt;name&amp;gt;org.eclipse.jdt.core.javabuilder&amp;lt;/name&amp;gt;
			&amp;lt;arguments&amp;gt;
			&amp;lt;/arguments&amp;gt;
		&amp;lt;/buildCommand&amp;gt;
		&amp;lt;buildCommand&amp;gt;
			&amp;lt;name&amp;gt;org.maven.ide.eclipse.maven2Builder&amp;lt;/name&amp;gt;
			&amp;lt;arguments&amp;gt;
			&amp;lt;/arguments&amp;gt;
		&amp;lt;/buildCommand&amp;gt;
	&amp;lt;/buildSpec&amp;gt;
	&amp;lt;natures&amp;gt;
		&amp;lt;nature&amp;gt;com.android.ide.eclipse.adt.AndroidNature&amp;lt;/nature&amp;gt;
		&amp;lt;nature&amp;gt;org.eclipse.jdt.core.javanature&amp;lt;/nature&amp;gt;
		&amp;lt;nature&amp;gt;org.maven.ide.eclipse.maven2Nature&amp;lt;/nature&amp;gt;
	&amp;lt;/natures&amp;gt;
&amp;lt;/projectDescription&amp;gt;
&lt;/pre&gt;
&lt;p&gt;You can probably configure all this somewhere in Eclipse. It is much faster and less error prone to edit the file. You need the natures to get all the options for the respective project type. I&amp;#8217;ve left in the Java builder but I took out the Android APK builder but left in the ResourceManagerBuilder and the PreCompilerBuilder. This file is the same for all your Android modules &amp;#8211; except of course for the name. This also should be checked into your version control and be carefully monitored for unplanned changes. The same goes for &lt;strong&gt;.classpath&lt;/strong&gt;, which looks like this:&lt;/p&gt;
&lt;pre class="brush: xml; title: ; wrap-lines: true; notranslate"&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;
&amp;lt;classpath&amp;gt;
	&amp;lt;classpathentry kind=&amp;quot;src&amp;quot; path=&amp;quot;src/main/java&amp;quot;/&amp;gt;
	&amp;lt;classpathentry kind=&amp;quot;con&amp;quot; path=&amp;quot;org.eclipse.jdt.launching.JRE_CONTAINER&amp;quot;/&amp;gt;
	&amp;lt;classpathentry kind=&amp;quot;con&amp;quot; path=&amp;quot;org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER&amp;quot;/&amp;gt;
	&amp;lt;classpathentry kind=&amp;quot;con&amp;quot; path=&amp;quot;com.android.ide.eclipse.adt.ANDROID_FRAMEWORK&amp;quot;/&amp;gt;
	&amp;lt;classpathentry kind=&amp;quot;src&amp;quot; path=&amp;quot;gen&amp;quot;&amp;gt;
		&amp;lt;attributes&amp;gt;
			&amp;lt;attribute name=&amp;quot;optional&amp;quot; value=&amp;quot;true&amp;quot;/&amp;gt;
		&amp;lt;/attributes&amp;gt;
	&amp;lt;/classpathentry&amp;gt;
	&amp;lt;classpathentry kind=&amp;quot;output&amp;quot; path=&amp;quot;target/classes&amp;quot;/&amp;gt;
&amp;lt;/classpath&amp;gt;
&lt;/pre&gt;
&lt;p&gt;This is a compromise: the Eclipse Android plugin really wants to use the &amp;#8216;gen/&amp;#8217; folder while maven really wants to generate everything into target. You cannot configure either the Eclipse Android plugin nor the Maven Android plugin to use different folders (at least not that I found out). So just keep both. To enable you to redeploy changes you made in the library project when running the app modules you need to add the library project to all app modules with eclipse, this modifies your .project file.&lt;/p&gt;
&lt;p&gt;Once you have added the Android nature, new errors will probably crop up: you have to create or copy a default.properties file. Now you also need your Android code. If you don&amp;#8217;t have a finished project or work-in-progress, you can simply create a new Android project in your workspace and copy everything (java code, res/ directory and default.properties, AndroidManifest.xml) from there. This is a &lt;strong&gt;dumb work-around&lt;/strong&gt; but I did not get any of the Android Maven archetypes to work like I wanted them to (also these are covered elsewhere and I wanted to understand what was really needed for once) so I couldn&amp;#8217;t create a Maven Android module in one go. Luckily we don&amp;#8217;t need to set up projects quite that often.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Copy over your code&lt;/strong&gt; and check if the build works. My example project builds now, both in Eclipse and on the command line. The first being for the developer&amp;#8217;s comfort, the latter being the whole point of build automation.&lt;/p&gt;
&lt;p&gt;You can&amp;#8217;t run library projects on the emulator. Don&amp;#8217;t try. First we need an application module.&lt;/p&gt;
&lt;h3&gt;Step 3: Creating the application module&lt;/h3&gt;
&lt;p&gt;Either follow the first few steps (everything but copying over your existing code and resources!) as when creating the module for the library project or copy the skeleton of the library project and add the module manually to the parent project. If you copy everything don&amp;#8217;t forget to remove the code or resources, you don&amp;#8217;t need them in the app project.&lt;/p&gt;
&lt;p&gt;Add the new module to the parent project:&lt;/p&gt;
&lt;pre class="brush: xml; title: ; wrap-lines: true; notranslate"&gt;
&amp;lt;modules&amp;gt;
  &amp;lt;module&amp;gt;example-lib&amp;lt;/module&amp;gt;
  &amp;lt;module&amp;gt;example-app&amp;lt;/module&amp;gt;
&amp;lt;/modules&amp;gt;
&lt;/pre&gt;
&lt;p&gt;Then right-click your project, select &amp;#8220;Import&amp;#8221; and then &amp;#8220;Import Existing Maven Projects&amp;#8221; your module should show up. The biggest difference is that you will need to change the packaging to &amp;#8216;apk&amp;#8217;. Here&amp;#8217;s the complete pom.xml anyway:&lt;/p&gt;
&lt;pre class="brush: xml; highlight: [12,19,25,35]; title: ; wrap-lines: true; notranslate"&gt;
&amp;lt;project xmlns=&amp;quot;http://maven.apache.org/POM/4.0.0&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;
	xsi:schemaLocation=&amp;quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&amp;quot;&amp;gt;
	&amp;lt;modelVersion&amp;gt;4.0.0&amp;lt;/modelVersion&amp;gt;
	&amp;lt;parent&amp;gt;
		&amp;lt;artifactId&amp;gt;example&amp;lt;/artifactId&amp;gt;
		&amp;lt;groupId&amp;gt;de.delusions.example&amp;lt;/groupId&amp;gt;
		&amp;lt;version&amp;gt;0.0.1-SNAPSHOT&amp;lt;/version&amp;gt;
	&amp;lt;/parent&amp;gt;
	&amp;lt;groupId&amp;gt;de.delusions.example&amp;lt;/groupId&amp;gt;
	&amp;lt;artifactId&amp;gt;example-app&amp;lt;/artifactId&amp;gt;
	&amp;lt;version&amp;gt;0.0.1-SNAPSHOT&amp;lt;/version&amp;gt;
	&amp;lt;packaging&amp;gt;apk&amp;lt;/packaging&amp;gt;
	&amp;lt;name&amp;gt;Example App Project&amp;lt;/name&amp;gt;
	&amp;lt;description&amp;gt;the actual app&amp;lt;/description&amp;gt;

    &amp;lt;dependencies&amp;gt;
        &amp;lt;dependency&amp;gt;
            &amp;lt;groupId&amp;gt;de.delusions.example&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;example-lib&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;${project.version}&amp;lt;/version&amp;gt;
            &amp;lt;type&amp;gt;apklib&amp;lt;/type&amp;gt;
        &amp;lt;/dependency&amp;gt;
    &amp;lt;/dependencies&amp;gt;
    &amp;lt;properties&amp;gt;
       &amp;lt;parent.dir&amp;gt;${project.basedir}/../&amp;lt;/parent.dir&amp;gt;
    &amp;lt;/properties&amp;gt;

	&amp;lt;build&amp;gt;
		&amp;lt;plugins&amp;gt;
			&amp;lt;plugin&amp;gt;
				&amp;lt;groupId&amp;gt;com.jayway.maven.plugins.android.generation2&amp;lt;/groupId&amp;gt;
				&amp;lt;artifactId&amp;gt;maven-android-plugin&amp;lt;/artifactId&amp;gt;
			&amp;lt;/plugin&amp;gt;
			&amp;lt;plugin&amp;gt;
                &amp;lt;artifactId&amp;gt;maven-jarsigner-plugin&amp;lt;/artifactId&amp;gt;
                &amp;lt;version&amp;gt;1.2&amp;lt;/version&amp;gt;
            &amp;lt;/plugin&amp;gt;
		&amp;lt;/plugins&amp;gt;

	&amp;lt;/build&amp;gt;

&amp;lt;/project&amp;gt;
&lt;/pre&gt;
&lt;p&gt;I highlighted a few lines here.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Line 12: the different packaging, because that&amp;#8217;s one of the apps you will want to deploy.&lt;/li&gt;
&lt;li&gt;Line 19: the dependency on the library project&lt;/li&gt;
&lt;li&gt;Line 25 and 35: the property configures the directory of the parent project where we placed the key store that the added jarsigner plugin needs.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Step 4: Cleaning up common errors&lt;/h3&gt;
&lt;p&gt;So there might be some more cleanup to do before you can actually run your new multi module maven app project on the emulator. Here&amp;#8217;s a few mistakes I made when setting up the example you can download below:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Missing dependency:&lt;/strong&gt; If you created your project like me, you will now spend about an hour trying to figure out the next error that happens, because Maven doesn&amp;#8217;t find your library project as dependency for your app project. If you made the same mistake as I did, you messed up package names in your poms because in the middle of everything you decided on a new package name. Be consistent with package names, is all I can say.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Library projects cannot be run on emulator:&lt;/strong&gt; because of copying the module somehow the app module was also marked as library project. This can easily be fixed by right-clicking and editing the project properties, the Android menu opens a dialog that will let you &lt;strong&gt;uncheck &amp;#8220;isLibrary&amp;#8221;&lt;/strong&gt; easily.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ClassNotFoundException on Emulator&lt;/strong&gt;: Another typical error. You need to &lt;em&gt;fully qualify all the activities and services etc. in the AndroidManifest.xml&lt;/em&gt; of your app project now. Because you will probably want to change the package of your project to something different from the library. For example I have two app modules. One has the package name &amp;#8220;de.delusions.example.free&amp;#8221; and the other &amp;#8220;de.delusions.example.paid&amp;#8221;. This way I can deploy both apps at the same time with mostly the same code and resources from the library project.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;#8220;No need to reinstall&amp;#8221;&lt;/strong&gt;: I was able to run the apk module on the emulator from eclipse however it didn&amp;#8217;t re-install the apk when I changed the library project. The solution here is to reference the library module as library project in Eclipse (go to Project &gt; Properties &gt; Android)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;#8220;R.java was modified manually! Reverting to generated version!&amp;#8221;&lt;/strong&gt;. This came up after I re-added the Android builders to my .project file (see above). A command line cleanup of the project and an Eclipse restart fixed this. This seems to happen on a variety of occasions (or so the net suggests), that solution may not work for you. Of course you shouldn&amp;#8217;t be modifiying R.java manually! &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Building workspace hangs&lt;/strong&gt; I experienced some kind of build cycle that would run forever while I had both the Android apk builder and the Maven builder enabled. Removing the apk builder fixed this. &lt;/p&gt;
&lt;p&gt;Hopefully you are now able to select &amp;#8220;Run As Android Application&amp;#8221; and you can see your app running on the emulator. Modify your library and see if the changes are redeployed on a second run. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; The example is not quite up to date currently. I updated the article with my latest findings but not yet the download. I created a download with the code for the example I used in this article: &lt;a href="http://www.workreloaded.com/downloads/maven-multi-module-android-example.tgz"&gt;Download Example&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;Step 5: Loose ends&lt;/h3&gt;
&lt;p&gt;&lt;del datetime="2011-10-06T07:43:40+00:00"&gt;Removing the android builders from the .project file of Eclipse causes a lot of havoc with the way I used to test my app. Right now I can&amp;#8217;t quite do it from Eclipse. I have to trigger a maven build to install the apk and then I need to start the app on the emulator manually (there&amp;#8217;s supposedly a feature request for starting the app automatically but I haven&amp;#8217;t found if it was added to the maven plugin). I&amp;#8217;ve experimented a bit with linking projects as libraries (didn&amp;#8217;t work like I wanted it). I&amp;#8217;ve experimented with re-adding the builders. I&amp;#8217;ve not quite solved running everything smoothly from Eclipse. I will be working on that and add my findings to this article.&lt;/del&gt;&lt;/p&gt;
&lt;p&gt;With the re-added ResourceManagerBuilder and PreCompilerBuilder in .project and by adding the library module as library project in Eclipse, for now I seem to be able to run the app modules from Eclipse and Eclipse redeploys the app when I have change the library project. No need to manually run Maven and no more weird hangups.&lt;/p&gt;
&lt;p&gt;BUT .. there is always a but. Working with it I am noticing that only changes in the Java code are used for redeployment. If I only change layouts it just doesn&amp;#8217;t deploy the apk to the emulator until I also change a bit of Java code.&lt;/p&gt;
&lt;p&gt;I have not yet developed any code exclusively for one of my apk modules. So I am waiting how that turns out. What I did so far was create a custom icon for the paid apk module and changing a few of the string resources. &lt;/p&gt;
&lt;p&gt;For a bit of help and an example on a&lt;a href="http://code.google.com/a/eclipselabs.org/p/m2eclipse-android-integration/wiki/GettingStarted"&gt; working Android Maven project&lt;/a&gt; see the Android-Maven-Eclipse Integration plugins website. &lt;/p&gt;
&lt;h3&gt;Step 6: Feedback&lt;/h3&gt;
&lt;p&gt;I hope this helps other developers. Like all writers I love feedback. So if you find this article useful leave me a comment or a question and I will gladly try to answer questions regarding this topic &amp;#8211; if I can. If I made mistakes somewhere please point them out, so I can correct them.&lt;/p&gt;
&lt;p&gt;Thanks for reading!&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/WorkReloaded/~4/8lKzVOICrD4" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.workreloaded.com/2011/09/android-build-automation/#comments" thr:count="4" />
		<link rel="replies" type="application/atom+xml" href="http://www.workreloaded.com/2011/09/android-build-automation/feed/atom/" thr:count="4" />
		<thr:total>4</thr:total>
	<feedburner:origLink>http://www.workreloaded.com/2011/09/android-build-automation/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Sonja</name>
						<uri>https://plus.google.com/10117358299211429082</uri>
					</author>
		<title type="html"><![CDATA[A fairy tale of the Wicket and the Maven]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WorkReloaded/~3/-YiecuHgSss/" />
		<id>http://www.workreloaded.com/?p=771</id>
		<updated>2011-07-11T09:09:02Z</updated>
		<published>2011-07-09T09:11:39Z</published>
		<category scheme="http://www.workreloaded.com" term="development" /><category scheme="http://www.workreloaded.com" term="java" />		<summary type="html"><![CDATA[A short excursion on how to start a wicket project which leads to a more indepth tutorial that shows how to integrate Maven profiles into any project.  There are also specific instructions what changes to make to a wicket project to make the best use of profiles. <a href="http://www.workreloaded.com/2011/07/a-fairy-tale-of-the-wicket-and-the-maven/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></summary>
		<content type="html" xml:base="http://www.workreloaded.com/2011/07/a-fairy-tale-of-the-wicket-and-the-maven/">&lt;p&gt;&lt;a href="http://www.flickr.com/photos/yashima/5849894113/" title="Apollotempel by yashima, on Flickr"&gt;&lt;img src="http://farm6.static.flickr.com/5148/5849894113_4315e86f5a_m.jpg" width="240" height="160" alt="Apollotempel" class="alignleft" &gt;&lt;/a&gt;Lately I&amp;#8217;ve been working on several &lt;a href="http://wicket.apache.org/"&gt;Apache Wicket&lt;/a&gt; projects. Wicket is quite an intuitive and well-rounded web-application framework. Well intuitive for someone who has been programming Java for a long time. Since for the moment I am back to using Real Java&lt;strong&gt;™&lt;/strong&gt; (as opposed to Android), I am also happily back to using &lt;a href="http://maven.apache.org/"&gt;Maven&lt;/a&gt; and that&amp;#8217;s what this article is mostly about.&lt;/p&gt;
&lt;p&gt;When starting out with a new technology I think it&amp;#8217;s best to jump in and get started on a project. &lt;em&gt;Because nothing teaches as fast as doing and nothing leaves the same lasting impressions as the mistakes you make.&lt;br /&gt;
&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The fastest way to introduce yourself to wicket is the &lt;a href="http://wicket.apache.org/start/quickstart.html"&gt;Wicket Quickstart&lt;/a&gt; project. Here&amp;#8217;s the commandline (you could also do the same by creating a project in Eclipse but I would have to provide screenshots and much more explanation, when the original page &amp;#8211; see link above &amp;#8211; does the same quite well).&lt;br /&gt;
&lt;span id="more-771"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;Say hello to Wicket&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;mvn archetype:generate -DarchetypeGroupId=org.apache.wicket -DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=1.5-RC5.1 -DgroupId=com.workreloaded.wicket -DartifactId=profiles -DarchetypeRepository=https://repository.apache.org/ -DinteractiveMode=false&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;So now you have this fresh new wicket project. You programmed a few counters, a form and integrated a bit of &lt;a href="http://www.hibernate.org/"&gt;Hibernate&lt;/a&gt;. You used some of the shiny &lt;a href="http://api.jquery.com/category/ajax/"&gt;Ajax&lt;/a&gt; &lt;a title="You should really try out some of these!" href="http://wicketstuff.org/wicket/ajax/"&gt;features&lt;/a&gt;. Maybe you even downloaded the ebook Version of &lt;a href="http://www.manning.com/dashorst/"&gt;Wicket in Action&lt;/a&gt; and started on your own version of the &lt;a href="http://code.google.com/p/hackystat-ui-wicket/wiki/cheesr"&gt;Cheesr&lt;/a&gt; example. You have probably encountered &lt;a href="https://cwiki.apache.org/WICKET/working-with-wicket-models.html"&gt;Models&lt;/a&gt; and found some &lt;a href="http://wicket.apache.org/apidocs/1.4/"&gt;documentation&lt;/a&gt; and &lt;a href="http://wicketstuff.org/wicket14/index.html"&gt;examples&lt;/a&gt;. You have fiddled around with &lt;a href="http://www.w3schools.com/css/"&gt;CSS&lt;/a&gt; layouts for a while. You have run your application countless times with the integrated &lt;a href="http://www.mortbay.org/"&gt;Jetty&lt;/a&gt; server by just running the provided Start class (now isn&amp;#8217;t that neat?). You have decided it&amp;#8217;s time to tackle something bigger: a real project. One of those ideas you always wanted to &amp;#8230;&lt;/p&gt;
&lt;h2&gt;The Demonstration Paradox&lt;/h2&gt;
&lt;p&gt;It&amp;#8217;s a bit later. You have done it. You have finished a first version of your idea, a prototype. You want to show the world your greatness and what you have programmed these last few days (or weeks). &lt;strong&gt;You want to deploy!&lt;/strong&gt; You install &lt;a href="http://tomcat.apache.org/"&gt;Tomcat&lt;/a&gt; or &lt;a href="http://www.mortbay.org/"&gt;Jetty&lt;/a&gt; on your server and just like that everything works out right from the start &amp;#8211; it&amp;#8217;s like a fairy tale (or this would be a different article on &amp;#8220;how to configure an application server&amp;#8221;).&lt;/p&gt;
&lt;p&gt;So you copy your nice new &lt;code&gt;mygreatidea-0.0.1-SNAPSHOT.war&lt;/code&gt; to the webapps folder of your application server. You even gathered a crowd of soon-to-be-impressed friends, followers and circles. Excitedly you click on the link to the app to present it: &lt;code&gt;http://mydomain.com:8080/mygreatidea/&lt;/code&gt;. &lt;strong&gt;&amp;#8220;Lo and behold my &amp;#8230;&amp;#8221;&lt;/strong&gt; but wait, didn&amp;#8217;t you forget something? You forgot the magic &lt;em&gt;Wand of Making All Installation Locations The Same&lt;/em&gt; and now it&amp;#8217;s too late: the demonstration paradox is staring back at you and whoever is looking and beholding. &lt;/p&gt;
&lt;p&gt;I wonder which of the classics hit first: no styles, no database or is it only the debug mode or is your application just slow because of the huge amount of logging your writing out? (Note: there&amp;#8217;s a place in the persistence.xml that calms down Hibernate &amp;#8211; a lot!) &lt;/p&gt;
&lt;p&gt;Since this is a fairy tale we can easily travel back in time and correct those mistakes. But what were the mistakes? There was basically just one mistake that every developer makes more than once (this particular mistake seems to have some difficulty leaving enough of an impression for us to learn from even if the results can by quite catastrophic): It is the &lt;em&gt;&amp;#8220;But it works on my computer!&amp;#8221;&lt;/em&gt; effect. Corollary: &amp;#8220;But it works on my computer and the development system!&amp;#8221;&lt;/p&gt;
&lt;p&gt;Not all installation locations are created equal, some are for example more restrictive than others. Because this problem exists everywhere, every self-respecting build tool offers a solution. The solution that Maven provides is called &amp;#8220;profiles&amp;#8221;. You may have used them but have you introduced them from scratch to a project? It&amp;#8217;s quite simple actually, most of the work is done in the &lt;code&gt;pom.xml&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;Prolific Profiles&lt;/h2&gt;
&lt;p&gt;First you get to add this little snippet to your pom.xml or your parent-pom or even your .m2/settings.xml.&lt;/p&gt;
&lt;pre class="brush: xml; title: ; wrap-lines: true; notranslate"&gt;
&amp;lt;profiles&amp;gt;
  &amp;lt;profile&amp;gt;
    &amp;lt;id&amp;gt;dev&amp;lt;/id&amp;gt;
    &amp;lt;activation&amp;gt;
      &amp;lt;activeByDefault&amp;gt;true&amp;lt;/activeByDefault&amp;gt;
    &amp;lt;/activation&amp;gt;
    &amp;lt;properties&amp;gt;
      &amp;lt;build.profile.id&amp;gt;dev&amp;lt;/build.profile.id&amp;gt;
    &amp;lt;/properties&amp;gt;
  &amp;lt;/profile&amp;gt;
  &amp;lt;profile&amp;gt;
    &amp;lt;id&amp;gt;prod&amp;lt;/id&amp;gt;
    &amp;lt;properties&amp;gt;
      &amp;lt;build.profile.id&amp;gt;prod&amp;lt;/build.profile.id&amp;gt;
    &amp;lt;/properties&amp;gt;
    &amp;lt;activation&amp;gt;
      &amp;lt;property&amp;gt;
        &amp;lt;name&amp;gt;profile&amp;lt;/name&amp;gt;
        &amp;lt;value&amp;gt;prod&amp;lt;/value&amp;gt;
      &amp;lt;/property&amp;gt;
    &amp;lt;/activation&amp;gt;
  &amp;lt;/profile&amp;gt;
&amp;lt;/profiles&amp;gt;
&lt;/pre&gt;
&lt;p&gt;This creates 2 profiles, a development profile and a production profile. You can have as many different profiles as you want. For now each profile has a single property: an id that can be used elsewhere in the build. Also important is the activation tag: it determines when this profile is going to be used. In this snippet we have two variants: automatic activation for the default profile and activation by a property: &lt;code&gt;mvn clean install -Dprofile=prod&lt;/code&gt;. There are even more types of activation for example you could automatically select the production profile when you want to create a release (I&amp;#8217;ll leave this to you to find out as a small exercise).&lt;/p&gt;
&lt;p&gt;Next you need to collect the profile specific information. Typical examples for profile specific information can include but are not necessarily limited to: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;database configuration&lt;/li&gt;
&lt;li&gt;logging configuration&lt;/li&gt;
&lt;li&gt;debug modes&lt;/li&gt;
&lt;li&gt;path information&lt;/li&gt;
&lt;li&gt;different implementations in your code&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I am sure you can think of some more. So to allow you to control all these different configurations it would be wise to have a central property file that collects all those differences between your different deployments. Let&amp;#8217;s see what the file &lt;code&gt;config.properties&lt;/code&gt; could look like for the development profile:&lt;/p&gt;
&lt;pre class="brush: plain; title: ; notranslate"&gt;
database.name=mygreatidea
database.user=me
database.password=mypassword
logging.level=DEBUG
logging.path=mygreatidea/log
wicket.mode=development
&lt;/pre&gt;
&lt;p&gt;For other profiles you would have the same properties but of course different values. You need to place the different properties in files in such a way that maven can find them by the profile id that we defined in the first xml-snippet. Most commonly this is done in profile specific directories:&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
mygreatidea\profiles\dev\config.properties&lt;br /&gt;
mygreatidea\profiles\prod\config.properties&lt;br /&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Now you must make this information known to the build. This is again done in the &lt;code&gt;pom.xml&lt;/code&gt; by simply adding a so-called &lt;code&gt;filter&lt;/code&gt; to the &lt;code&gt;build&lt;/code&gt;.&lt;/p&gt;
&lt;pre class="brush: xml; title: ; notranslate"&gt;
&amp;lt;build&amp;gt;
  &amp;lt;filters&amp;gt;
    &amp;lt;filter&amp;gt;profiles/${build.profile.id}/config.properties&amp;lt;/filter&amp;gt;
  &amp;lt;/filters&amp;gt;
  &amp;lt;resources&amp;gt;
    &amp;lt;resource&amp;gt;
      &amp;lt;filtering&amp;gt;true&amp;lt;/filtering&amp;gt;
      &amp;lt;directory&amp;gt;src/main/resources&amp;lt;/directory&amp;gt;
    &amp;lt;/resource&amp;gt;
    &amp;lt;resource&amp;gt;
      &amp;lt;filtering&amp;gt;true&amp;lt;/filtering&amp;gt;
      &amp;lt;directory&amp;gt;src/main/webapp&amp;lt;/directory&amp;gt;
    &amp;lt;/resource&amp;gt;
  &amp;lt;/resources&amp;gt;
&amp;lt;/build&amp;gt;
&lt;/pre&gt;
&lt;p&gt;What this does is quite simple: it will apply this filter to all files for which filtering is true. Applying the filter means quite simply substituting any properties (don&amp;#8217;t worry I&amp;#8217;ll get to that) found in the files in &lt;code&gt;src/main/resources&lt;/code&gt; (and &lt;code&gt;src/main/webapp&lt;/code&gt;) with the profile specific properties from the config.properties file. In a typical Wicket project you will find both the &lt;code title="your logging configuration"&gt;log4j.properties&lt;/code&gt; and the &lt;code title="your database configuration"&gt;persistence.xml&lt;/code&gt; in that &lt;code&gt;resources&lt;/code&gt; folder hierarchy. Adding something as resource also causes Maven to copy those files to the target folder. &lt;/p&gt;
&lt;p&gt;In Wicket projects the files in &lt;code&gt;src/main/webapp&lt;/code&gt; are not normally filtered because the war plugin is by (Wicket) default configured to look for them in the &lt;code&gt;src&lt;/code&gt; folder. However the easiest way to deactivate &lt;code&gt;development mode&lt;/code&gt; in wicket is by adding the information to the &lt;code&gt;web.xml&lt;/code&gt; config file. So I have added webapps as resources to be copied to the &lt;code&gt;target&lt;/code&gt; folder. (You will also have to modify the Start class, that you use for local testing. It also needs the filtered files, just point it to &lt;code&gt;target&lt;/code&gt; instead of &lt;code&gt;src/&lt;/code&gt; and you&amp;#8217;ll be fine.)&lt;/p&gt;
&lt;p&gt;In the final step add this to your &lt;code&gt;web.xml&lt;/code&gt;&lt;/p&gt;
&lt;pre class="brush: xml; highlight: [3]; title: ; notranslate"&gt;
  &amp;lt;context-param&amp;gt;
    &amp;lt;param-name&amp;gt;configuration&amp;lt;/param-name&amp;gt;
    &amp;lt;param-value&amp;gt;${wicket.mode}&amp;lt;/param-value&amp;gt;
  &amp;lt;/context-param&amp;gt;
&lt;/pre&gt;
&lt;p&gt;There are two important things to note in this snippet: first it shows how to turn on or off development mode in Wicket (allowed values are &lt;code&gt;development&lt;/code&gt; or &lt;code&gt;deployment&lt;/code&gt; by the way). Secondly and most importantly it demonstrates how the properties in your profile can be used in the filtered files. It should now be easy to add your properties to the logging configuration and your database configuration. &lt;/p&gt;
&lt;p&gt;You can even use this mechanism to generate profile specific java code (of course that is a bit more complicated unless you only substitute string literals). &lt;/p&gt;
&lt;p&gt;After you finished replacing all the profile specific values with properties during your timetravel in the past, you go back to the future just to the point before the deployment and you dazzle the crowd with &lt;em&gt;your great idea™&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;I think profiles are a very important addition to any project because you only have to think about each difference once, implement it and forget about it. And if you do encounter the demonstration paradox it&amp;#8217;s quite easy to not repeat the same mistake because there&amp;#8217;s simple way to fix such problems!&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Thanks for reading. I hope you enjoyed this little tale. It&amp;#8217;s the week-end and I am entitled to have some fun &lt;img src='http://www.workreloaded.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /&gt; &lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/WorkReloaded/~4/-YiecuHgSss" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.workreloaded.com/2011/07/a-fairy-tale-of-the-wicket-and-the-maven/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://www.workreloaded.com/2011/07/a-fairy-tale-of-the-wicket-and-the-maven/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://www.workreloaded.com/2011/07/a-fairy-tale-of-the-wicket-and-the-maven/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Sonja</name>
						<uri>https://plus.google.com/10117358299211429082</uri>
					</author>
		<title type="html"><![CDATA[How to use the Android Camera]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WorkReloaded/~3/Xrxcc9g5nUM/" />
		<id>http://www.workreloaded.com/?p=760</id>
		<updated>2011-06-07T14:23:36Z</updated>
		<published>2011-06-07T14:23:36Z</published>
		<category scheme="http://www.workreloaded.com" term="android" />		<summary type="html"><![CDATA[I have now spent quite a few hours programming for my next app which needs to take pictures. I did not want to use the camera app that&#8217;s already there for several reasons. So I need to programm my own. &#8230; <a href="http://www.workreloaded.com/2011/06/how-to-use-the-android-camera/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></summary>
		<content type="html" xml:base="http://www.workreloaded.com/2011/06/how-to-use-the-android-camera/">&lt;p&gt;I have now spent quite a few hours programming for my next app which needs to take pictures. I did not want to use the camera app that&amp;#8217;s already there for several reasons. So I need to programm my own. The API is not all that difficult to understand. Here&amp;#8217;s the basic version of how to talk to the camera:&lt;/p&gt;
&lt;pre class="brush: java; title: ; wrap-lines: true; notranslate"&gt;
    //creating the camera object
    Camera camera = Camera.open();
    camera.setPreviewDisplay(getSurfaceHolder());
    final Camera.Parameters parameters = findBestParameters(w, h);
    camera.setParameters(parameters);
    camera.startPreview();
    final PictureCallback callback = new PictureCallback() {
        @Override
        public void onPictureTaken(byte[] data, Camera camera) {
            try {
                //async task for storing the photo
                new SavePhotoTask(CameraView.this.ctx, data).execute();
            } catch (final SavePhotoException e) {
                //some exceptionhandling
            }
        }
    };
    //no need for shutter callback or raw callback, jpg callback is enough
    camera.takePicture(null, null, callback);
&lt;/pre&gt;
&lt;p&gt;Doesn&amp;#8217;t sound so hard? It only took me hours to get it right. Because I never got to the &lt;code&gt;onPictureTaken(...)&lt;/code&gt; method. &lt;a href="http://stackoverflow.com/questions/6200369/picturecallback-onpicturetaken-never-called"&gt;The callback never happend&lt;/a&gt;! I made the mistake wanting to do something else after taking the picture &amp;#8211; who wouldn&amp;#8217;t?&lt;br /&gt;
&lt;span id="more-760"&gt;&lt;/span&gt;&lt;br /&gt;
There are several issues with that. It takes the phone quite a while (~5 seconds) to actually take that picture once the &lt;code&gt;camera.takePicture(...)&lt;/code&gt; method is called. Since the method is an asynchronous callback you can do all kinds of &lt;strong&gt;fun things(tm)&lt;/strong&gt;, while waiting for the result. For example I managed to execute some very important piece of code:&lt;/p&gt;
&lt;pre class="brush: java; title: ; wrap-lines: true; notranslate"&gt;
public void clearCamera() {
        if (this.camera != null) {
            try {
                this.camera.stopPreview();
                this.camera.release();
                this.camera = null;
            } catch (final Exception e) {
                //handle some exceptions
            }
        }
    }
&lt;/pre&gt;
&lt;p&gt;This should be called by &lt;code&gt;onPause()&lt;/code&gt; of your activity (and &lt;code&gt;onResume()&lt;/code&gt; you should of course re-open the camera!). So if for some reason while you do the fun things(tm) I mentionned above your activity decides to take a break,&lt;strong&gt; the callback never happens&lt;/strong&gt;! Ouch.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;So how did I get my activity to wait for the callback and then do something?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In the first code sample you can see that the actual picture storing takes place in a class called &lt;code&gt;SavePhotoTask&lt;/code&gt;. This class is an asynchronous task that offers the functionality I needed. Please notice that since the first code sample some things changed and the task now also implements the callback interface:&lt;/p&gt;
&lt;pre class="brush: java; title: ; wrap-lines: true; notranslate"&gt;
public class SavePhotoTask
    extends AsyncTask&amp;lt;Boolean, Void, File&amp;gt;
    implements PictureCallback {

    //fill in the rest as a light exercise at home
    private final ProgressDialog dialog;

    @Override
    protected void onPreExecute() {
        this.dialog.setMessage(String.format(&amp;quot;Saving Picture&amp;quot;));
        this.dialog.show();
    }

    @Override
    protected File doInBackground(Boolean... params) {
        this.camera.takePicture(null, null, this);
        return this.spot.getPhoto();
    }

    @Override
    protected void onPostExecute(final File success) {
        if (this.dialog.isShowing()) {
            this.dialog.dismiss();
        }
        if (success != null &amp;amp;&amp;amp; success.exists()) {
            DialogFactory.keepPhotoDialog(this.ctx, this.photo).show();
        } else {
            Toast.makeText(this.ctx, &amp;quot;You failed!&amp;quot;, Toast.LENGTH_SHORT).show();
        }
    }

    @Override
    public void onPictureTaken(byte[] data, Camera camera) {
        try {
            //I guess you know how to save a file
            saveFile(data);
        } catch (final Exception e) {
            //capture flying shit
        }
    }
}
&lt;/pre&gt;
&lt;p&gt;So now I can execute my picture taking as an asynchronous task, that gets a callback to &lt;code&gt;onPostExecute(...)&lt;/code&gt; when it is finished. I can then open another dialog prompting the user to do something. I introduced that additional dialog to get a break before leaving the original activity (remember how leaving will close the camera and we should not do it before the picture is stored safely on the sdcard).&lt;/p&gt;
&lt;p&gt;So to keep it complete, here&amp;#8217;s the final piece of code: the dialog.&lt;/p&gt;
&lt;pre class="brush: java; title: ; wrap-lines: true; notranslate"&gt;
    public static AlertDialog keepPhotoDialog(final Activity a, final MyPhoto photo) {
        final AlertDialog.Builder builder = new AlertDialog.Builder(a);
        builder.setMessage(&amp;quot;Keep photo?&amp;quot;);
        builder.setCancelable(false);
        builder.setPositiveButton(&amp;quot;yes&amp;quot;, new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int id) {
                final Intent i = new Intent(a, DoFunThingsActivity.class);
                i.putExtra(DoFunThingsActivity.PHOTO, photo);
                a.startActivity(i);
            }
        });
        builder.setNegativeButton(&amp;quot;no&amp;quot;, new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int id) {
                final File file = new File(photo.getFilename());
                if (file.exists()) {
                    file.delete();
                }
                dialog.dismiss();
                //you might want to call startPreview() again at this point
            }
        });
        return builder.create();
    }
&lt;/pre&gt;
&lt;p&gt;So here&amp;#8217;s it, I chained two dialogs to take a picture and do &lt;strong&gt;fun things(tm)&lt;/strong&gt; with it later without having to start handle threads and all that stuff.&lt;/p&gt;
&lt;p&gt;Any questions? &lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/WorkReloaded/~4/Xrxcc9g5nUM" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.workreloaded.com/2011/06/how-to-use-the-android-camera/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://www.workreloaded.com/2011/06/how-to-use-the-android-camera/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://www.workreloaded.com/2011/06/how-to-use-the-android-camera/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Sonja</name>
						<uri>https://plus.google.com/10117358299211429082</uri>
					</author>
		<title type="html"><![CDATA[Open Source Android: DroidWeight]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WorkReloaded/~3/pkbe49kXGCo/" />
		<id>http://www.workreloaded.com/?p=755</id>
		<updated>2011-06-07T07:48:50Z</updated>
		<published>2011-06-06T16:39:27Z</published>
		<category scheme="http://www.workreloaded.com" term="android" /><category scheme="http://www.workreloaded.com" term="apps" />		<summary type="html"><![CDATA[A few minutes ago I made my first commit on the new svn repository for DroidWeight on google code: http://code.google.com/p/droidweight/. I had a couple of requests to open source it. Since I never planned on making money from the app &#8230; <a href="http://www.workreloaded.com/2011/06/open-source-android-droidweight/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></summary>
		<content type="html" xml:base="http://www.workreloaded.com/2011/06/open-source-android-droidweight/">&lt;p&gt;&lt;a title="Segelboote by yashima, on Flickr" href="http://www.flickr.com/photos/yashima/5804465746/"&gt;&lt;img class="alignleft" title="Segelboote am Bodensee" src="http://farm6.static.flickr.com/5064/5804465746_4874daa810_m.jpg" alt="Segelboote" width="240" height="160" /&gt;&lt;/a&gt;A few minutes ago I made my first commit on the new svn repository for &lt;a title="Droid Weight" href="http://www.workreloaded.com/software/droid-weight/"&gt;DroidWeight&lt;/a&gt; on google code: &lt;a href="http://code.google.com/p/droidweight/"&gt;http://code.google.com/p/droidweight/&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I had a couple of requests to open source it. Since I never planned on making money from the app anyway &amp;#8211; after all it is my learning app &amp;#8211; I thought I could just as well share. Maybe I&amp;#8217;ll find a couple of contributors.&lt;/p&gt;
&lt;p&gt;So if you would like access to the repository and the google group just drop me a note via mail or the contact form and I&amp;#8217;ll see to it.&lt;/p&gt;
&lt;p&gt;Right now the documentation is practically non-existent, so you should be brave enough to find your own way through the code.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ll still be publishing releases as before only now everyone can see the code and take it to make their own stuff with it, laugh about dumb beginner&amp;#8217;s errors I made or contribute patches.&lt;/p&gt;
&lt;p&gt;This is the first time I am open sourcing a project of mine and I am curious how it will turn out &lt;img src='http://www.workreloaded.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /&gt; &lt;/p&gt;
&lt;p&gt;PS: the app is close to 10.000 downloads on the market!&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/WorkReloaded/~4/pkbe49kXGCo" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.workreloaded.com/2011/06/open-source-android-droidweight/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://www.workreloaded.com/2011/06/open-source-android-droidweight/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	<feedburner:origLink>http://www.workreloaded.com/2011/06/open-source-android-droidweight/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Sonja</name>
						<uri>https://plus.google.com/10117358299211429082</uri>
					</author>
		<title type="html"><![CDATA[Call for links]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WorkReloaded/~3/DdYPb-TYWQ8/" />
		<id>http://www.workreloaded.com/?p=743</id>
		<updated>2011-05-16T09:45:01Z</updated>
		<published>2011-05-16T09:45:01Z</published>
		<category scheme="http://www.workreloaded.com" term="Agile Methods" /><category scheme="http://www.workreloaded.com" term="processes" />		<summary type="html"><![CDATA[I am looking for pages, forums, communities and blogs on all things scrum or agile. I will also happily take a look at general software development processes and methodology sources. I&#8217;d be grateful for some good places to start reading. &#8230; <a href="http://www.workreloaded.com/2011/05/call-for-links/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></summary>
		<content type="html" xml:base="http://www.workreloaded.com/2011/05/call-for-links/">&lt;p&gt;I am looking for pages, forums, communities and blogs on all things scrum or agile. I will also happily take a look at general software development processes and methodology sources. I&amp;#8217;d be grateful for some good places to start reading.&lt;/p&gt;
&lt;p&gt;What are your favorite places to go read up on the latest agile news?&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/WorkReloaded/~4/DdYPb-TYWQ8" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.workreloaded.com/2011/05/call-for-links/#comments" thr:count="3" />
		<link rel="replies" type="application/atom+xml" href="http://www.workreloaded.com/2011/05/call-for-links/feed/atom/" thr:count="3" />
		<thr:total>3</thr:total>
	<feedburner:origLink>http://www.workreloaded.com/2011/05/call-for-links/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Sonja</name>
						<uri>https://plus.google.com/10117358299211429082</uri>
					</author>
		<title type="html"><![CDATA[3 Approaches to Change]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WorkReloaded/~3/tFyEpjV2tg4/" />
		<id>http://www.workreloaded.com/?p=722</id>
		<updated>2011-05-13T12:50:08Z</updated>
		<published>2011-05-13T11:01:42Z</published>
		<category scheme="http://www.workreloaded.com" term="processes" />		<summary type="html"><![CDATA[In Can you change your team? I asked you to think about what you want to change the most about your work. What you want to change dictates which approaches to change is most likely to succeed. The best approach &#8230; <a href="http://www.workreloaded.com/2011/05/3-approaches-to-change/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></summary>
		<content type="html" xml:base="http://www.workreloaded.com/2011/05/3-approaches-to-change/">&lt;p&gt;In &lt;a title="Can you change your team?" href="http://www.workreloaded.com/2011/05/can-you-change-your-team/"&gt;Can you change your team?&lt;/a&gt; I asked you to think about what you want to change the most about your work. What you want to change dictates which approaches to change is most likely to succeed. The best approach depends largely on how much influence you have on that aspect of your work.&lt;/p&gt;
&lt;h2&gt;Analyse your problem&lt;/h2&gt;
&lt;p&gt;Now that you know what you want to change, it is time to start  thinking about a solution. Most of the common problems can be sorted into  three categories according to the most promising approach to get them  fixed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt; improve communication&lt;/li&gt;
&lt;li&gt;improve transparency&lt;/li&gt;
&lt;li&gt;improve team organization&lt;span id="more-722"&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;1. Talk to each other&lt;/h2&gt;
&lt;p&gt;If your problem is within your direct sphere of influence say within your team, it is very likely that improving communication is the way to go. Such problems can be hard to spot, they are subtle because they are so close to home. Communication is all about talking with each other. Many teams are  not doing that. There may be regular team meetings in your team. But are  you really talking to each other? During your breaks when you talk to each other, are you talking about work?&lt;/p&gt;
&lt;p&gt;It is always possible and also quite simple to change the way a team communicates. One of the easiest ways to get massive improvements is a &lt;a href="http://martinfowler.com/articles/itsNotJustStandingUp.html"&gt;daily&lt;/a&gt; &lt;a href="http://www.extremeprogramming.org/rules/standupmeeting.html"&gt;stand-up&lt;/a&gt; &lt;a href="http://blogs.atlassian.com/developer/2009/06/getting_started_with_agile_daily_standup_meetings.html"&gt;meeting&lt;/a&gt;. This is taken from the agile repertoire and those 10 minutes cost no more than a coffee break yet they can provide much insight for a team.&lt;/p&gt;
&lt;h2&gt;2. Enable others to see your team&lt;/h2&gt;
&lt;p&gt;Many problems originate outside of your team. Those can be quite obvious because people tend to complain out these much more openly: it is much easier to blame people who are at least one step removed from you in the organization. Usually you do not   have the power to tell people from other teams or those higher up in the   hierarchy what to do. So this issue is a favorite of those who prefer complaining to doing anything.&lt;/p&gt;
&lt;p&gt;For this you  another type of communication:  Transparency. Transparency is about communicating to people outside your  team. It is about showing others the status quo. It is less about  fixing a problem than about making it visible to others. If you do not have direct influence on what or who you want to change this indirect method can come in helpful. Showing others facts and numbers how something influences the productivity of a team will have much more impact than any other argument.&lt;/p&gt;
&lt;h2&gt;3. Get creative and &amp;#8220;deal with it&amp;#8221;&lt;/h2&gt;
&lt;p&gt;The last type of issue is hardest to spot and hardest to fix. Sometimes the cause of trouble is so far removed from your sphere of influence that neither improved communication nor transparency are going to be of any help: you simply cannot change &lt;em&gt;the way things are&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&amp;#8220;Changing Requirements&amp;#8221; can often be such an issue. Showing others, that this is causing trouble for your team is not going to have any  effect. The problem may come from so far higher up the corporate food  chain, that there is simply noone you can influence. This is where the right mindset plays an important role: accept the problem as fact and get creative in dealing with it.  Take it as a challenge to you and your team to organize yourself in a  way that you are able to work with the problem rather than against it.&lt;/p&gt;
&lt;p&gt;For this last category I have an example: The team I was working in  had trouble with  estimates and project finishing dates. The official  process had a rule that in the beginning of a project the team leader  should give a rough estimate how long a project would take. Later then  the estimate was supposed to be refined. The problem was that the  refined estimate was never taken into account for the project plan  because the rough estimates were entered into the company roadmap and  were never changed later. Once this was recognized by the team we  skipped the rough estimate part and instead handed in the refined  estimate very early in the project lifecycle. Those estimates could  still be wrong but at least one of the biggest sources of wrong  estimates was eliminated in that way.&lt;/p&gt;
&lt;h2&gt;Compromise&lt;/h2&gt;
&lt;p&gt;It is not easy to find such solutions. You need to have an eye for it  which only comes through practice. Also it has proven to be one of the most convincing arguments to put forward:  &amp;#8220;I know I cannot change the facts of how the estimates are  taken into account, I only want to change how we deal with it!&amp;#8221; Offering to change your side in order to solve a problem clearly shows your commitment to improve the work process and may help finding a compromise that everybody profits from.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/WorkReloaded/~4/tFyEpjV2tg4" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.workreloaded.com/2011/05/3-approaches-to-change/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://www.workreloaded.com/2011/05/3-approaches-to-change/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://www.workreloaded.com/2011/05/3-approaches-to-change/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Sonja</name>
						<uri>https://plus.google.com/10117358299211429082</uri>
					</author>
		<title type="html"><![CDATA[Can you change your team?]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WorkReloaded/~3/bFSWKzDkRhM/" />
		<id>http://www.workreloaded.com/?p=694</id>
		<updated>2011-05-15T06:25:51Z</updated>
		<published>2011-05-12T08:19:44Z</published>
		<category scheme="http://www.workreloaded.com" term="processes" />		<summary type="html"><![CDATA[Yes you can! The words may have gotten a bit old by now. I still say: you won&#8217;t know until you have tried and succeeded. Are you working in one of those teams, that I described in my last article? &#8230; <a href="http://www.workreloaded.com/2011/05/can-you-change-your-team/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></summary>
		<content type="html" xml:base="http://www.workreloaded.com/2011/05/can-you-change-your-team/">&lt;h2&gt;&lt;a href="http://obamiconme.pastemagazine.com/entries/new_obamicon.html"&gt;&lt;img class="alignleft" title="Obamafied Me" src="http://farm4.static.flickr.com/3644/5712624500_c41e8b4696_m.jpg" alt="obamafy" width="195" height="240" /&gt;&lt;/a&gt;Yes you can!&lt;/h2&gt;
&lt;p&gt;The words may have gotten a bit old by now. I still say: you won&amp;#8217;t know until you have tried and succeeded.&lt;/p&gt;
&lt;p&gt;Are you working in one of those teams, that I described in my &lt;a title="Why every team needs a development process" href="http://www.workreloaded.com/2011/05/developmentprocess/"&gt;last article&lt;/a&gt;? It can be hard to imagine, that you are able to facilitate any change regardless of your role in the team.  Are you the team leader and everybody thinks you should be the one to change everything? Or are you a team member and you think you do not have the power to change anything? You all have your excuses for not even trying:&lt;span id="more-694"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;em&gt;Team Leader&lt;/em&gt;: &lt;em&gt;&amp;#8220;I have these great ideas &lt;strong&gt;but&lt;/strong&gt; I have no idea how to get the team to accept them, they are too stubborn and they hate having to change.&lt;/em&gt;&amp;#8220;&lt;/p&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;em&gt;Team Member&lt;/em&gt;:&lt;em&gt; &amp;#8220;I see all the possible improvements that could be made and I really want to change the way we work, &lt;strong&gt;but&lt;/strong&gt; I cannot tell anyone what to do&lt;/em&gt;.&lt;em&gt; I just don&amp;#8217;t have the authority!&amp;#8221;&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Even when every person on the team knows that something should be done, it does not mean that anything is going to improve by itself! Toss out the excuses and imagine that you can change the way things are: because you can!&lt;/p&gt;
&lt;h2&gt;The question is how?&lt;/h2&gt;
&lt;p&gt;People are loath to change. We all know that. Who has not watched at least one if not several attempts to improve the way a team works and see them fail miserably? Initially people may give new ideas a try. And yet after a few weeks somehow everything is back to the &amp;#8220;good&amp;#8221; old way.&lt;/p&gt;
&lt;p&gt;I think the reason for this happening is, that the majority of people is settled in their routine. Any disturbances are likely going to be viewed as exactly that: a disturbance.&lt;/p&gt;
&lt;h2&gt;Start small&lt;/h2&gt;
&lt;p&gt;I propose starting with small changes on the biggest problem. My question at the end of &lt;a title="Why every team needs a development process" href="http://www.workreloaded.com/2011/05/developmentprocess/"&gt;the article&lt;/a&gt; was about this: &amp;#8220;What is your biggest issue currently?&amp;#8221; That should be your starting point.  With the most obvious problem you will have the best chances to convince your colleagues or team members to do something about it.&lt;/p&gt;
&lt;p&gt;I have asked a few people and  got some of the following answers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;#8220;I do not like how people are treated and how they treat each other&amp;#8221;&lt;/li&gt;
&lt;li&gt;&amp;#8220;I hate that we are asked for estimates for the projects, which are then ignored&amp;#8221;&lt;/li&gt;
&lt;li&gt;&amp;#8220;I wish I knew what my colleagues were working on, I hate being a 1-woman-show&amp;#8221;&lt;/li&gt;
&lt;li&gt;&amp;#8220;There&amp;#8217;s just too much work.&amp;#8221;&lt;/li&gt;
&lt;li&gt;&amp;#8220;There&amp;#8217;s too little work! I don&amp;#8217;t have anything to do and I am bored.&amp;#8221;&lt;/li&gt;
&lt;li&gt;&amp;#8220;I don&amp;#8217;t know, what my job is, half of the time.&amp;#8221;&lt;/li&gt;
&lt;li&gt;&amp;#8220;I have no idea how far my team got with their work this week.&amp;#8221;&lt;/li&gt;
&lt;li&gt;&amp;#8220;Our projects always take longer than planned for.&amp;#8221;&lt;/li&gt;
&lt;li&gt;&amp;#8220;The requirements are written badly and change all the time&amp;#8221;&lt;/li&gt;
&lt;li&gt;&amp;#8220;I cannot get any work done because there are too many meetings, telephone calls and people coming into my office.&amp;#8221;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Take your pick of 1 thing.&lt;/p&gt;
&lt;h2&gt;What is the smallest step you can take towards solving this problem?&lt;/h2&gt;
&lt;p&gt;Tomorrow I&amp;#8217;ll post the second part that talks about different approaches to achieve change and improve your life at work.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/WorkReloaded/~4/bFSWKzDkRhM" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.workreloaded.com/2011/05/can-you-change-your-team/#comments" thr:count="4" />
		<link rel="replies" type="application/atom+xml" href="http://www.workreloaded.com/2011/05/can-you-change-your-team/feed/atom/" thr:count="4" />
		<thr:total>4</thr:total>
	<feedburner:origLink>http://www.workreloaded.com/2011/05/can-you-change-your-team/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Sonja</name>
						<uri>https://plus.google.com/10117358299211429082</uri>
					</author>
		<title type="html"><![CDATA[Why every team needs a development process]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WorkReloaded/~3/olyMkxZr4b4/" />
		<id>http://www.workreloaded.com/?p=659</id>
		<updated>2011-05-06T17:45:54Z</updated>
		<published>2011-05-06T17:44:20Z</published>
		<category scheme="http://www.workreloaded.com" term="processes" />		<summary type="html"><![CDATA[Imagine a typical software development team. There are 2 types of such teams: those that are based around a single project or those around a single system. People tend to want to differentiate between those types only to find out &#8230; <a href="http://www.workreloaded.com/2011/05/developmentprocess/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></summary>
		<content type="html" xml:base="http://www.workreloaded.com/2011/05/developmentprocess/">&lt;p&gt;Imagine a typical software development team. There are 2 types of such teams: those that are based around a single project or those around a single system. People tend to want to differentiate between those types only to find out in the end that they are remarkably similar if you zoom out far enough. Since my experience is with the latter I&amp;#8217;ll talk about that. If something does not apply to your team on first glance it just might on second glance. The similarities are enough that I think I can generalize and make my point.&lt;/p&gt;
&lt;p&gt;What then do I want to talk about? Three attributes most IT projects share are&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt; the complexity is always greater than anticipated&lt;/li&gt;
&lt;li&gt;projects tend to grow over time&lt;/li&gt;
&lt;li&gt;they are difficult to manage&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Nothing new here probably.  There are solutions that help getting a grasp on the complexity and make some parts of IT projects not easy but easier. Those things are called &amp;#8221; development processes&amp;#8221; and I have a favorite in that department which you will find out soon if you don&amp;#8217;t know already.&lt;span id="more-659"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;So imagine that team I was talking about and all the people and the &amp;#8220;stuff&amp;#8221; that is involved in it. I&amp;#8217;ll put some arbitrary numbers to it to clarify the aspects I am talking about.&lt;/p&gt;
&lt;h2&gt;the people&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;1 team leader (if you are unlucky you have a structure that gives a team different leaders with different roles)&lt;/li&gt;
&lt;li&gt;5-7 employees spread over a few offices (hopefully in the same building, sometimes however not even in the same country)&lt;/li&gt;
&lt;li&gt;3-4 freelancers or &amp;#8220;consultants&amp;#8221; (everybody is a consultant today)&lt;/li&gt;
&lt;li&gt;3 project managers for the different projects the team is currently working on&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;the &amp;#8220;stuff&amp;#8221;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt; 1-2 main systems / project&lt;/li&gt;
&lt;li&gt;5-6 subsystems / associated projects&lt;/li&gt;
&lt;li&gt;3-8 on-going development projects for the system &amp;#8211; usually at least 1 more than there are developers&lt;/li&gt;
&lt;li&gt;6-12 months of roadmap planned out in mostly less detail, just enough to build up pressure&lt;/li&gt;
&lt;li&gt;80% legacy code written by former team members&lt;/li&gt;
&lt;li&gt;5 major bugs keeping developers from the work&lt;/li&gt;
&lt;li&gt;42 minor bugs keeping developers from resting on their laurels if they ever manage to fix the major ones&lt;/li&gt;
&lt;li&gt;operating issues for the running systems&lt;/li&gt;
&lt;li&gt;at least 1 big performance problem that keeps nagging at the minds of the developers day and night&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;and last but definitely not least:&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;strong&gt;development processes &amp;lt; ε&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Sound familiar?&lt;/p&gt;
&lt;p&gt;The effects on different aspects of the development work are easily guessed:&lt;/p&gt;
&lt;h2&gt;4 Effects on Projects&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;project priorities are unclear &amp;amp; the priorities typically change often&lt;/li&gt;
&lt;li&gt;projects rarely get finished on time and sometimes never at all&lt;/li&gt;
&lt;li&gt;requirements have to be dropped&lt;/li&gt;
&lt;li&gt;more and more unfinished tasks &amp;amp; projects pool into the murky backwater of &amp;#8220;later&amp;#8221;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;4 Effects on Communication&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;meetings are taking up a lot of time and yet communication is still never enough&lt;/li&gt;
&lt;li&gt;it is hard to figure out at any one time what everyone is working on&lt;/li&gt;
&lt;li&gt;finding out the state of a project/working package is hard&lt;/li&gt;
&lt;li&gt;some tasks are done more than once while others are forgotten&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;4 Effects on Quality&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;non-functional requirements (typically those are the ones that are supposed to increase quality) get dropped&lt;/li&gt;
&lt;li&gt;technical debt accumulates and the interest to pay for that increases faster than the national debt of Greece as you just do the &amp;#8220;quick and easy&amp;#8221; solution &amp;#8211; &amp;#8220;for now&amp;#8221;&lt;/li&gt;
&lt;li&gt;there is no time to modernize the legacy code&lt;/li&gt;
&lt;li&gt;time allocated to new projects is misappropriated to finish up development of old projects&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;4 Effects on Team Members&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;the number of context switches for team members increase as projects fight for the attention of the developers&lt;/li&gt;
&lt;li&gt;time spent fixing bugs (old &amp;amp; new) increases&lt;/li&gt;
&lt;li&gt;everybody is more or less working on &amp;#8220;their&amp;#8221; stuff, so when someone is sick or on vacation (or quits) their work stalls&lt;/li&gt;
&lt;li&gt;more and more conflicts between people pop up as stress increases&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I won&amp;#8217;t even get started on technical issues like version control, release management, deployment and operating.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Things can work out for years without a process.&lt;/strong&gt; It is much easier and doesn&amp;#8217;t require any knowledge at all to &amp;#8220;just get started with the project&amp;#8221; instead of defining rules and structures how the team is supposed to work.&lt;/p&gt;
&lt;p&gt;I know a project manager who doesn&amp;#8217;t think much of development processes. He has about 30 years of experience in the job and has his own methods to get projects finished. His projects work out great because he is simply very good at what he is doing.&lt;/p&gt;
&lt;p&gt;However not every project has such a project manager all the time.  What development processes &amp;#8211; agile or not &amp;#8211; give us is a structure beyond each single project. Rules to go by, when we&amp;#8217;re not sure how to proceed. A great project manager does the same thing: he gives you rules, structures and helps with decisions. Wouldn&amp;#8217;t it be nice to be able to work in the same structured way without having to have a nanny hold your hand all the time?&lt;/p&gt;
&lt;p&gt;When the next crisis hits your team (or company) all of a sudden you may have to be more (cost-)efficient. Then the precarious balance on which an unstructured team may have built past successes can quickly turn into a messy &amp;#8220;situation&amp;#8221; that takes all the &lt;a title="Work is not supposed to be fun" href="http://www.workreloaded.com/2011/02/work-is-not-supposed-to-be-fun/"&gt;fun&lt;/a&gt; out of work.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A structured development process does not solve all problems for you.&lt;/strong&gt; No process is a magic cure-all. A process is about providing you with techniques and tools that sometimes provides you with a solution. At other times it may simply work  like an aspirin that contains the pain so you can continue working. Sometimes it is enough to realize the pain is there to be able to do something about it. So even the analysis of your situation may help provide part of the solution.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To adapt itself to a given situation is the most important attribute of any process.&lt;/strong&gt; A process that fits a team will be accepted much more readily by the team members. That is the reason why I am a fan of agile processes and especially Scrum. You may have a different impression but let me tell you Scrum is great at adapting! As a sidenote: I do believe that it is better to have any process than none so if you have an agile process: great for you! If you have any other process: still great for you!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;#8220;What is your biggest issue currently? Where is your team hurting right now?&amp;#8221;&lt;/strong&gt; Usually this is my first question when talking to anyone about processes. If you don&amp;#8217;t have a process and are thinking about introducing one then the reason for doing so probably is, that something is not working out. There is usually a very specific need to be adressed and a process should deliver some tool to help tackle that problem.&lt;/p&gt;
&lt;p&gt;So what is your biggest issue currently? What aspect of your work is in need of a reload?&lt;/p&gt;
&lt;p&gt;Why haven&amp;#8217;t you done anything about it, yet?&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/WorkReloaded/~4/olyMkxZr4b4" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.workreloaded.com/2011/05/developmentprocess/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://www.workreloaded.com/2011/05/developmentprocess/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://www.workreloaded.com/2011/05/developmentprocess/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Sonja</name>
						<uri>https://plus.google.com/10117358299211429082</uri>
					</author>
		<title type="html"><![CDATA[The Android Dropdown: Spinner]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WorkReloaded/~3/PhfPa01eAW8/" />
		<id>http://www.workreloaded.com/?p=644</id>
		<updated>2011-05-03T10:29:57Z</updated>
		<published>2011-05-03T10:27:16Z</published>
		<category scheme="http://www.workreloaded.com" term="android" />		<summary type="html"><![CDATA[I am currently working on the next release of RpgTracker and I thought I might do another tutorial since I haven&#8217;t written one in quite a while. In Android the dropdown selection widget is called Spinner. Dropdowns are used to &#8230; <a href="http://www.workreloaded.com/2011/05/the-android-dropdown-spinner/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></summary>
		<content type="html" xml:base="http://www.workreloaded.com/2011/05/the-android-dropdown-spinner/">&lt;p&gt;&lt;img class="alignleft" title="Spinner Example" src="https://lh3.googleusercontent.com/_JAwfWfO33nQ/Tb_UGLHX16I/AAAAAAAAFK4/aMwphfG6D6g/s288/spinner.jpg" alt="Dropdown and Spinner Tutorial" width="288" height="232" /&gt;I am currently working on the next release of &lt;a href="http://www.workreloaded.com/software/rpgtracker/"&gt;RpgTracker&lt;/a&gt; and I thought I might do another tutorial since I haven&amp;#8217;t written one in quite a while. &lt;/p&gt;
&lt;p&gt;In Android the dropdown selection widget is called &lt;a href="http://developer.android.com/reference/android/widget/Spinner.html"&gt;Spinner&lt;/a&gt;. Dropdowns are used to select one of a fixed set of values. They are quite helpful to improve usability of apps to make sure only the right values can be chosen.&lt;/p&gt;
&lt;p&gt;In this short tutorial you will find two examples with different applications for a spinner:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt; a spinner used as part of an activity&lt;/li&gt;
&lt;li&gt;a spinner in a dialogue&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span id="more-644"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I have taken the code samples from my own applications. If you have any questions regarding the examples please don&amp;#8217;t hesitate&lt;/p&gt;
&lt;p&gt;First there is an example from my &lt;a title="RPG Tracker" href="http://www.workreloaded.com/software/rpgtracker/"&gt;RpgTracker.&lt;/a&gt; In this example I use an Enum to represent the selected values in the activity in which the user can edit one of the objects used in the app:&lt;/p&gt;
&lt;pre class="brush: java; title: ; wrap-lines: false; notranslate"&gt;
public Enum ValueType {
        DefaultType, NotSoDefaultType, AnotherType
}

public class EditValue extends Activity implements OnItemSelectedListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        //other initialization code
        createTypeDropDown(currentType);
    }

    private void createTypeDropdown(ValueType currentType) {
        final Spinner spinner = (Spinner) findViewById(R.id.type);
        final ArrayAdapter&amp;amp;lt;CharSequence&amp;amp;gt; adapter = ArrayAdapter.createFromResource(this, R.array.type_array,
                android.R.layout.simple_spinner_item);
        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        spinner.setAdapter(adapter);
        valueType.setSelection(currentType.ordinal());
        //do not forget the listener, otherwise nothing happens:
        spinner.setOnItemSelectedListener(this);

    }

    @Override
    public void onItemSelected(AdapterView&amp;amp;lt;?&amp;amp;gt; parent, View view, int pos, long id) {
        this.type = ValueType.values()[pos];
    }

    @Override
    public void onNothingSelected(AdapterView parent) {
        this.type = ValueType.Default;
    }

}
&lt;/pre&gt;
&lt;p&gt;So this is the javacode you need to map the spinner to the Enums values. Of course you also need to specify the dropdown / spinner in your layout files and define the values that are shown.&lt;/p&gt;
&lt;p&gt;Layout:&lt;/p&gt;
&lt;pre class="brush: xml; title: ; wrap-lines: false; notranslate"&gt;
&amp;lt;TextView android:text=&amp;quot;@string/type_prompt&amp;quot;/&amp;gt;
&amp;lt;Spinner android:id=&amp;quot;@+id/type&amp;quot; android:prompt=&amp;quot;@string/type_prompt&amp;quot;/&amp;gt;&lt;/pre&gt;
&lt;p&gt;Values:&lt;/p&gt;
&lt;pre class="brush: xml; title: ; wrap-lines: false; notranslate"&gt;
&amp;lt;string-array name=&amp;quot;type_array&amp;quot;&amp;gt;
    &amp;lt;item&amp;gt;Default&amp;lt;/item&amp;gt;
    &amp;lt;item&amp;gt;Currency&amp;lt;/item&amp;gt;
    &amp;lt;item&amp;gt;Experience&amp;lt;/item&amp;gt;
&amp;lt;/string-array&amp;gt;&lt;/pre&gt;
&lt;p&gt;Don&amp;#8217;t forget to also add these two snippets to any landscape layout files or to the resources for other languages.&lt;/p&gt;
&lt;p&gt;So that&amp;#8217;s how you can create a dropdown field and map it to an Enum easily.&lt;/p&gt;
&lt;p&gt;You can also use a spinner in a dialogue. The second example is from &lt;a title="Droid Weight" href="http://www.workreloaded.com/software/droid-weight/"&gt;DroidWeight&lt;/a&gt;. I am checking the preferences to see which fields are currently tracked by the user and then offer the user a choice of one of these fields:&lt;/p&gt;
&lt;pre class="brush: java; title: ; wrap-lines: false; notranslate"&gt;
    private static AlertDialog getChoice(Context context) {
        final List&amp;lt;String&amp;gt; tracked = UserPreferences.getTrackedTypes(context);
        final String[] items = tracked.toArray(new String[0]);
        final AlertDialog.Builder builder = new AlertDialog.Builder(context);
        builder.setTitle(R.string.menu_showtype);
        builder.setSingleChoiceItems(items, -1, new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int item) {
                UserPreferences.setDisplayField(context, tracked.get(item));
                dialog.dismiss();
                }
            });
        final AlertDialog alert = builder.create();
        return alert;
    }
&lt;/pre&gt;
&lt;img src="http://feeds.feedburner.com/~r/WorkReloaded/~4/PhfPa01eAW8" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.workreloaded.com/2011/05/the-android-dropdown-spinner/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://www.workreloaded.com/2011/05/the-android-dropdown-spinner/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://www.workreloaded.com/2011/05/the-android-dropdown-spinner/</feedburner:origLink></entry>
	</feed>

