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

<channel>
	<title>dimitrivanheucke.be &#187; programming</title>
	<atom:link href="http://dimitrivanheucke.be/blog/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://dimitrivanheucke.be/blog</link>
	<description>you&#039;re gonna be remembered for the things you say and do</description>
	<lastBuildDate>Thu, 20 May 2010 12:36:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Getting ready for Android development</title>
		<link>http://dimitrivanheucke.be/blog/2009/08/getting-ready-for-android-development/</link>
		<comments>http://dimitrivanheucke.be/blog/2009/08/getting-ready-for-android-development/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 08:22:47 +0000</pubDate>
		<dc:creator>Dimitri</dc:creator>
				<category><![CDATA[mobile]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google maps]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://dimitrivanheucke.be/blog/?p=90</guid>
		<description><![CDATA[If you want to get started with Android development, you'll need to setup some things like the SDK, an IDE and a AVD. In this post I will walk you through the setup of these things, crating a test project and getting the project running on the emulator.]]></description>
			<content:encoded><![CDATA[<p>If you want to get started with Android development, you&#8217;ll need to setup some things like the SDK, an IDE and an AVD. In this post I will walk you through the setup of these things, creating a test project and getting the project running on the emulator. When you&#8217;ve done all that, you are ready for some Android development, which I will cover in future posts.</p>
<h3>Download the Android SDK</h3>
<p>First of all, you need to download the Android SDK. You can find on the <a href="http://developer.android.com/sdk/1.5_r3/index.html">Android developers site, in the SDK section</a>.  I&#8217;m using the mac x86 1.5 R3 version in this tutorial which is 175MB when writing this post.<br />
When downloaded, extract the zip file (I recommend you do this in a folder you know will never move, like /programming/sdk) and we are finished with this folder for now.</p>
<h3>Installing Ecipse and the Android Development Tools</h3>
<p>I&#8217;m using Eclipse for most of my development and it looks like google did a great job on their Android Eclipse plugin, so that&#8217;s what we&#8217;ll use for our development.</p>
<ol>
<li>In order to use this plugin, we will need Eclipse itself. <a href="http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/galileo/R/eclipse-java-galileo-macosx-cocoa.tar.gz">Download Eclipse for java developers from the Eclipse site</a>. I recommend the Cocoa version.</li>
<li>Extract the downloaded file into your /Applications folder and fire up Eclipse.app. </li>
<li>In your application menu select: Help > Install New Software &#8230;</li>
<li>Hit the Add button and give a name that makes sense (&#8220;adt&#8221; or &#8220;android development&#8221; tools for example). For location, enter https://dl-ssl.google.com/android/eclipse.<br />
<a href="http://dimitrivanheucke.be/blog/wp-content/uploads/2009/08/addsite.jpg" rel="lightbox"><img src="http://dimitrivanheucke.be/blog/wp-content/uploads/2009/08/addsite-150x150.jpg" alt="Add new plugin site" title="addsite" width="150" height="150" class="size-thumbnail wp-image-102" /></a>
</li>
<li>When you push the Ok-button, Eclipse will load the the available components. Select Developers Tools (make sure the nested components are checked as well) and hit next.<br />
<a href="http://dimitrivanheucke.be/blog/wp-content/uploads/2009/08/install.jpg" rel="lightbox"><img src="http://dimitrivanheucke.be/blog/wp-content/uploads/2009/08/install-150x150.jpg" alt="install" title="install" width="150" height="150" class="aligncenter size-thumbnail wp-image-104" /></a>
</li>
<li>You&#8217;ll be presented with an overview of installations, just click next. Then accept the license and hit finish. Eclipse will now install ADT.</li>
<li>Restart Eclipse.</li>
<li>Now we need to let ADT know where he (or she) can find our SDK. Go to your preferences (windows: window > preferences. Mac: Eclipse > preferences).</li>
<li>In the left panel, select Android (you might get a warning your SDK is not setup yet, but you can ignore that because that&#8217;s what we are doing now). Click browser and navigate to the sdk folder we extracted. This must be the root map you downloaded. The one with folders like tools and platforms in it.</li>
</ol>
<h3>Create an Android app.</h3>
<p>Now that we have everything ready to go, it&#8217;s time to see if everything is set up correctly and create our first Android app.</p>
<ol>
<li>In your menu, select: File > New > Project.</li>
<li>In the dialog that should pop up, select Android Project and hit Next.</li>
<li>Now we can set some parameters for our new project. Give a name (&#8220;HelloAndroid&#8221; for example).</li>
<li>Choose a build-target. Unless you have some specific needs, you should choose the lowest version possible. We&#8217;ll go for 1.1.</li>
<li>Give an application name. This is the human readable name for your app.</li>
<li>Give a package for your source to go. I&#8217;ll go for be.dimitrivanheucke.blog.android.helloandroid.</li>
<li>Make sure Create an activity is checked. This will create a Class for us that is our main starting point. Call it HelloAndroid</li>
<li>Your dialog box should now look something like this;<br />
<a href="http://dimitrivanheucke.be/blog/wp-content/uploads/2009/08/newandroidproject.jpg" rel="lightbox"><img src="http://dimitrivanheucke.be/blog/wp-content/uploads/2009/08/newandroidproject-150x150.jpg" alt="newandroidproject" title="newandroidproject" width="150" height="150" class="aligncenter size-thumbnail wp-image-105" /></a></li>
<li>Hit Finish and ADT will create your project</li>
</ol>
<h3>Testing your application</h3>
<p>Before we can test our application, we need to create an AVD (Android Virtual Device). This will be used to present our application in the emulator.</p>
<ol>
<li>Open your terminal and go to the tools folder inside your downloaded SDK folder.</li>
<li>To create an AVD we need to specify a target. To get a list of targets type;
<pre class="brush: bash;">
./android list targets
</pre>
<p>The outcome should look like this;</p>
<pre class="brush: bash;">
Available Android targets:
id: 1
     Name: Android 1.1
     Type: Platform
     API level: 2
     Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P
id: 2
     Name: Android 1.5
     Type: Platform
     API level: 3
     Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P
id: 3
     Name: Google APIs
     Type: Add-On
     Vendor: Google Inc.
     Description: Android + Google APIs
     Based on Android 1.5 (API level 3)
     Libraries:
      * com.google.android.maps (maps.jar)
          API for Google Maps
     Skins: HVGA (default), HVGA-L, QVGA-P, HVGA-P, QVGA-L
</pre>
</li>
<li>Now we can actually create our AVD. Type;
<pre class="brush: bash;">
./android create avd --name myavd --target 3
</pre>
<p>Of course you can change the name (myavd) in whatever you like. I used target 3 so we can use this AVD for other projects as well (for example when we integrate Google Maps).<br />
So we will have a 1.5 OS on our virtual device but we can run any application that targets that sdk version or lower.<br />
We are done with terminal now, so we can go back to Eclipse.</li>
</li>
<p>If, like me, you get some errors on your console panel at the bottom of the window looking like this;</p>
<pre class="brush: bash;">
[2009-08-12 15:02:57 - HelloAndroid] no classfiles specified
[2009-08-12 15:02:57 - HelloAndroid] Conversion to Dalvik format failed with error 1
</pre>
<p>You should go to the properties of your project (right mouse click on the project > properties), go to java build path and make sure Android 1.1 is checked in the Order and Export tab.</li>
<li>Now we are ready to test or application! Hit the run button <img src="http://dimitrivanheucke.be/blog/wp-content/uploads/2009/08/run.jpg" alt="run" title="run" width="14" height="14" style="margin: 0 0 0 0;" /> in the toolbar at the top of your window and select Android Application in the Run As dialog that pops up. After clicking Ok your emulator should load and open your application. This can take a while, your emulator first has to install your application. You might have to unlock the screen first by clicking on the menu button at the bottom of your (android) screen.</li>
</ol>
<p><a href="http://dimitrivanheucke.be/blog/wp-content/uploads/2009/08/emulator.jpg" rel="lightbox"><img src="http://dimitrivanheucke.be/blog/wp-content/uploads/2009/08/emulator-150x150.jpg" alt="emulator" title="emulator" width="150" height="150" class="aligncenter size-thumbnail wp-image-103" /></a></p>
<p>That&#8217;s all for setting up your environment and run a first test project.<br />
I&#8217;m planning on doing some more of these but haven&#8217;t decided on the topics yet. So if you want to see something in particular, let me know in the comments. For the next one I was thinking about integrating Google Maps.</p>
]]></content:encoded>
			<wfw:commentRss>http://dimitrivanheucke.be/blog/2009/08/getting-ready-for-android-development/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>ImageMagick and Ruby on OSX</title>
		<link>http://dimitrivanheucke.be/blog/2009/08/imagemagick-and-ruby-on-osx/</link>
		<comments>http://dimitrivanheucke.be/blog/2009/08/imagemagick-and-ruby-on-osx/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 09:44:10 +0000</pubDate>
		<dc:creator>Dimitri</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ImageMagick]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Paperclip]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://dimitrivanheucke.be/blog/?p=72</guid>
		<description><![CDATA[A few weeks ago we started our first commercial RoR project. For this product-catalog site we wanted an easy solution for image uploading and decided on <a href="http://www.thoughtbot.com/projects/paperclip">Paperclip</a>. This needs <a href="http://www.imagemagick.org">ImageMagick</a> and that gave us some worries.
So if you are struggling with installing ImageMagick and getting it running for Ruby, try these steps...]]></description>
			<content:encoded><![CDATA[<p>After <a href="http://arrrrcamp.be">arrrrcamp</a> a few months ago, <a href="http://www.jorendegroof.be">Joren</a> pushed me to dive into <a href="http://rubyonrails.org">Ruby on Rails</a> again.</p>
<p>A few weeks ago we started our first commercial RoR project. For this product-catalog site we wanted an easy solution for image uploading and decided on <a href="http://www.thoughtbot.com/projects/paperclip">Paperclip</a>. This needs <a href="http://www.imagemagick.org">ImageMagick</a> and that gave us some worries.<br />
So if you are struggling with installing ImageMagick and getting it running for Ruby, try these steps;</p>
<p>Download the <a href="http://www.macports.org/install.php">MacPorts dmg-installer</a>, a packetmanager for osx, and install it.<br />
When installed, fire up terminal and start typing;</p>
<pre class="brush: bash;">
sudo port install ImageMagick
</pre>
<p>This will take a while, go get yourself a coffee and when the installation is finished run the following commands</p>
<pre class="brush: bash;">
sudo port install ImageMagick
sudo gem install rmagick
</pre>
<p>That&#8217;s it, I hope you enjoyed your coffee because you can grab the <a href="http://github.com/thoughtbot/paperclip">code on github</a> and get coding now.</p>
<p>For a good introduction on how to use paperclip, there is <a href="http://railscasts.com/episodes/134-paperclip">a good railscast</a> avaiable for that!</p>
<p>Oh, the guys from <a href="http://www.openminds.be">Openminds</a> and <a href="http://www.gorilla-webdesign.be">Gorilla webdesign</a> decided arrrrcamp deserved a second edition. That is comming on October 16th, so reserve your spot at <a href="http://arrrrcamp.be/participants/new">arrrrcamp.be</a> (for free). I&#8217;d recommend not to hesitate because it looks like reservations are flying out!</p>
]]></content:encoded>
			<wfw:commentRss>http://dimitrivanheucke.be/blog/2009/08/imagemagick-and-ruby-on-osx/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
