<?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>EnvyAndroid.com &#187; Android</title>
	<atom:link href="http://envyandroid.com/archives/category/tutorials/android-tutorials/feed" rel="self" type="application/rss+xml" />
	<link>http://envyandroid.com</link>
	<description></description>
	<lastBuildDate>Sat, 10 Mar 2012 16:37:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>How to try out Android 3.0 &#8211; Honeycomb!</title>
		<link>http://envyandroid.com/archives/341/try-out-android-honeycomb</link>
		<comments>http://envyandroid.com/archives/341/try-out-android-honeycomb#comments</comments>
		<pubDate>Thu, 27 Jan 2011 12:32:26 +0000</pubDate>
		<dc:creator>EnvyAndroid</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[App Updates]]></category>
		<category><![CDATA[AVD]]></category>
		<category><![CDATA[Honeycomb]]></category>
		<category><![CDATA[SDK]]></category>

		<guid isPermaLink="false">http://envyandroid.com/?p=341</guid>
		<description><![CDATA[Earlier, I wrote a post on how you can try out the new Android Gingerbread (2.3), and now its Honeycombs turn! This process is very similar to the one regarding the Gingerbread, so I suggest you skim through that post. You can read more about whats new in Honeycom here. And here is more about&#8230;]]></description>
			<content:encoded><![CDATA[<p>Earlier, I wrote a post on how you can <a href="http://envyandroid.com/archives/118/try-out-gingerbread">try out the new Android Gingerbread (2.3)</a>, and now its Honeycombs turn!</p>
<p><strong>This process is very similar to the one regarding the Gingerbread</strong>, so I suggest you skim through that post.</p>
<p>You can read more about whats new in Honeycom <a href="http://developer.android.com/sdk/android-3.0-highlights.html">here</a>. And <a href="http://developer.android.com/sdk/preview/index.html">here</a> is more about the Honeycomb preview SDK itself.</p>
<p>First, we need to open our <strong>Android SDK and AVD manager</strong>, and install the new Honeycomb packages:</p>
<p><strong>1.</strong> Go to <em>Available packages</em> and Select <em>Android SDK Tools</em> and <em>SDK platform Android Honeycomb Preview</em>.</p>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2011/01/5.png"><img class="alignnone size-medium wp-image-346" title="SDK and AVD manager" src="http://envyandroid.com/wp/wp-content/uploads/2011/01/5-300x216.png" alt="" width="300" height="216" /></a></p>
<p><strong>2.</strong> When they are downloaded and finished installing, restart your SDK and AVD Manager.</p>
<p><strong>3.</strong> Go to <em>Available devices</em> and hit <em>New</em> to create the new AVD for Honeycomb.</p>
<p><strong>4.</strong> Give your AVD a nice name, and select Honeycomb (3.0) from the dropdown list. Hit <em>Create AVD.</em></p>
<p><strong>5.</strong> Now select your AVD, and hit <em>start.</em></p>
<p><em><a href="http://envyandroid.com/wp/wp-content/uploads/2011/01/4.png"><img class="alignnone size-medium wp-image-345" title="Our new AVD" src="http://envyandroid.com/wp/wp-content/uploads/2011/01/4-300x175.png" alt="" width="300" height="175" /></a></em></p>
<p class="errorbox">Note: It takes some time to start the AVD, and for me, it was a very slow experience navigating around, but it gives a nice introduction to honeycomb.</p>
<p>I took some screenshots from my AVD:</p>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2011/01/2.png"><img class="alignnone size-medium wp-image-343" title="2" src="http://envyandroid.com/wp/wp-content/uploads/2011/01/2-187x300.png" alt="" width="187" height="300" /></a> <a href="http://envyandroid.com/wp/wp-content/uploads/2011/01/3.png"><img class="alignnone size-medium wp-image-344" title="3" src="http://envyandroid.com/wp/wp-content/uploads/2011/01/3-188x300.png" alt="" width="188" height="300" /></a> <a href="http://envyandroid.com/wp/wp-content/uploads/2011/01/1.png"><img class="alignnone size-medium wp-image-342" title="1" src="http://envyandroid.com/wp/wp-content/uploads/2011/01/1-188x300.png" alt="" width="188" height="300" /></a></p>
<p class="errorbox">Note: If you are using Eclipse, there is also a <a href="http://developer.android.com/sdk/eclipse-adt.html">new update </a>to the Eclipse ADT (version 9.0.0), so you should update. It seems they have <a href="http://envyandroid.com/archives/195/formatting-android-xml-eclipse">fixed the XML formatting</a>.</p>
<p><em>My AVD device started up in a horizontal orientation, if yours do that too, you can <a href="http://envyandroid.com/archives/353/android-emulator-tips-and-tricks">easily change the orientation</a> of your Emulated device.</em></p>
<p><em>Please share this article.</em></p>
 <img src="http://envyandroid.com/wp/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=341" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://envyandroid.com/archives/341/try-out-android-honeycomb/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to change the icon of your Android app</title>
		<link>http://envyandroid.com/archives/301/change-the-android-app-icon</link>
		<comments>http://envyandroid.com/archives/301/change-the-android-app-icon#comments</comments>
		<pubDate>Sun, 26 Dec 2010 17:14:35 +0000</pubDate>
		<dc:creator>EnvyAndroid</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Android Development]]></category>
		<category><![CDATA[AndroidManifest]]></category>
		<category><![CDATA[Apps]]></category>
		<category><![CDATA[Drawable]]></category>
		<category><![CDATA[Icon]]></category>

		<guid isPermaLink="false">http://envyandroid.com/?p=301</guid>
		<description><![CDATA[This is just a small follow-up post to The easiest way to create nice icons for Android apps. Say, if you follow that guide, and have made an icon to represent your app, how do you use it? If you have one icon image, or three icon images (one for each screen density, ldpi, mdpi&#8230;]]></description>
			<content:encoded><![CDATA[<p>This is just a small follow-up post to <a href="http://envyandroid.com/archives/271/easiest-way-to-create-android-icons">The easiest way to create nice icons for Android apps</a>.</p>
<p>Say, if you follow that guide, and have made an icon to represent your app, how do you use it?</p>
<p>If you have one icon image, or three icon images (one for each screen density, ldpi, mdpi and hdpi, like in the guide), you put your icon files in the res/drawable folder where they belong.</p>
<p>Depending on what API level you are creating your Android application for, in your &#8220;res&#8221; folder you either have one folder called &#8220;drawable&#8221; or three folders called &#8220;drawable-ldpi&#8221;, &#8220;drawable-mdpi&#8221; and &#8220;drawable-hdpi&#8221;.</p>
<p>For application launcher icons, the sizes are:</p>
<ul>
<li>Low density – ldpi – <strong>36×36</strong> px</li>
<li>Medium density – mdpi – <strong>48×48</strong> px</li>
<li>High density – hdpi – <strong>72×72</strong> px</li>
</ul>
<p>When you have put your icon in the folder/folders, open up your AndroidManifest.xml file and choose to view it as XML.</p>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2010/12/AndroidManifest-xml-view.png"><img class="alignnone size-medium wp-image-302" title="AndroidManifest-xml-view" src="http://envyandroid.com/wp/wp-content/uploads/2010/12/AndroidManifest-xml-view-300x54.png" alt="" width="300" height="54" /></a></p>
<p>For a new Android application, the AndroidManifest.xml file will look like this:</p>
<pre class="brush: xml; title: ; notranslate">

&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      package=&quot;test.application&quot;
      android:versionCode=&quot;1&quot;
      android:versionName=&quot;1.0&quot;&gt;
    &lt;application android:icon=&quot;@drawable/icon&quot; android:label=&quot;@string/app_name&quot;&gt;
        &lt;activity android:name=&quot;.YourAppName&quot;
                  android:label=&quot;@string/app_name&quot;&gt;
            &lt;intent-filter&gt;
                &lt;action android:name=&quot;android.intent.action.MAIN&quot; /&gt;
                &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&gt;
            &lt;/intent-filter&gt;
        &lt;/activity&gt;
    &lt;/application&gt;
&lt;/manifest&gt;
</pre>
<p>And on line 6 you can see the attribute that specifies your applications icon:</p>
<pre class="brush: plain; title: ; notranslate">
android:icon=&quot;@drawable/icon&quot;
</pre>
<p>The /icon refers to the default <em>icon.png</em> file in your drawable folder (or the drawable-ldpi/mdpi/hdpi folders).</p>
<p>If substitute &#8220;icon&#8221; with the name of your icon file, you will change the icon of your app.</p>
 <img src="http://envyandroid.com/wp/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=301" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://envyandroid.com/archives/301/change-the-android-app-icon/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The easiest way to create nice icons for Android apps</title>
		<link>http://envyandroid.com/archives/271/easiest-way-to-create-android-icons</link>
		<comments>http://envyandroid.com/archives/271/easiest-way-to-create-android-icons#comments</comments>
		<pubDate>Sun, 26 Dec 2010 01:50:40 +0000</pubDate>
		<dc:creator>EnvyAndroid</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Android Development]]></category>
		<category><![CDATA[Drawable]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Icon]]></category>
		<category><![CDATA[Inkscape]]></category>
		<category><![CDATA[Layout]]></category>
		<category><![CDATA[Menus]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://envyandroid.com/?p=271</guid>
		<description><![CDATA[In this article I will show you a very easy way to create nice looking icon drawables you can use in your Android applications. Using this method we can easily skip through the difficult and time-consuming parts of creating icons. Yes, I know this method does not work for everyone, some Android developers have their&#8230;]]></description>
			<content:encoded><![CDATA[<p>In this article I will show you a very easy way to create nice looking icon drawables you can use in your Android applications.</p>
<p>Using this method we can easily skip through the difficult and time-consuming parts of creating icons.</p>
<p>Yes, I know this method does not work for everyone, some Android developers have their own designer and so on, but for a small and simple app, this will definateley do!</p>
<div id='toc' class='post-271'><div id='toc_title'>Table of contents</div>
<ul><li><a href="#The-problem">The problem</a></li>
<li><a href="#The-solution">The solution</a></li>
<li><a href="#1-Creating-a-menu-icon-in-Inkscape">1. Creating a menu icon in Inkscape</a></li>
<li><a href="#2-Using-the-AssetStudio">2. Using the Asset-Studio</a></li>
<li><a href="#3-Getting-the-icon-into-your-Eclipse-Android-project">3. Getting the icon into your Eclipse Android project</a></li>
<li><a href="#4-Using-the-icon-in-my-Android-app">4. Using the icon in my Android app</a></li>
</ul>
</div>
<h2 id='The-problem'>The problem</h2>
<p>Creating icons for Android apps may sound simple, but in fact, it is not as easy as it sounds&#8230;</p>
<p>There are a number of different icon <a href="http://developer.android.com/guide/practices/ui_guidelines/icon_design.html">categories</a>, here are a couple of them:</p>
<ul>
<li>Launcher icons &#8211; The applications main icon</li>
<li><strong>Menu icons</strong> &#8211; The icons on the menu you get when pressing the menu button on your device</li>
<li>Tab icons &#8211; Icons on tabs</li>
<li>Status bar notification icons &#8211; Icons for your apps notifications</li>
</ul>
<p>When creating icons for Android, you should create icons for different screen densities:</p>
<ul>
<li>Low density &#8211; ldpi &#8211; <strong>36&#215;36</strong> px</li>
<li>Medium density &#8211; mdpi &#8211; <strong>48&#215;48</strong> px</li>
<li>High density &#8211; hdpi &#8211; <strong>72&#215;72</strong> px</li>
</ul>
<p>(You can read more about the different icon dimensions <a href="http://developer.android.com/guide/practices/ui_guidelines/icon_design.html#icon-sets">here</a>. Note: The dimensions in bold above, are for menu icons)</p>
<p><strong>The Problem:</strong> Creating all those different icon types in several densities, with the right gradient color, shadow, borders, selected/unselected state etc, can be a time-consuming and irritating process.</p>
<p>We would like to save us some time!</p>
<p><span id="more-271"></span></p>
<h2 id='The-solution'>The solution</h2>
<p>So if you just need a basic icon, heres a much simpler way using the <a href="http://android-ui-utils.googlecode.com/hg/asset-studio/dist/index.html">Asset-Studio</a>, which is part of the <a href="http://code.google.com/p/android-ui-utils/">android-ui-utils</a>, which aims at helping developers with Android apps UI. Chrome is the recommended browser to use on the Asset-Studio site.</p>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2010/12/icons-asset-studio-home.png"><img class="alignnone size-medium wp-image-276" title="icons-asset-studio-home" src="http://envyandroid.com/wp/wp-content/uploads/2010/12/icons-asset-studio-home-300x144.png" alt="" width="300" height="144" /></a></p>
<p>This method also uses free tools, so you don&#8217;t need Illustrator.</p>
<p>The basic procedure to create an icon is:</p>
<ol>
<li>Use <a href="www.inkscape.org/ ">Inkscape</a> (<a href="http://wiki.inkscape.org/wiki/index.php/FAQ#What_License_is_Inkscape_released_under.3F">GPL</a> license) to create your basic icon shape, then export it</li>
<li>Upload your icon to the Asset-Studio website and make adjustments if needed</li>
<li>Download zip of finished resources from the website</li>
<li>Copy paste into Eclipse project folder</li>
</ol>
<p>You can then use your icon in XML or Java code as usual, enjoy your new icons!</p>
<p>Here is an example of how to create a menu icon using the four steps above:</p>
<h2 id='1-Creating-a-menu-icon-in-Inkscape'>1. Creating a menu icon in Inkscape</h2>
<ol>
<li>I assume you already have Inkscape up and running</li>
<li>Create a new empty document</li>
<li>Go to File -&gt; Document Properties, set the Document Width and Height to 72 px, then close the Document properties window. You now have a quadratic starting point, as big as the High density image needs to be, this way we avoid scaling the image up<a href="http://envyandroid.com/wp/wp-content/uploads/2010/12/icons-properties.png"><img class="alignnone size-medium wp-image-280" title="icons-properties" src="http://envyandroid.com/wp/wp-content/uploads/2010/12/icons-properties-254x300.png" alt="" width="254" height="300" /></a></li>
<li>Create your awesome icon, stay inside the frame, try to make it smooth, not to many hard corners. I have not used Inkscape before, so I just made some basic shapes and used <em>Path -&gt; Difference</em> to get my icon:
<div id="attachment_281" class="wp-caption alignnone" style="width: 290px"><a href="http://envyandroid.com/wp/wp-content/uploads/2010/12/icons-the-icon.png"><img class="size-medium wp-image-281" title="icons-the-icon" src="http://envyandroid.com/wp/wp-content/uploads/2010/12/icons-the-icon-280x300.png" alt="" width="280" height="300" /></a><p class="wp-caption-text">Nice huh?</p></div>
<p><em> </em></li>
<li>In Inkscape go to <em>File -&gt; Export Bitmap</em>, and select &#8220;Page&#8221;, it should look like this:</li>
</ol>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2010/12/icons-export.png"><img class="alignnone size-medium wp-image-278" title="icons-export" src="http://envyandroid.com/wp/wp-content/uploads/2010/12/icons-export-265x300.png" alt="" width="265" height="300" /></a></p>
<p>You now have a .png file ready to upload to the website.</p>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2010/12/star.png"><img class="alignnone size-full wp-image-282" title="star" src="http://envyandroid.com/wp/wp-content/uploads/2010/12/star.png" alt="" width="75" height="75" /></a></p>
<p>You can download (Right click -&gt; Save as) and use my star icon freely if you want to.</p>
<h2 id='2-Using-the-AssetStudio'>2. Using the Asset-Studio</h2>
<ol>
<li>Go to the <a href="http://android-ui-utils.googlecode.com/hg/asset-studio/dist/index.html">Asset-studio website</a>, select <strong>Menu icons</strong></li>
<li>For the source: Click on the <strong>Image</strong> button to browse and upload your icon file (.png) (supported images are jpg, gif, png, svg and a couple others, only the png file worked for me)</li>
<li>Set the trim and padding to what you see fit in the frame</li>
<li>Give your new resource a name in the &#8220;Icon name&#8221; field</li>
<li>Select <strong>Download zip</strong> on the bottom of the page</li>
</ol>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2010/12/icons-asset-studio.png"><img class="alignnone size-medium wp-image-275" title="icons-asset-studio" src="http://envyandroid.com/wp/wp-content/uploads/2010/12/icons-asset-studio-300x278.png" alt="" width="300" height="278" /></a></p>
<h2 id='3-Getting-the-icon-into-your-Eclipse-Android-project'>3. Getting the icon into your Eclipse Android project</h2>
<ol>
<li>The downloaded zip with the name <strong>ic_menu_star.zip</strong> (your name may differ), contains a res folder, with three folders: <strong>drawable-ldpi</strong>, <strong>drawable-mdpi </strong>and <strong>drawable-hdpi</strong>, including the icons in different densities, with gradients, shadows and everything in place (magic!).</li>
<li>Just copy the icon from the res/drawable-hdpi in the downloaded zip, into the res/drawable-hdpi folder in your Eclipse Android project, and do the same with the mdpi and ldpi icons</li>
</ol>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2010/12/icons-drawables-ny.png"><img class="alignnone size-full wp-image-290" title="icons-drawables-ny" src="http://envyandroid.com/wp/wp-content/uploads/2010/12/icons-drawables-ny.png" alt="" width="210" height="192" /></a></p>
<h2 id='4-Using-the-icon-in-my-Android-app'>4. Using the icon in my Android app</h2>
<p>The simplest usage example of a menu with 2 items:</p>
<pre class="brush: java; title: ; notranslate">

package test.layout;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

public class LayoutTest extends Activity {

	private final int MENU_STARS = 1;
	private final int MENU_REFRESH = 2;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
    public boolean onCreateOptionsMenu(Menu menu){
    	boolean result = super.onCreateOptionsMenu(menu);
        menu.add(0, MENU_STARS, 0, &quot;Stars&quot;).setIcon(R.drawable.ic_menu_star);
        menu.add(0, MENU_REFRESH, 0, &quot;Refresh&quot;).setIcon(R.drawable.icon);
    	return result;
    }

    /* Handle the menu selection */
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
        case MENU_STARS:
            showFavourites();
            return true;
        case MENU_REFRESH:
            refreshData();
            return true;
        }
        return false;
    }
    public void showFavourites(){
    	//your code here
    }
    public void refreshData(){
    	//your code here
    }
}
</pre>
<p>This code uses the icon we created above and put into the drawable folders, and the default icon that comes with every new Android project, just for demonstration, also located in the drawables folders.</p>
<p>The applications menu will look like this:</p>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2010/12/icons-menu.png"><img class="alignnone size-full wp-image-279" title="icons-menu" src="http://envyandroid.com/wp/wp-content/uploads/2010/12/icons-menu.png" alt="" width="346" height="97" /></a></p>
<p><strong>Code explanation:</strong></p>
<ol>
<li>Implement <strong>onCreateOptionsMenu</strong>, which creates the menu when a user presses the menu button on his device</li>
<li>Implement <strong>onOptionsItemSelected</strong>, which takes care of the logic when a user presses one of the menu items</li>
<li>The final variables are each used to represent a menu item, and gives a human readable name to each of them</li>
<li>The two last methods are executed when a user presses the respective menu item</li>
</ol>
<p>Similar steps can also be used to create <strong>Launcher icons, Menu icons, Tab icons</strong> and <strong>Notification icons</strong> via the Asset-Studio website. And you can read up on how to create the different types of menus <a href="Launcher icons  Menu icons  Tab icons  Notification icons">here</a>.</p>
<p>I hope this helped many people save a good amount of time and frustration! <img src='http://envyandroid.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><em>Please share this article. </em></p>
 <img src="http://envyandroid.com/wp/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=271" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://envyandroid.com/archives/271/easiest-way-to-create-android-icons/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to create Gradient Lines with Drawables in Android</title>
		<link>http://envyandroid.com/archives/242/drawable-gradient-lines-android</link>
		<comments>http://envyandroid.com/archives/242/drawable-gradient-lines-android#comments</comments>
		<pubDate>Tue, 21 Dec 2010 19:40:49 +0000</pubDate>
		<dc:creator>EnvyAndroid</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Android Development]]></category>
		<category><![CDATA[Drawable]]></category>
		<category><![CDATA[Layout]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://envyandroid.com/?p=242</guid>
		<description><![CDATA[This article will show you how to create simple gradient line separators to spice up the layout a little bit. We are going to create gradients like these: About Drawables First off, we are going to create a drawable. A drawable resource is graphics that can be drawn on the screen, it can be a&#8230;]]></description>
			<content:encoded><![CDATA[<p>This article will show you how to create simple gradient line separators to spice up the layout a little bit.</p>
<p>We are going to create gradients like these:</p>
<div id="attachment_245" class="wp-caption alignnone" style="width: 478px"><a href="http://envyandroid.com/wp/wp-content/uploads/2010/12/gradient-example-result.png"><img class="size-full wp-image-245" title="gradient-example-result" src="http://envyandroid.com/wp/wp-content/uploads/2010/12/gradient-example-result.png" alt="" width="468" height="197" /></a><p class="wp-caption-text">Nice green gradient lines...</p></div>
<h2>About Drawables</h2>
<p>First off, we are going to create a <a href="http://developer.android.com/reference/android/graphics/drawable/Drawable.html">drawable</a>. A drawable resource is graphics that can be drawn on the screen,<br />
it can be a couple of different things, here are some examples;</p>
<ul>
<li>Bitmaps &#8211; png, jpg or gif images</li>
<li>Nine-Patch image &#8211; A png that can be stretched, to create buttons of varying sizes for example</li>
<li>State List &#8211; Making it easier to use different images for button states for example (focused, pressed)</li>
<li><span style="text-decoration: underline;">Shape Drawable</span></li>
</ul>
<p><span id="more-242"></span></p>
<p>You can read more about drawable resources <a href="http://developer.android.com/guide/topics/resources/drawable-resource.html">here</a>.</p>
<h2>Creating a Gradient Shape Drawable</h2>
<p>In this example we are going to use the Shape Drawable, with it, we can create <a href="http://developer.android.com/reference/android/graphics/drawable/shapes/package-summary.html">different shapes</a>, we will use a Rectangle shape.</p>
<p>Create a new .xml file in your <strong>drawable</strong> folder (or drawable-mdpi folder) called <strong>gradient.xml</strong>, with the following code:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;shape
	xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
	android:shape=&quot;rectangle&quot;&gt;
	&lt;gradient
		android:angle=&quot;0&quot;
		android:startColor=&quot;#000000&quot;
		android:endColor=&quot;#000000&quot;
		android:centerColor=&quot;#97CF4D&quot; /&gt;
&lt;/shape&gt;
</pre>
<p>And that is basically it. You now have a gradient ready to use.</p>
<h2>How to use our Gradient Shape Drawable file</h2>
<p>In your layout file (main.xml for example), enter the following code:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;LinearLayout
	xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
	android:id=&quot;@+id/LinearLayout01&quot;
	android:orientation=&quot;vertical&quot;
	android:layout_width=&quot;fill_parent&quot;
	android:layout_height=&quot;fill_parent&quot;
	android:padding=&quot;10dp&quot;&gt;

	&lt;Button
		android:text=&quot;Button&quot;
		android:id=&quot;@+id/Button01&quot;
		android:layout_width=&quot;wrap_content&quot;
		android:layout_height=&quot;wrap_content&quot;&gt;&lt;/Button&gt;
	&lt;View
		android:layout_width=&quot;wrap_content&quot;
		android:background=&quot;@drawable/gradient&quot;
		android:layout_height=&quot;1dp&quot;&gt;&lt;/View&gt;
	&lt;CheckBox
		android:text=&quot;CheckBox&quot;
		android:id=&quot;@+id/CheckBox01&quot;
		android:layout_width=&quot;wrap_content&quot;
		android:layout_height=&quot;wrap_content&quot;&gt;&lt;/CheckBox&gt;
	&lt;View
		android:layout_width=&quot;wrap_content&quot;
		android:background=&quot;@drawable/gradient&quot;
		android:layout_height=&quot;1dp&quot;&gt;&lt;/View&gt;
&lt;/LinearLayout&gt;
</pre>
<p>If you look at the View widget on line 15-18 and 24-27, that is how we use our gradient drawable.</p>
<p>The <strong>android:background=&#8221;@drawable/gradient&#8221;</strong> uses our newly created <strong>gradient.xml</strong> file in the <strong>drawable</strong> folder (or drawable-mdpi folder), and the result you can see on the first image!</p>
<p><em>Please share this article.</em></p>
 <img src="http://envyandroid.com/wp/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=242" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://envyandroid.com/archives/242/drawable-gradient-lines-android/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Stretching and Spanning layouts in Android</title>
		<link>http://envyandroid.com/archives/227/stretching-and-spanning-layouts</link>
		<comments>http://envyandroid.com/archives/227/stretching-and-spanning-layouts#comments</comments>
		<pubDate>Mon, 20 Dec 2010 21:21:41 +0000</pubDate>
		<dc:creator>EnvyAndroid</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Android Development]]></category>
		<category><![CDATA[Layout]]></category>
		<category><![CDATA[Tables]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://envyandroid.com/?p=227</guid>
		<description><![CDATA[When I was working on my BF2Stats Android app, I had to find out how to place 2 widgets/layout elements on the same horizontal line, while keeping them stretched at the same time so they are filling the width of the screen. It took me a little research before I found a solution, so I&#8230;]]></description>
			<content:encoded><![CDATA[<p>When I was working on my <a href="http://envyandroid.com/archives/103/bf2stats2-released">BF2Stats</a> Android app, I had to find out how to place 2 widgets/layout elements on the same horizontal line, while keeping them stretched at the same time so they are filling the width of the screen.</p>
<p>It took me a little research before I found a solution, so I will share two methods with you today.</p>
<p>This tutorial will show you how to create layouts that stretches in the width.</p>
<p>In Eclipse I create a new Android Project by going to <em>File -&gt; New  -&gt; Other -&gt; Android -&gt; Android Project</em>. The default project just using the <em>main.xml</em> file for these example layouts will do just fine.</p>
<p>We can create a stretching layout with two different methods; <strong>Layout Weights</strong> and <strong>Layout Spans,</strong> I will show a simple example of both, and then I will show how to center an element in a TableLayout with Layout Spans.</p>
<p><span id="more-227"></span></p>
<h2>Stretching layout using Layout Weights</h2>
<p><strong>About Layout Weights</strong></p>
<p>Simply put, layout weights are a way of defining how much of the layout space a widget element will take.</p>
<p>It can be thought of as a percentage of layout space, but it is written 0.2 instead of 20%. So if you want to give an element a size of <span style="text-decoration: underline;">roughly</span> 20%, you set <strong>android:layout_weight=&#8221;0.2&#8243;</strong> for that element. (These percentages/weights are <span style="text-decoration: underline;">not exact</span> values, a layout_weight of 0.1 may on your phone turn out to look more like 0.05 or 0.15)</p>
<p><strong>Creating a simple layout with one EditText and one Button</strong></p>
<p>The following code (<a href="http://envyandroid.com/dl/1" title="Downloaded 136 times">download</a>) will give a simple layout using <a href="http://developer.android.com/reference/android/widget/LinearLayout.html">LinearLayout</a>, and stretch both the <a href="http://developer.android.com/reference/android/widget/EditText.html">EditText</a> and the <a href="http://developer.android.com/reference/android/widget/Button.html">Button</a> to fill the width.</p>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2010/12/weight-layout-xml.png"><img class="alignnone size-medium wp-image-233" title="weight-layout-xml" src="http://envyandroid.com/wp/wp-content/uploads/2010/12/weight-layout-xml-300x261.png" alt="" width="300" height="261" /></a></p>
<p>If you replace your main.xml files content with that code, save, and run it, the layout will look like this on your virtual device:</p>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2010/12/weight-layout-result.png"><img class="alignnone size-medium wp-image-232" title="weight-layout-result" src="http://envyandroid.com/wp/wp-content/uploads/2010/12/weight-layout-result-300x124.png" alt="" width="300" height="124" /></a></p>
<h2>Stretching layout using Layout Spans</h2>
<p>In this example we are going to use a <a href="http://developer.android.com/reference/android/widget/TableLayout.html">TableLayout</a> with one <a href="http://developer.android.com/reference/android/widget/TableRow.html">TableRow</a> containing one EditText and a Button.</p>
<p>The amount of space given to each element, is specified in the <a href="http://developer.android.com/reference/android/widget/TableRow.LayoutParams.html#attr_android:layout_span">android:layout_span</a> attribute, which tells us how many columns it will span over.</p>
<p>The example code (<a href="http://envyandroid.com/dl/2" title="Downloaded 129 times">download</a>) looks like this:</p>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2010/12/table-span-xml.png"><img class="alignnone size-medium wp-image-230" title="table-span-xml" src="http://envyandroid.com/wp/wp-content/uploads/2010/12/table-span-xml-300x225.png" alt="" width="300" height="225" /></a></p>
<ul>
<li>The <a title="Read more about this" href="http://developer.android.com/reference/android/widget/TableLayout.html#attr_android:stretchColumns">asterix (*)</a> on line number 6 says that all columns should be stretched</li>
<li>We see on line 14 that the EditText has a layout span of 4 columns</li>
<li>On line 21 we see that the Button has layout span of 1 column</li>
<li>In total that is 5 columns in our TableLayout.</li>
</ul>
<p>1/5 is 0.2, so the Button should take about 20% of the space, as we can see in the picture below:</p>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2010/12/table-span-result.png"><img class="alignnone size-medium wp-image-228" title="table-span-result" src="http://envyandroid.com/wp/wp-content/uploads/2010/12/table-span-result-300x129.png" alt="" width="300" height="129" /></a></p>
<h2>How to center an element in a TableLayout</h2>
<p>This is another example using Layout Spans and TableLayout. It just demonstrates how you could place elements with the use of the <strong>android:layout_span</strong> attribute. It also shows how to centre elements in a table, which is very handy.</p>
<p>The code (<a href="http://envyandroid.com/dl/3" title="Downloaded 142 times">download</a>) looks like this:</p>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2010/12/table-span-xml2.png"><img class="alignnone size-medium wp-image-231" title="table-span-xml2" src="http://envyandroid.com/wp/wp-content/uploads/2010/12/table-span-xml2-276x300.png" alt="" width="276" height="300" /></a></p>
<p>And the resulting layout looks like this:</p>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2010/12/table-span-result2.png"><img class="alignnone size-medium wp-image-229" title="table-span-result2" src="http://envyandroid.com/wp/wp-content/uploads/2010/12/table-span-result2-300x62.png" alt="" width="300" height="62" /></a></p>
<p><strong>Explanation:</strong></p>
<ul>
<li>The Heading spans over 3 columns, and is <strong>centered</strong> over these columns by the gravity attribute</li>
<li>Text 1,2 and 3 span over one column each</li>
<li>Text 4 span over 2 columns, while Text 5 gets the rest, which is 1 column.</li>
<li>On line 6, the asterix (*) says all columns are set to stretch.</li>
</ul>
<p><em>Please share this article.</em></p>
 <img src="http://envyandroid.com/wp/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=227" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://envyandroid.com/archives/227/stretching-and-spanning-layouts/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to try out the new Android 2.3 – Gingerbread!</title>
		<link>http://envyandroid.com/archives/118/try-out-gingerbread</link>
		<comments>http://envyandroid.com/archives/118/try-out-gingerbread#comments</comments>
		<pubDate>Mon, 06 Dec 2010 21:17:19 +0000</pubDate>
		<dc:creator>EnvyAndroid</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ADT]]></category>
		<category><![CDATA[Android Development]]></category>
		<category><![CDATA[AVD]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Gingerbread]]></category>
		<category><![CDATA[Nexus S]]></category>
		<category><![CDATA[SDK]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://envyandroid.com/?p=118</guid>
		<description><![CDATA[Table of contents Updating Eclipse ADT Installing Android SDK updates Creating the AVD As Google just recently announced the Nexus S from Samsung, which is running the new Android 2.3, known as Gingerbread, I wanted to have a look at the new OS for myself. Gingerbread comes with lots of new nice features and improvements,&#8230;]]></description>
			<content:encoded><![CDATA[<div id='toc' class='post-118'><div id='toc_title'>Table of contents</div>
<ul><li><a href="#Updating-Eclipse-ADT">Updating Eclipse ADT</a></li>
<li><a href="#Installing-Android-SDK-updates">Installing Android SDK updates</a></li>
<li><a href="#Creating-the-AVD">Creating the AVD</a></li>
</ul>
</div>
As Google just recently announced the <a href="http://www.google.com/nexus/#!/features">Nexus S</a> from Samsung, which is running the new Android 2.3, known as Gingerbread, I wanted to have a look at the new OS for myself.</p>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2010/12/nexus-s.png"><img class="size-medium wp-image-132 alignright" title="nexus-s" src="http://envyandroid.com/wp/wp-content/uploads/2010/12/nexus-s-153x300.png" alt="" width="153" height="300" /></a></p>
<p>Gingerbread comes with lots of new nice features and improvements, you can read about them <a href="http://developer.android.com/sdk/android-2.3-highlights.html">here</a>. Or you can watch the official video, to get a quick overview:</p>
<p>Altough testing the OS in an AVD, does not compare to the real device in terms of speed and awesomeness, It is the closest you can get right now.</p>
<p>Getting Android 2.3 up and running on your computer is an easy task, I previously created a very simple-to-follow tutorial how to <a href="http://envyandroid.com/archives/38">get started with Android development</a>. Installing Android 2.3 is much the same thing, so I assume you are coming from that guide, or already has a development environment set up.</p>
<p><strong>Here is what we need to do:</strong></p>
<ul>
<li>We must first update our Eclipse <a href="http://developer.android.com/sdk/eclipse-adt.html#updating">ADT</a>.</li>
<li>Then we must install <a href="http://developer.android.com/sdk/tools-notes.html">SDK</a> updates in our SDK and AVD manager.</li>
<li>We then create a new AVD with Android 2.3, and run it.</li>
</ul>
<p><span id="more-118"></span></p>
<p>If you dont have ADT or a development environment set up yet, you can follow the <a href="http://envyandroid.com/archives/38">tutorial</a> I wrote earlier.</p>
<h2 id='Updating-Eclipse-ADT'>Updating Eclipse ADT</h2>
<p>To update our development tools, go to <em>Help </em>-&gt; <em>Check for updates</em> in the Eclipse menu.</p>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2010/12/eclipse-updates.jpg"><img class="size-medium wp-image-120 alignnone" title="eclipse-updates" src="http://envyandroid.com/wp/wp-content/uploads/2010/12/eclipse-updates-300x283.jpg" alt="" width="300" height="283" /></a></p>
<div id="_mcePaste">Select the <em>Android DDMS</em> and <em>Development tools</em> updates and click next,</div>
<div id="_mcePaste">on the &#8220;review and confirm updates&#8221; page, click <em>finish</em></div>
<div id="_mcePaste">When it asks if you want to &#8220;restart now?&#8221; click <em>yes.</em></div>
<div>And that is it, ADT should now be up to date.</div>
<h2 id='Installing-Android-SDK-updates'>Installing Android SDK updates</h2>
<p>Go to the SDK and AVD manager in Eclipse: <a href="http://envyandroid.com/wp/wp-content/uploads/2010/11/sdk-avd-manager.png"><img class="alignnone size-full wp-image-192" title="sdk-avd-manager" src="http://envyandroid.com/wp/wp-content/uploads/2010/11/sdk-avd-manager.png" alt="" width="21" height="21" /></p>
<p></a></p>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2010/12/avd-select-updates.jpg"><img class="size-medium wp-image-119 alignnone" title="avd-select-updates" src="http://envyandroid.com/wp/wp-content/uploads/2010/12/avd-select-updates-300x183.jpg" alt="" width="300" height="183" /></a></p>
<p>Click the <em>Install selected</em> button, to install the updates for Android 2.3 (API 9), (see the image).</p>
<p>On the next screen, select <em>accept all.</em></p>
<p>When installation is finished select restart adb, when that says <em>Done</em> click <em>close.</em></p>
<p><strong>Verify:</strong> To verify that the AVD indeed has been installed (at first, It wouldn&#8217;t install when I tried):</p>
<p>Check the <em>installed packages </em>menu in the <em>AVD manager</em>, hit refresh, and see in Android 2.3 (API 9) is installed.</p>
<p>If it is not, go back to &#8220;Available packages&#8221; and hit refresh, select and install Android 2.3 (API 9) again.</p>
<div>If you see the &#8220;Android tools updated&#8221; message below, hit ok, and close the <em>SDK and AVD manager</em> and restart Eclipse.</div>
<div><a href="http://envyandroid.com/wp/wp-content/uploads/2010/12/mld.jpg"><img class="size-medium wp-image-124 alignnone" title="mld" src="http://envyandroid.com/wp/wp-content/uploads/2010/12/mld-300x183.jpg" alt="" width="300" height="183" /></a></div>
<div>When i started Eclipse again, I got the message &#8221;The location of android SDK has not been set in preferences&#8221;</div>
<div>but I checked, and it was there, just like before.</div>
<h2 id='Creating-the-AVD'>Creating the AVD</h2>
<div>Just like in the first tutorial, we need to create a new ADT (Android &#8220;emulator&#8221;) with Gingerbread.</div>
<div>
<div>So, open the AVD manager, select V<em>irtual devices</em> and <em>New&#8230;</em></div>
<div>Give your Android 2.3 device a suitable name, resolution, SDCard space, and then hit &#8220;Create AVD&#8221;.</div>
<div><a href="http://envyandroid.com/wp/wp-content/uploads/2010/12/new-avd.jpg"><img class="alignnone size-medium wp-image-125" title="new-avd" src="http://envyandroid.com/wp/wp-content/uploads/2010/12/new-avd-216x300.jpg" alt="" width="216" height="300" /></a></div>
<div>It then gets added to the AVD list, select it in the list, and hit <em>Start </em>and then <em>Launch.</em></div>
<div>After a long time of loading, the AVD is up, and you can go mad and test Gingerbread already!</div>
<div><a href="http://envyandroid.com/wp/wp-content/uploads/2010/12/gingeremu.jpg"><img class="alignnone size-medium wp-image-122" title="gingeremu" src="http://envyandroid.com/wp/wp-content/uploads/2010/12/gingeremu-300x212.jpg" alt="" width="300" height="212" /></a></div>
<div><em>Note: The Gingerbread AVD seems to be quite slow, even slower than a Froyo AVD.</em></div>
<div><em><br />
</em></div>
</div>
 <img src="http://envyandroid.com/wp/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=118" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://envyandroid.com/archives/118/try-out-gingerbread/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Getting Started With Android – Setting Up The Development Environment</title>
		<link>http://envyandroid.com/archives/38/getting-started-with-android-dev-environment</link>
		<comments>http://envyandroid.com/archives/38/getting-started-with-android-dev-environment#comments</comments>
		<pubDate>Fri, 26 Nov 2010 15:54:30 +0000</pubDate>
		<dc:creator>EnvyAndroid</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ADT]]></category>
		<category><![CDATA[Android Development]]></category>
		<category><![CDATA[AVD]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[SDK]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://envyandroid.com/?p=38</guid>
		<description><![CDATA[Table of contents Downloading tools Installing the tools Java Android SDK Eclipse Android Development Tools (ADT) Configuring Configuring the ADT plug-in Installing an Android Virtual Device Final words&#8230; This is a walkthrough on how to get started developing android applications in windows with Eclipse. I will be using Windows 7 but the steps are similar&#8230;]]></description>
			<content:encoded><![CDATA[<div id='toc' class='post-38'><div id='toc_title'>Table of contents</div>
<ul><li><a href="#Downloading-tools">Downloading tools</a></li>
<li><a href="#Installing-the-tools">Installing the tools</a>
<ul><li><a href="#Java">Java</a></li>
<li><a href="#Android-SDK">Android SDK</a></li>
<li><a href="#Eclipse">Eclipse</a></li>
<li><a href="#Android-Development-Tools-ADT">Android Development Tools (ADT)</a></li></ul></li>
<li><a href="#Configuring">Configuring</a>
<ul><li><a href="#Configuring-the-ADT-plugin">Configuring the ADT plug-in</a></li>
<li><a href="#Installing-an-Android-Virtual-Device">Installing an Android Virtual Device</a></li></ul></li>
<li><a href="#Final-words">Final words&#8230;</a></li>
</ul>
</div>
This is a walkthrough on how to get started developing android applications in windows with Eclipse. I will be using Windows 7 but the steps are similar in Vista and XP. This article assumes little prior knowledge about Android.</p>
<p>The reason for using Eclipse is because there exists an Android development plug-in for Eclipse, which makes things easier for us developers. Also, Eclipse is a good and Open Source IDE. Eclipse can also be used for other languages such as PHP, C++ and Ruby, it also has a very good Subversion plug-in for using repositories.</p>
<p>Developing Android applications, and using these tools described here, does not cost you anything.</p>
<p><span id="more-38"></span></p>
<p><strong>Some short explanations</strong></p>
<ul>
<li><strong>Java JDK</strong>: This is a collection of Java development tools</li>
<li><strong>Android SDK</strong>: This contains a bunch of development tools.</li>
<li><strong>AVD</strong>: AVD stands for Android Virtual Device, and is a device you can use to test your applications on.</li>
<li><strong>ADT</strong>: Android Development Tools is a plugin for Eclipse, which makes developing Android applications much easier. With this plug-in you can easily create new android projects, create GUI for your application, manage internationalization, debug your application, and testing you app on your AVD, or directly on your real device.</li>
</ul>
<p>We will first need to get a couple of tools, before we install the tools, and configure them properly.</p>
<h2 id='Downloading-tools'>Downloading tools</h2>
<p>First off, if you don&#8217;t have Sun Java JDK installed already, go ahead and <a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">download it</a>.<br />
Use the 32 bit version, as pointed out in the comments below.</p>
<p>Then download <em>Eclipse IDE for Java Developers</em> <a href="http://www.eclipse.org/downloads/">from here</a>.<br />
(I am running 64 bit Windows 7, but I use the 32 bit Java SDK and Eclipse versions since that works best together)</p>
<p>Then get the android SDK for Windows <a href="http://developer.android.com/sdk/index.html">from here</a>.<br />
The current filename is <em>android-sdk_r07-windows.zip</em>.</p>
<p>And that&#8217;s all the tools we need.</p>
<h2 id='Installing-the-tools'>Installing the tools</h2>
<p><strong> </strong></p>
<p class="errorbox">I would recommend installing tools like these to a folder that has a path without spaces in it.<br />
I have created a directory called <strong>C:\dev</strong> for my Android development, so I will install Eclipse and the Android SDK into that folder:  <strong>C:\dev\eclipse</strong> and  <strong>C:\dev\android-sdk-windows</strong></p>
<p><strong> </strong></p>
<h3 id='Java'><strong>Java</strong></h3>
<p>First install Java JDK, which also will install Java JRE.</p>
<p>Create a new environment variable to point to where you installed Java JDK.<br />
The default JDK location is <strong>C:\Program Files\Java\jdk1.6.0_22<br />
</strong><br />
Go to <em>Control Panel</em> -&gt;<em>Advanced system settings</em> -&gt; Click the <em>Environment Variables</em> button</p>
<p>Choose the <em>PATH</em> variable, click <em>Edit</em>, and add the location to you JDKs bin folder, <span style="text-decoration: underline;">at the end</span>.</p>
<p>In my case that is:   <strong> ;C:\Program Files\Java\jdk1.6.0_22\bin</strong></p>
<p>Remember to add  the ; to separate this path from the other paths.</p>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2010/11/android-tutorial-1.jpg"><img class="size-medium wp-image-40 alignnone" title="android-tutorial-1" src="http://envyandroid.com/wp/wp-content/uploads/2010/11/android-tutorial-1-300x235.jpg" alt="" width="300" height="235" /></a></p>
<p>Then hit <em>Ok</em> and <em>Ok</em>.</p>
<p>To verify that Java was installed correctly, open a command window and run this command:  <strong>java -version</strong></p>
<p>And you should see something like <strong>java version &#8220;1.6.0_22&#8243;</strong> etc&#8230; Then you know the installation was successful, and we can continue.</p>
<p class="errorbox"><strong>TIP:</strong> to set the JDK bin path in the PATH variable, you could also run this from a command window:<br />
<strong>path = %PATH%;C:\Program Files\Java\jdk1.6.0_22\bin</strong><br />
Then close the command line window, open a new one, and test with the command: <strong>java -version</strong></p>
<h3 id='Android-SDK'><strong>Android SDK</strong></h3>
<p>To install the Android SDK, simply unzip the file to you <strong>C:\dev</strong> folder, or any other folder of your choice.<br />
I put my SDK in my dev folder, so the path to it becomes <strong>C:\dev\android-sdk-windows</strong></p>
<p>You can add the <em>tools</em> directory in your SDK folder to your PATH variable (like we did above) to get easy command line access to various tools.</p>
<h3 id='Eclipse'><strong>Eclipse</strong></h3>
<p>To install Eclipse, simply unzip the .zip file. I put Eclipse in my <strong>C:\dev\eclipse</strong> folder.</p>
<h3 id='Android-Development-Tools-ADT'><strong>Android Development Tools (ADT)</strong></h3>
<p>The ADT is a plugin for Eclipse, we can install plug-ins with Eclipse&#8217; own plug-in manager, so start Eclipse.exe</p>
<p>First time you start Eclipse, you can select a workspace, Eclipse uses the workspace to store your android projects, plug-ins etc.  I like to know where I find this folder, so I put it in my dev folder.</p>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2010/11/android-tutorial-2.jpg"><img class="size-medium wp-image-41 alignnone" title="android-tutorial-2" src="http://envyandroid.com/wp/wp-content/uploads/2010/11/android-tutorial-2-300x174.jpg" alt="" width="300" height="174" /></a></p>
<p>You now have Eclipse running, and we need to install the ADT plug-in.</p>
<p>In the menu bar, go to <em>Help</em> -&gt; <em>Install new software</em></p>
<p>(or <em>Software updates</em> if you have Eclipse 3.4)</p>
<p>Enter the location where to download the ADT from, which is</p>
<p><strong>https://dl-ssl.google.com/android/eclipse/</strong></p>
<p>And hit enter,  you should now see the Developer Tools in the list below. Check all of them and hit <strong>Next</strong>.</p>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2010/11/android-tutorial-3.jpg"><img class="size-medium wp-image-42 alignnone" title="android-tutorial-3" src="http://envyandroid.com/wp/wp-content/uploads/2010/11/android-tutorial-3-300x227.jpg" alt="" width="300" height="227" /></a></p>
<p>On the next screen for reviewing your updates, hit <em>Next</em>. On the next screen with licenses, <em>accept</em>, and hit <em>next</em>.</p>
<p>After a little while you get a message that says</p>
<p>&#8220;Warning: You are installing software that contains unsigned content&#8230;.&#8221; Hit <strong>Ok</strong>.</p>
<p>When the installation is finished, hit <em>Restart Now</em>.</p>
<p class="errorbox"><strong>Tip:</strong> Sometimes the ADT plug-in gets updated, you can install those updates by going to the <em>Check for updates</em> under the <em>Help</em> <em>menu </em>And then check <em>Android DDMS</em> and <em>Android Developer Tools</em> if any updates are available.</p>
<h2 id='Configuring'>Configuring</h2>
<p>After installing our tools, we need to configure them properly.</p>
<h3 id='Configuring-the-ADT-plugin'><strong>Configuring the ADT plug-in</strong></h3>
<p>Now we need to show the ADT plug-in where we installed our android SDK.</p>
<p>In the menu  bar, hit <em>Window</em> -&gt;<em>Preferences</em>, and go to the <em>Android</em> tab.</p>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2010/11/android-tutorial-4.jpg"><img class="size-medium wp-image-43 alignnone" title="android-tutorial-4" src="http://envyandroid.com/wp/wp-content/uploads/2010/11/android-tutorial-4-300x259.jpg" alt="" width="300" height="259" /></a></p>
<p>Now browse to the location of where you installed the SDK, mine was <strong>C:\dev\android-sdk-windows</strong>.</p>
<p>Hit <em>Apply</em>, and <em>OK</em>.</p>
<p>You now (hopefully) have your Eclipse IDE set up right, and we are ready to start developing. But first, we need an android device to deploy and test our applications on.</p>
<h3 id='Installing-an-Android-Virtual-Device'><strong>Installing an Android Virtual Device</strong></h3>
<p>Hit the little box with a green android in it in the Eclipse menu bar <a href="http://envyandroid.com/wp/wp-content/uploads/2010/11/sdk-avd-manager.png"><img class="alignnone size-full wp-image-192" title="sdk-avd-manager" src="http://envyandroid.com/wp/wp-content/uploads/2010/11/sdk-avd-manager.png" alt="" width="21" height="21" /></a>, this launches the <strong>Android SDK and AVD Manager</strong>.</p>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2010/11/android-tutorial-6.jpg"><img class="size-medium wp-image-45 alignnone" title="android-tutorial-6" src="http://envyandroid.com/wp/wp-content/uploads/2010/11/android-tutorial-6-300x202.jpg" alt="" width="300" height="202" /></a></p>
<p>Under Available packages, you can choose which device you want to test your applications on.<br />
For example API7 is Android 2.1.</p>
<p>Check the API7 packages, Usb driver package, Market licensing package, and the samples, and hit the <em>Install selected</em><strong> </strong>button</p>
<p>On the next screen, check <em>Accept all</em> and hit <em>Install</em></p>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2010/11/android-tutorial-6.jpg"><img class="size-medium wp-image-45 alignnone" title="android-tutorial-6" src="http://envyandroid.com/wp/wp-content/uploads/2010/11/android-tutorial-6-300x202.jpg" alt="" width="300" height="202" /></a></p>
<p>The download may take a couple of minutes depending on your internet connection.</p>
<p>When it is finished, select <em>Restart Eclipse</em> and then<strong> </strong><em>Close.</em></p>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2010/11/android-tutorial-7.jpg"><img class="size-medium wp-image-46 alignnone" title="android-tutorial-7" src="http://envyandroid.com/wp/wp-content/uploads/2010/11/android-tutorial-7-300x203.jpg" alt="" width="300" height="203" /></a></p>
<p><strong>Close the AVD manager and restart Eclipse</strong>.</p>
<p>Open <em>Window</em> -&gt; <em>Preferences</em> -&gt; <em>Android</em>, and make sure an <em>SDK Target</em> is selected in the list, otherwise choose &#8220;Android 2.1-update1&#8243;, Hit <em>Apply</em> and <em>OK</em><strong>.</strong></p>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2010/11/android-tutorial-8.jpg"><img class="size-medium wp-image-47 alignnone" title="android-tutorial-8" src="http://envyandroid.com/wp/wp-content/uploads/2010/11/android-tutorial-8-300x255.jpg" alt="" width="300" height="255" /></a></p>
<p>Open the Android SDK and AVD manager <a href="http://envyandroid.com/wp/wp-content/uploads/2010/11/sdk-avd-manager.png"><img class="alignnone size-full wp-image-192" title="sdk-avd-manager" src="http://envyandroid.com/wp/wp-content/uploads/2010/11/sdk-avd-manager.png" alt="" width="21" height="21" /></a>, and then the <em>Virtual devices</em> menu.<br />
You have earlier downloaded the files for the android virtual device, now it&#8217;s time to install it.</p>
<p>Hit <em>New</em><strong>, </strong>Enter<strong> </strong>a<strong> </strong>name for your device, and choose the <em>android 2.1 API 7</em> that we installed.<br />
You may give it a couple of MB SD Card storage too.</p>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2010/11/android-tutorial-9.jpg"><img class="size-medium wp-image-48 alignnone" title="android-tutorial-9" src="http://envyandroid.com/wp/wp-content/uploads/2010/11/android-tutorial-9-300x223.jpg" alt="" width="300" height="223" /></a></p>
<p>Then hit <em>Create AVD</em>. We now have an AVD installed, if you want to launch it, select it, hit <em>Start&#8230;</em> and then <em>Launch</em>.</p>
<p>It always takes some time to start the AVD, but when it is booted, you should see this:</p>
<p><a href="http://envyandroid.com/wp/wp-content/uploads/2010/11/android-tutorial-10.jpg"><img class="size-medium wp-image-49 alignnone" title="android-tutorial-10" src="http://envyandroid.com/wp/wp-content/uploads/2010/11/android-tutorial-10-300x210.jpg" alt="" width="300" height="210" /></a></p>
<h2 id='Final-words'>Final words&#8230;</h2>
<p>You are now ready to begin developing android apps!</p>
<p><strong>Thank you for following this tutorial.</strong></p>
<p class="errorbox">If you want to <a href="http://envyandroid.com/archives/118">try out the new Gingerbread (Android 2.3) AVD</a>, you can check out this similar guide on how to get it up and running!</p>
<p><em><br />
</em></p>
 <img src="http://envyandroid.com/wp/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=38" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://envyandroid.com/archives/38/getting-started-with-android-dev-environment/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Database Caching 1/38 queries in 0.019 seconds using disk: basic

Served from: envyandroid.com @ 2012-05-20 00:22:38 -->
