<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Xavi Rigau</title>
	<atom:link href="http://xrigau.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://xrigau.wordpress.com</link>
	<description>Android coding 4 fun!</description>
	<lastBuildDate>Sat, 01 Jun 2013 19:17:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='xrigau.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Xavi Rigau</title>
		<link>http://xrigau.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://xrigau.wordpress.com/osd.xml" title="Xavi Rigau" />
	<atom:link rel='hub' href='http://xrigau.wordpress.com/?pushpress=hub'/>
		<item>
		<title>I&#8217;ve moved!!! http://blog.xavirigau.com</title>
		<link>http://xrigau.wordpress.com/2012/04/11/ive-moved-httpblog-xavirigau-com/</link>
		<comments>http://xrigau.wordpress.com/2012/04/11/ive-moved-httpblog-xavirigau-com/#comments</comments>
		<pubDate>Tue, 10 Apr 2012 22:25:48 +0000</pubDate>
		<dc:creator>Xavi Rigau</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://xrigau.wordpress.com/?p=93</guid>
		<description><![CDATA[Hello!! Today I&#8217;m releasing some cool library for Android!!!! But I&#8217;ve moved (thanks to @CharlyBones) to a dedicated server with my own WordPress.org blog! Please visit http://blog.xavirigau.com for more! And if you want to know more about the library I&#8217;m releasing check it for new posts.. Thanks for visiting!!!!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xrigau.wordpress.com&#038;blog=33669926&#038;post=93&#038;subd=xrigau&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Hello!!</p>
<p>Today I&#8217;m releasing some cool library for Android!!!! But I&#8217;ve moved (thanks to <a title="@CharlyBones" href="https://twitter.com/charlybones" target="_blank">@CharlyBones</a>) to a dedicated server with my own WordPress.org blog!</p>
<p>Please visit <a title="Xavi Rigau's Blog" href="http://blog.xavirigau.com" target="_blank">http://blog.xavirigau.com</a> for more! And if you want to know more about <a title="Synchronized Scrolling Library" href="https://github.com/xrigau/Synchronized-Scrolling/tree/master/XaviRigau-SynchronizedScrolling" target="_blank">the library I&#8217;m releasing</a> check it for new posts..</p>
<p>Thanks for visiting!!!!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xrigau.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xrigau.wordpress.com/93/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xrigau.wordpress.com&#038;blog=33669926&#038;post=93&#038;subd=xrigau&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://xrigau.wordpress.com/2012/04/11/ive-moved-httpblog-xavirigau-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d694325fb9aba8ef4b4181d758c80145?s=96&#38;d=retro&#38;r=G" medium="image">
			<media:title type="html">xrigau</media:title>
		</media:content>
	</item>
		<item>
		<title>Fix (some) problems with libraries in the ADT 17 Plugin</title>
		<link>http://xrigau.wordpress.com/2012/03/22/fix-some-problems-with-libraries-in-the-adt-17-plugin-10/</link>
		<comments>http://xrigau.wordpress.com/2012/03/22/fix-some-problems-with-libraries-in-the-adt-17-plugin-10/#comments</comments>
		<pubDate>Thu, 22 Mar 2012 13:54:08 +0000</pubDate>
		<dc:creator>Xavi Rigau</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[ADT]]></category>
		<category><![CDATA[ADT 17]]></category>
		<category><![CDATA[ADT Plugin]]></category>
		<category><![CDATA[Eclipse]]></category>

		<guid isPermaLink="false">http://xrigau.wordpress.com/?p=79</guid>
		<description><![CDATA[Hey guys! This will be a quick post. Did you update the ADT plugin to v17? Did you find that there are problems with libraries? The solution (for some of those problems) is: If your jar libraries are in a lib folder, rename it to libs. Remove all your jar libraries from the Build Path [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xrigau.wordpress.com&#038;blog=33669926&#038;post=79&#038;subd=xrigau&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Hey guys!</p>
<p>This will be a quick post. Did you update the ADT plugin to v17? Did you find that there are problems with libraries?</p>
<p>The solution (for some of those problems) is:</p>
<ol>
<li>If your jar libraries are in a <strong>lib</strong> folder, rename it to <strong>libs</strong>.</li>
<li>Remove all your jar libraries from the Build Path of your project. Don&#8217;t need to add them again to the Build Path.</li>
<li>In your libs folder, you should have just the jar libraries that your project is using. <strong>You can&#8217;t have different versions of a single library</strong>. This is because if you&#8217;ve noticed, Eclipse creates now a reference in the Build Path called &#8220;<em>Android Dependecies</em>&#8221; and he puts there all the jar files that are in your <strong>libs</strong> folder.</li>
<li>Follow steps <strong>1, 2 and 3 for each Android Library Project</strong> that your project is using.</li>
<li>Make a project clean.</li>
</ol>
<p>Hope it helps anybody! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p><a href="http://xrigau.files.wordpress.com/2012/03/small-post-adt-error.png"><img class="aligncenter size-medium wp-image-84" title="small-post-adt-error" src="http://xrigau.files.wordpress.com/2012/03/small-post-adt-error.png?w=195&#038;h=300" alt="" width="195" height="300" /></a></p>
<p>I found some help here: <a href="http://android.foxykeep.com/dev/how-to-fix-the-classdefnotfounderror-with-adt-17">http://android.foxykeep.com/dev/how-to-fix-the-classdefnotfounderror-with-adt-17</a></p>
<p>&nbsp;</p>
<p><strong>UPDATE</strong>: You can find official ¡nfo on Android Dependecies at this link: <a href="http://tools.android.com/recent/dealingwithdependenciesinandroidprojects" rel="nofollow">http://tools.android.com/recent/dealingwithdependenciesinandroidprojects</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xrigau.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xrigau.wordpress.com/79/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xrigau.wordpress.com&#038;blog=33669926&#038;post=79&#038;subd=xrigau&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://xrigau.wordpress.com/2012/03/22/fix-some-problems-with-libraries-in-the-adt-17-plugin-10/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d694325fb9aba8ef4b4181d758c80145?s=96&#38;d=retro&#38;r=G" medium="image">
			<media:title type="html">xrigau</media:title>
		</media:content>

		<media:content url="http://xrigau.files.wordpress.com/2012/03/small-post-adt-error.png?w=195" medium="image">
			<media:title type="html">small-post-adt-error</media:title>
		</media:content>
	</item>
		<item>
		<title>HowTo: ActionBarSherlock + MapFragment  + ListFragment</title>
		<link>http://xrigau.wordpress.com/2012/03/22/howto-actionbarsherlock-mapfragment-listfragment/</link>
		<comments>http://xrigau.wordpress.com/2012/03/22/howto-actionbarsherlock-mapfragment-listfragment/#comments</comments>
		<pubDate>Wed, 21 Mar 2012 22:03:33 +0000</pubDate>
		<dc:creator>Xavi Rigau</dc:creator>
				<category><![CDATA[ActionBarSherlock]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Fragments]]></category>
		<category><![CDATA[ActionBar]]></category>
		<category><![CDATA[MapActivity]]></category>
		<category><![CDATA[MapView]]></category>

		<guid isPermaLink="false">http://xrigau.wordpress.com/?p=39</guid>
		<description><![CDATA[Today I&#8217;ll write about how to have 2 fragments in one Activity, one of them containing a ListView (for example), and the other one containing a MapView, and all of this with a supercool ActionBarSherlock! The perfect combo! The problem It&#8217;s quite simple: if you want to use fragments with a MapView, you&#8217;re not allowed [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xrigau.wordpress.com&#038;blog=33669926&#038;post=39&#038;subd=xrigau&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Today I&#8217;ll write about how to have 2 fragments in one Activity, one of them containing a ListView (for example), and the other one containing a MapView, and all of this with a supercool ActionBarSherlock! The perfect combo!</p>
<h1>The problem</h1>
<p>It&#8217;s quite simple: if you want to use fragments with a MapView, you&#8217;re not allowed to do it in an easy way.</p>
<p>There&#8217;s no MapFragment that can be held by a FragmentActivity or a MapFragmentActivity that can hold both a MapView and some fragments #fail. So, what&#8217;s the solution?</p>
<p><span id="more-39"></span></p>
<h1>The workaround</h1>
<p>Fortunately, there&#8217;s always people who do cool libraries. One example is &#8220;<a title="android-support-v4-googlemaps" href="https://github.com/petedoyle/android-support-v4-googlemaps" target="_blank">android-support-v4-googlemaps</a>&#8220;. It&#8217;s essentially a copy of the <a title="Android Compatibility Library" href="http://developer.android.com/sdk/compatibility-library.html" target="_blank">Android Compatibility Library</a> but the FragmentActivity class extends MapActivity instead of Activity, so we have functionality of a MapActivity with fragments.</p>
<h1>The setting up</h1>
<p>There are the steps:</p>
<ol>
<li>First of all you should take a look at my last post <a title="Using an ActionBar in your Android app with ActionBarSherlock" href="http://xrigau.wordpress.com/2012/03/15/using-an-actionbar-in-your-application-with-actionbarsherlock/" target="_blank">Using an ActionBar in your Android app with ActionBarSherlock</a> and <strong>follow the steps 1 to 6</strong> in the part named &#8220;<em>The code</em>&#8220;, just 1 to 6, not 7. If you already have the ActionBarSherlock in your workspace, you can skip this step.</li>
<li>C<strong>reate a copy of the ActionBarSherlock library project</strong> and rename it to something like &#8220;<em>Sherlock-ActionBar-GoogleMaps-lib-4.0.0</em>&#8220;, we will work on that copy.</li>
<li>Then download the last version of the android-support-v4-googlemaps library <a title="android-support-v4-googlemaps" href="https://github.com/downloads/petedoyle/android-support-v4-googlemaps/android-support-v4-r6-googlemaps.jar" target="_blank">here</a>.</li>
<li>Now remove the <em>android-support-v4.jar</em> file from the library project build path, copy the file you downloaded (which name should be something like <em>android-support-v4-r6-googlemaps.jar</em>) and paste it to the <strong>libs</strong> folder in the library. It&#8217;s also needed to <strong>add this new jar to the Build path</strong>.</li>
<li>After that, change the target SDK version of the ActionBarSherlock to the <strong>Google APIs SDK</strong> (for example Google APIs 4.0).</li>
<li>Create a new project called &#8220;Maps with fragments&#8221;, that targets Google APIs SDK 4.0.</li>
<li>Add the &#8220;<em>Sherlock-ActionBar-GoogleMaps-lib-4.0.0</em>&#8221; as a library project in the project that we just created and add the <em>android-support-v4-r6-googlemaps.jar </em>library to the new project&#8217;s build path.</li>
</ol>
<h1>The codes</h1>
<p>We&#8217;re done with the setup. Now it&#8217;s time for the code. Basically what we&#8217;ll be doing is have an Activity that extends SherlockFragmentActivity. Then we&#8217;ll need to create a static class with a static MapView in it that we will use as an &#8220;Exchanger&#8221; between the Activity and the MapFragment. Our activity will create a new MapView object and store it into the Exchanger.</p>
<p>We also need to create a class (the MapFragment) that extends SherlockFragment. This Fragment will use the Exchanger&#8217;s MapView as content view.</p>
<p>Then we will be able to replace that fragment with another one (for example a ListFragment).</p>
<p>That was a basic explanation of the &#8220;Hack&#8221;.</p>
<p>Here you have the source for the class <strong>MapswithfragmentsActivity.java</strong>:</p>
<pre class="brush: java; title: ; notranslate">
package com.xrigau.mapsfragments;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;

import com.actionbarsherlock.app.SherlockFragment;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.app.SherlockListFragment;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
import com.google.android.maps.MapView;

public class MapswithfragmentsActivity extends SherlockFragmentActivity {
	
	private MapFragment mMapFragment;
	private MyListFragment mMyListFragment;
	
	// We use this fragment as a pointer to the visible one, so we can hide it easily.
	private Fragment mVisible = null;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        // We instantiate the MapView here, it's really important!
        Exchanger.mMapView = new MapView(this, &amp;quot;INSERT_YOUR_MAP_API_KEY_HERE&amp;quot;); // TODO: Replace for API Key!
        
        setupFragments();
        // We manually show the list Fragment.
        showFragment(mMyListFragment);
    }

	/**
	 * This method does the setting up of the Fragments. It basically checks if
	 * the fragments exist and if they do, we'll hide them. If the fragments
	 * don't exist, we create them, add them to the FragmentManager and hide
	 * them.
	 */
	private void setupFragments() {
		final FragmentTransaction ft = getSupportFragmentManager().beginTransaction();

		// If the activity is killed while in BG, it's possible that the
		// fragment still remains in the FragmentManager, so, we don't need to
		// add it again.
		mMapFragment = (MapFragment) getSupportFragmentManager().findFragmentByTag(MapFragment.TAG);
        if (mMapFragment == null) {
        	mMapFragment = new MapFragment();
        	ft.add(R.id.fragment_container, mMapFragment, MapFragment.TAG);
        }
        ft.hide(mMapFragment);
        
        mMyListFragment = (MyListFragment) getSupportFragmentManager().findFragmentByTag(MyListFragment.TAG);
        if (mMyListFragment == null) {
        	mMyListFragment = new MyListFragment();
        	ft.add(R.id.fragment_container, mMyListFragment, MyListFragment.TAG);
        }
        ft.hide(mMyListFragment);
        
        ft.commit();
	}
	
	/**
	 * This method shows the given Fragment and if there was another visible
	 * fragment, it gets hidden. We can just do this because we know that both
	 * the mMyListFragment and the mMapFragment were added in the Activity's
	 * onCreate, so we just create the fragments once at first and not every
	 * time. This will avoid facing some problems with the MapView.
	 * 
	 * @param fragmentIn
	 *            The fragment to show.
	 */
	private void showFragment(Fragment fragmentIn) {
		if (fragmentIn == null) return;
		
		final FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
		ft.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out);
		
		if (mVisible != null) ft.hide(mVisible);
		
		ft.show(fragmentIn).commit();
		mVisible = fragmentIn;
	}
	
    @Override
	public boolean onCreateOptionsMenu(Menu menu) {
    	// Inflate the menu with the options to show the Map and the List.
    	getSupportMenuInflater().inflate(R.menu.menu, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
		case R.id.ic_list:
			// Show mMyListFragment.
			showFragment(mMyListFragment);
			return true;
			
		case R.id.ic_map:
			// Show mMapFragment.
			showFragment(mMapFragment);
			return true;
		}
		return super.onOptionsItemSelected(item);
	}

	/**
	 * This class acts as an exchanger between the Activity and the MapFragment,
	 * so if you want, you can put the MapFragment class in a separate java
	 * file.
	 * 
	 * @author Xavi
	 * 
	 */
	public static class Exchanger {
		// We will use this MapView always.
    	public static MapView mMapView;
    }
	
	/**
	 * This is our ListFragment class. You can put it in a separate java file.
	 * 
	 * @author Xavi
	 * 
	 */
	public static class MyListFragment extends SherlockListFragment {

		public static final String TAG = &amp;quot;listFragment&amp;quot;;
		
		private final String[] mItems = { &amp;quot;List Item 1&amp;quot;, &amp;quot;List Item 2&amp;quot;,
				&amp;quot;List Item 3&amp;quot;, &amp;quot;List Item 4&amp;quot;, &amp;quot;List Item 5&amp;quot;, &amp;quot;List Item 6&amp;quot;,
				&amp;quot;List Item 7&amp;quot;, &amp;quot;List Item 8&amp;quot;, &amp;quot;List Item 9&amp;quot;, &amp;quot;List Item 10&amp;quot; };
		
		public MyListFragment() {}
		
		@Override
		public void onCreate(Bundle arg0) {
			super.onCreate(arg0);
			setRetainInstance(true);
		}

		@Override
		public View onCreateView(LayoutInflater inflater, ViewGroup vg, Bundle data) {
			// Inflate the ListView layout file.
			return inflater.inflate(R.layout.list_fragment, null);
		}

		@Override
		public void onViewCreated(View arg0, Bundle arg1) {
			super.onViewCreated(arg0, arg1);
			setListAdapter(new ArrayAdapter&amp;lt;String&amp;gt;(getSherlockActivity(), android.R.layout.simple_list_item_1, android.R.id.text1, mItems));
		}
	}
	
	/**
	 * This is the Fragment class that will hold the MapView as its content
	 * view. You can put it in a separate java file.
	 * 
	 * @author Xavi
	 * 
	 */
	public static class MapFragment extends SherlockFragment {

		public static final String TAG = &amp;quot;mapFragment&amp;quot;;
		
		public MapFragment() {}
		
		@Override
		public void onCreate(Bundle arg0) {
			super.onCreate(arg0);
			setRetainInstance(true);
		}
		
		@Override
		public View onCreateView(LayoutInflater inflater, ViewGroup vg, Bundle data) {
			// The Activity created the MapView for us, so we can do some init stuff.
			Exchanger.mMapView.setClickable(true);
			Exchanger.mMapView.setBuiltInZoomControls(true); // If you want.

			/*
			 * If you're getting Exceptions saying that the MapView already has
			 * a parent, uncomment the next lines of code, but I think that it
			 * won't be necessary. In other cases it was, but in this case I
			 * don't this should happen.
			 */
			/*
			 * final ViewGroup parent = (ViewGroup) Exchanger.mMapView.getParent();
			 * if (parent != null) parent.removeView(Exchanger.mMapView);
			 */
			
			return Exchanger.mMapView;
		}
	}
}
</pre>
<p>Here you have the source for the <strong>main.xml</strong> layout file:</p>
<pre class="brush: xml; title: ; notranslate">
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;
&amp;lt;LinearLayout xmlns:android=&amp;quot;http://schemas.android.com/apk/res/android&amp;quot;
    android:layout_width=&amp;quot;fill_parent&amp;quot;
    android:layout_height=&amp;quot;fill_parent&amp;quot;
    android:orientation=&amp;quot;vertical&amp;quot; &amp;gt;

    &amp;lt;!-- This FrameLayout will be the PlaceHolder of the Fragments. --&amp;gt;
    &amp;lt;FrameLayout android:id=&amp;quot;@+id/fragment_container&amp;quot;
        android:layout_width=&amp;quot;fill_parent&amp;quot;
        android:layout_height=&amp;quot;fill_parent&amp;quot; /&amp;gt;

&amp;lt;/LinearLayout&amp;gt;
</pre>
<p>There&#8217;s the source for the <strong>list_fragment.xml</strong> layout file:</p>
<pre class="brush: xml; title: ; notranslate">
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;
&amp;lt;ListView xmlns:android=&amp;quot;http://schemas.android.com/apk/res/android&amp;quot;
    android:id=&amp;quot;@android:id/list&amp;quot;
    android:layout_width=&amp;quot;match_parent&amp;quot;
    android:layout_height=&amp;quot;match_parent&amp;quot; &amp;gt;
&amp;lt;/ListView&amp;gt;
</pre>
<p>That&#8217;s the <strong>menu.xml</strong> file:</p>
<pre class="brush: xml; title: ; notranslate">
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;
&amp;lt;menu xmlns:android=&amp;quot;http://schemas.android.com/apk/res/android&amp;quot; &amp;gt;

    &amp;lt;item
        android:id=&amp;quot;@+id/ic_list&amp;quot;
        android:icon=&amp;quot;@android:drawable/ic_menu_agenda&amp;quot;
        android:showAsAction=&amp;quot;ifRoom|withText&amp;quot;
        android:title=&amp;quot;List&amp;quot;/&amp;gt;
    &amp;lt;item
        android:id=&amp;quot;@+id/ic_map&amp;quot;
        android:icon=&amp;quot;@android:drawable/ic_menu_mapmode&amp;quot;
        android:showAsAction=&amp;quot;ifRoom|withText&amp;quot;
        android:title=&amp;quot;Map&amp;quot;/&amp;gt;

&amp;lt;/menu&amp;gt;
</pre>
<p>Finally the <strong>AndroidManifest.xml</strong>:</p>
<pre class="brush: xml; title: ; notranslate">
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;
&amp;lt;manifest xmlns:android=&amp;quot;http://schemas.android.com/apk/res/android&amp;quot;
	package=&amp;quot;com.xrigau.mapsfragments&amp;quot;
	android:versionCode=&amp;quot;1&amp;quot;
	android:versionName=&amp;quot;1.0&amp;quot; &amp;gt;
	
	&amp;lt;uses-sdk android:minSdkVersion=&amp;quot;4&amp;quot; android:targetSdkVersion=&amp;quot;15&amp;quot;/&amp;gt;
	
	&amp;lt;!-- We need Internet in order to load the maps. --&amp;gt;
	&amp;lt;uses-permission android:name=&amp;quot;android.permission.INTERNET&amp;quot; /&amp;gt;

	&amp;lt;!-- Set the theme in order to use the ActionBarSherlock. --&amp;gt;
	&amp;lt;application android:theme=&amp;quot;@style/Theme.Sherlock.Light.DarkActionBar&amp;quot;
		android:icon=&amp;quot;@drawable/ic_launcher&amp;quot;
		android:label=&amp;quot;@string/app_name&amp;quot; &amp;gt;
		
	    &amp;lt;!-- We need to tell Android that we'll be using Google Maps Library. --&amp;gt;
	    &amp;lt;uses-library android:name=&amp;quot;com.google.android.maps&amp;quot; /&amp;gt;
	    
		&amp;lt;activity
			android:name=&amp;quot;.MapswithfragmentsActivity&amp;quot;
			android:label=&amp;quot;@string/app_name&amp;quot; &amp;gt;
			&amp;lt;intent-filter&amp;gt;
				&amp;lt;action android:name=&amp;quot;android.intent.action.MAIN&amp;quot; /&amp;gt;

				&amp;lt;category android:name=&amp;quot;android.intent.category.LAUNCHER&amp;quot; /&amp;gt;
			&amp;lt;/intent-filter&amp;gt;
		&amp;lt;/activity&amp;gt;
	&amp;lt;/application&amp;gt;

&amp;lt;/manifest&amp;gt;
</pre>
<p>And you can download the complete source for this tutorial in this link <a title="Complete source code" href="http://dl.dropbox.com/u/2397504/xrigau-abs_map_list_v1.zip" target="_blank">http://dl.dropbox.com/u/2397504/xrigau-abs_map_list_v1.zip</a>.</p>
<p>So, the final result is:<br />
<a href="http://xrigau.files.wordpress.com/2012/03/abs_map_list_screen3.png"><img src="http://xrigau.files.wordpress.com/2012/03/abs_map_list_screen3.png?w=300&#038;h=250" alt="The result!" title="abs_map_list_screen3" width="300" height="250" class="aligncenter size-medium wp-image-60" /></a><br />
Really nice! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>To end up, I just hope that this can help somebody and if you have questions, please comment and ask what you want and I&#8217;ll try to do my best to help you.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xrigau.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xrigau.wordpress.com/39/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xrigau.wordpress.com&#038;blog=33669926&#038;post=39&#038;subd=xrigau&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://xrigau.wordpress.com/2012/03/22/howto-actionbarsherlock-mapfragment-listfragment/feed/</wfw:commentRss>
		<slash:comments>39</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d694325fb9aba8ef4b4181d758c80145?s=96&#38;d=retro&#38;r=G" medium="image">
			<media:title type="html">xrigau</media:title>
		</media:content>

		<media:content url="http://xrigau.files.wordpress.com/2012/03/abs_map_list_screen3.png?w=300" medium="image">
			<media:title type="html">abs_map_list_screen3</media:title>
		</media:content>
	</item>
		<item>
		<title>Using an ActionBar in your Android app with ActionBarSherlock</title>
		<link>http://xrigau.wordpress.com/2012/03/15/using-an-actionbar-in-your-application-with-actionbarsherlock/</link>
		<comments>http://xrigau.wordpress.com/2012/03/15/using-an-actionbar-in-your-application-with-actionbarsherlock/#comments</comments>
		<pubDate>Wed, 14 Mar 2012 23:19:34 +0000</pubDate>
		<dc:creator>Xavi Rigau</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[ActionBar]]></category>
		<category><![CDATA[ActionBarSherlock]]></category>
		<category><![CDATA[Design Pattern]]></category>

		<guid isPermaLink="false">http://xrigau.wordpress.com/?p=13</guid>
		<description><![CDATA[First of all, who am I? Hey there! I’m Xavi Rigau, a 21 year old Spanish student (I’ll finish my IT degree this summer) who loves Android Development. I started programming for Android as a hobby in the summer of 2009, but when I started university again in October I left it for a while. [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xrigau.wordpress.com&#038;blog=33669926&#038;post=13&#038;subd=xrigau&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<h1>First of all, who am I?</h1>
<p>Hey there! I’m Xavi Rigau, a 21 year old Spanish student (I’ll finish my IT degree this summer) who loves Android Development. I started programming for Android as a hobby in the summer of 2009, but when I started university again in October I left it for a while.</p>
<p>Then I started my internship in a company called Tempos 21 in October, 1<sup>st</sup> 2010. It’s a consultant specialized in mobility. First day I did some boring stuff because I was supposed to be in the Testing department. The problem was that there was only one Android developer (which name is Paulo) at that time and when I said that I had programmed a little on Android they thought it should be better if I could help Paulo a little. Since then I’ve been working there as an Android developer, so I’ve been into this 1 year and a half now.</p>
<p><span id="more-13"></span></p>
<h1>The ActionBar pattern</h1>
<p>In my first post I’ll explain how to put an ActionBar in your Android app in a really simple way. For those who are new to Android Development, an ActionBar is a design pattern that shoud be used in almost all applications. You can find some info about Action Bar design at the <a title="Android Design site" href="http://developer.android.com/design/patterns/actionbar.html" target="_blank">Android Design site</a> and the documentation of the ActionBar class at the <a title="Android Developers site" href="http://developer.android.com/guide/topics/ui/actionbar.html" target="_blank">Android Developers site</a>, but summing up, what the Android team says is that the ActionBar should be used replacing the old Options Menu.<strong><em></em></strong></p>
<h2>The problem</h2>
<p>All of this is really cool and marvelous, but the fact is that there’s no real implementation of an Action Bar since Android 3.0 (Honeycomb), so if your application targets Android 3.0 or higher, when you run it on versions &gt;= 3.0 you’ll get the default ActionBar, but if you run the same application on versions &lt; 3.0 you won’t. Okay, you can download and use the <a title="Compatibility Library" href="http://developer.android.com/sdk/compatibility-library.html" target="_blank">Compatibility Library</a> in order to use ActionBar in devices with Honeycomb or later and the standard options menu in other cases, but that’s not a real solution.</p>
<h2>The solution</h2>
<p>So, how do we get the ActionBar on pre-Honeycomb? It’s really easy thanks to <a title="Jake Wharton" href="http://jakewharton.com/" target="_blank">Jake Wharton</a>, a guy who whas created a library called <a title="ActionBarSherlock" href="http://actionbarsherlock.com/" target="_blank">ActionBarSherlock</a>. What this library does is that if you’re using your app in a device with <strong>Android 2.x, it gives you an ActionBar that is a copy of the real ActionBar</strong> (it behaves the same way), but if you’re on Android 3.0 or later, you’ll get the standard ActionBar. The cool thing is that <strong>the methods that you can use with this ActionBar are the same than with the standard one</strong>.</p>
<h1>The code</h1>
<p>I’ll suppose that you have a proper environment configured to develop on Android. If not, take a look at <a title="Installing SDK from Android Developers site" href="http://developer.android.com/sdk/installing.html" target="_blank">the steps</a> or look at <a title="Setting up for Android Development tutorial" href="http://androidcodemonkey.blogspot.com/2010/01/how-to-setup-android-development_23.html" target="_blank">this tutorial</a>.<br />
I’ll also assume that you know how to create an Android project and things like that. In other cases you should read <a title="Tutorial for getting started on Android Development" href="http://www.hirmet.com/the-first-steps-android-app-development" target="_blank">this</a> tutorial or this <a title="Introduction to Android Development" href="http://mobile.tutsplus.com/tutorials/android/introduction-to-android-development/" target="_blank">one</a>.</p>
<p>Okay, let’s do it! Here are the steps to get the library into Eclipse:</p>
<ol>
<li>First of all, go to <a title="ActionBarSherlock download site" href="http://actionbarsherlock.com/download.html" target="_blank">Sherlock ActionBar library’s website</a> and <strong>Download</strong> the latest version (current is 4.0.0).</li>
<li>Then open the file you downloaded, enter the root folder and you will see three folders: <em>library</em>, <em>samples</em> and <em>website</em>.</li>
<li><strong>Extract the</strong> <strong><em>library</em></strong> folder into your workspace folder. You can rename it if you want to something like “Sherlock-ActionBar-lib-4.0.0”.</li>
<li>Open Eclipse. <strong>Click File -&gt; New -&gt; Android Project.</strong></li>
<li>Now select “<strong>Create project from existing source</strong>”, and select the folder that you copied into your workspace folder. You should also type a name such as “Sherlock-ActionBar-lib-4.0.0” <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . Now press <strong>Next.</strong></li>
<li>Select Android 4.0 as target SDK and press <strong>Finish</strong>.</li>
<li>Open the <strong>libs</strong> folder in the Project that we’ve created, right-click the “android-support-v4.jar” file and select <strong>Build Path -&gt; Add to Build Path</strong>.</li>
</ol>
<p>Now, we have the Android Library Project of the Sherlock ActionBar in our workspace and in Eclipse.</p>
<p>Next step is to create a new Android Project, <strong>targeting at least Android 4.0</strong> SDK. We will call ActionBarTest.</p>
<p>Then right-click on that ActionBarTest project and select <strong>Properties -&gt; Android and add the “</strong>Sherlock-ActionBar-lib-4.0.0” as a Library.</p>
<p>Now, open open the default Activity that Eclipse has created, it name should be <strong>ActionBarTestActivity.java</strong> and change the following line:</p>
<pre class="brush: java; title: ; notranslate">
public class ActionBarTestActivity extends Activity {
</pre>
<p>to:</p>
<pre class="brush: java; title: ; notranslate">
public class ActionBarTestActivity extends SherlockActivity {
</pre>
<p>Finally here it comes the last step: Open the AndroidManifest of your ActionBarTest project and write inside the <strong>application tag</strong>:</p>
<pre class="brush: xml; title: ; notranslate">
android:theme=&amp;quot;@style/Theme.Sherlock.Light.DarkActionBar&amp;quot;
</pre>
<p>So, you will have something like:<em></em></p>
<pre class="brush: xml; title: ; notranslate">
&amp;lt;application
	android:icon=&amp;quot;@drawable/ic_launcher&amp;quot;
	android:label=&amp;quot;@string/app_name&amp;quot;
	android:theme=&amp;quot;@style/Theme.Sherlock.Light.DarkActionBar&amp;quot; &amp;gt;

	&amp;lt;activity
		android:name=&amp;quot;.ActionBarTestActivity&amp;quot;
		android:label=&amp;quot;@string/app_name&amp;quot; &amp;gt;
		&amp;lt;intent-filter&amp;gt;
	&amp;lt;!-- ... Other stuff... --&amp;gt;
</pre>
<p>And that was all guys! That’s the result:</p>
<p style="text-align:center;"><a href="http://xrigau.files.wordpress.com/2012/03/screenshot.png"><img class="size-medium wp-image-14 aligncenter" title="actionbar-screenshot" src="http://xrigau.files.wordpress.com/2012/03/screenshot.png?w=180&#038;h=300" alt="" width="180" height="300" /></a></p>
<p style="text-align:left;"><b>UPDATE</b>: You can find <a title="Videotutorial about ActionBarSherlock" href="http://www.youtube.com/watch?v=4GJ6yY1lNNY">here a videotutorial</a> about ActionBarSherlock which I found really interesting!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xrigau.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xrigau.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xrigau.wordpress.com&#038;blog=33669926&#038;post=13&#038;subd=xrigau&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://xrigau.wordpress.com/2012/03/15/using-an-actionbar-in-your-application-with-actionbarsherlock/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d694325fb9aba8ef4b4181d758c80145?s=96&#38;d=retro&#38;r=G" medium="image">
			<media:title type="html">xrigau</media:title>
		</media:content>

		<media:content url="http://xrigau.files.wordpress.com/2012/03/screenshot.png?w=180" medium="image">
			<media:title type="html">actionbar-screenshot</media:title>
		</media:content>
	</item>
		<item>
		<title>Hello world!</title>
		<link>http://xrigau.wordpress.com/2012/03/09/hello-world/</link>
		<comments>http://xrigau.wordpress.com/2012/03/09/hello-world/#comments</comments>
		<pubDate>Fri, 09 Mar 2012 15:13:55 +0000</pubDate>
		<dc:creator>Xavi Rigau</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://xrigau.wordpress.com/?p=1</guid>
		<description><![CDATA[Hey there! I&#8217;ll be posting info about Android development soon! Xavi<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xrigau.wordpress.com&#038;blog=33669926&#038;post=1&#038;subd=xrigau&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Hey there!</p>
<p>I&#8217;ll be posting info about Android development soon!</p>
<p>Xavi</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xrigau.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xrigau.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xrigau.wordpress.com&#038;blog=33669926&#038;post=1&#038;subd=xrigau&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://xrigau.wordpress.com/2012/03/09/hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d694325fb9aba8ef4b4181d758c80145?s=96&#38;d=retro&#38;r=G" medium="image">
			<media:title type="html">xrigau</media:title>
		</media:content>
	</item>
	</channel>
</rss>
