<?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>Tech Blog &#187; google maps api</title>
	<atom:link href="http://informationideas.com/news/tag/google-maps-api/feed/" rel="self" type="application/rss+xml" />
	<link>http://informationideas.com/news</link>
	<description>Using technology to help your business</description>
	<lastBuildDate>Fri, 23 Jul 2010 06:24:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Getting Android emulator working with Google Maps API Key</title>
		<link>http://informationideas.com/news/2008/11/06/getting-android-emulator-working-with-google-maps-api-key/</link>
		<comments>http://informationideas.com/news/2008/11/06/getting-android-emulator-working-with-google-maps-api-key/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 19:47:46 +0000</pubDate>
		<dc:creator>frank</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[google maps api]]></category>

		<guid isPermaLink="false">http://informationideas.com/news/?p=64</guid>
		<description><![CDATA[I was trying to get an Android app that uses Google Maps API to display a MapView running on the emulator.Â  It took quite a bit of hair pulling to finally get it working. First, I tried using a self-signed keystore instead of the the debug.keystore provided through the Android SDK.Â  I created my keystore [...]]]></description>
			<content:encoded><![CDATA[<p>I was trying to get an Android app that uses Google Maps API to display a MapView running on the emulator.Â  It took quite a bit of hair pulling to finally get it working.</p>
<p>First, I tried using a self-signed keystore instead of the the debug.keystore provided through the Android SDK.Â  I created my keystore using keytool -genkey from JDK.Â  Then I switch the app from using the default, debug.keystore, to my-new-self-signed.keystore.Â  Using keytool -list, I got the MD5 of the certificate that is needed to obtain a Google Map API key.Â  Then the API key was put into the MapView android:apikey attribute.Â  When I brought up the app in the emulator, I got a blank map grid screen.Â  The reason I wanted to use the self-signed keystore instead of the debug keystore is so I don&#8217;t have to obtain a new Map API key and change the code to reflect this upon releasing the app.</p>
<p>So, I decided to go with the debug.keystore and that worked fine.Â  Here is what I had to do.</p>
<ol>
<li>
<pre class="prettyprint">$ keytool -list -alias androiddebugkey -keystore &lt;path_to_debug_keystore&gt;.keystore -storepass android -keypass android</pre>
</li>
<li>Copy that MD5 and goto <a href="http://code.google.com/android/maps-api-signup.html">http://code.google.com/android/maps-api-signup.html</a></li>
<li>Signup for an API key</li>
<li>In my xml file that has the views for the activity, add
<pre class="prettyprint">&lt;com.google.android.maps.MapView
 android:layout_width="fill_parent"
 android:layout_height="fill_parent"
 android:enabled="true"
 android:clickable="true"
 android:apiKey="example_Maps_ApiKey_String"
 /&gt;</pre>
</li>
<li>In the Manifest.xml file, add the permissions needed<br />
&lt;uses-permission android:name=&#8221;android.permission.INTERNET&#8221;&gt;&lt;/uses-permission&gt;<br />
&lt;uses-permission android:name=&#8221;android.permission.ACCESS_FINE_LOCATION&#8221;&gt;&lt;/uses-permission&gt;</li>
<li>In the Manifest.xml file, add the maps library<br />
&lt;uses-library android:name=&#8221;com.google.android.maps&#8221; /&gt;<br />
within the application tag</li>
<li>The entire Manifest.xml looks like this<br />
&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;<br />
&lt;manifest xmlns:android=&#8221;http://schemas.android.com/apk/res/android&#8221;<br />
package=&#8221;com.informationideas.mapapp&#8221;<br />
android:versionCode=&#8221;1&#8243;<br />
android:versionName=&#8221;1.0.0&#8243;&gt;<br />
&lt;uses-permission android:name=&#8221;android.permission.INTERNET&#8221;&gt;&lt;/uses-permission&gt;<br />
&lt;uses-permission android:name=&#8221;android.permission.ACCESS_FINE_LOCATION&#8221;&gt;&lt;/uses-permission&gt;<br />
&lt;application android:icon=&#8221;@drawable/icon&#8221; android:label=&#8221;@string/app_name&#8221;&gt;<br />
&lt;uses-library android:name=&#8221;com.google.android.maps&#8221; /&gt;<br />
&lt;activity android:name=&#8221;.ShowDesktop&#8221;<br />
android:label=&#8221;@string/app_name&#8221;&gt;<br />
&lt;intent-filter&gt;<br />
&lt;action android:name=&#8221;android.intent.action.MAIN&#8221; /&gt;<br />
&lt;category android:name=&#8221;android.intent.category.LAUNCHER&#8221; /&gt;<br />
&lt;/intent-filter&gt;<br />
&lt;/activity&gt;<br />
&lt;/application&gt;<br />
&lt;/manifest&gt;</li>
<li>The default activity file should look like this
<p>package com.informationideas.mapapp;<br />
import android.os.Bundle;<br />
import com.google.android.maps.MapActivity;</p>
<p>public class ShowDesktop extends MapActivity {</p>
<p>/** Called when the activity is first created. */<br />
@Override<br />
public void onCreate(Bundle savedInstanceState) {<br />
super.onCreate(savedInstanceState);<br />
setContentView(R.layout.main);</p>
<p>}</p>
<p>@Override<br />
protected boolean isRouteDisplayed() {<br />
// TODO Auto-generated method stub<br />
return false;<br />
}<br />
}</li>
</ol>
<p>Now off to building cool things with the map!</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://informationideas.com/news/2008/11/06/getting-android-emulator-working-with-google-maps-api-key/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://informationideas.com/news/2008/11/06/getting-android-emulator-working-with-google-maps-api-key/&amp;title=Getting+Android+emulator+working+with+Google+Maps+API+Key" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://informationideas.com/news/2008/11/06/getting-android-emulator-working-with-google-maps-api-key/&amp;title=Getting+Android+emulator+working+with+Google+Maps+API+Key" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://informationideas.com/news/2008/11/06/getting-android-emulator-working-with-google-maps-api-key/&amp;t=Getting+Android+emulator+working+with+Google+Maps+API+Key" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://informationideas.com/news/2008/11/06/getting-android-emulator-working-with-google-maps-api-key/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://informationideas.com/news/2008/11/06/getting-android-emulator-working-with-google-maps-api-key/&amp;title=Getting+Android+emulator+working+with+Google+Maps+API+Key&amp;summary=I%20was%20trying%20to%20get%20an%20Android%20app%20that%20uses%20Google%20Maps%20API%20to%20display%20a%20MapView%20running%20on%20the%20emulator.%C3%82%C2%A0%20It%20took%20quite%20a%20bit%20of%20hair%20pulling%20to%20finally%20get%20it%20working.%0D%0A%0D%0AFirst%2C%20I%20tried%20using%20a%20self-signed%20keystore%20instead%20of%20the%20the%20debug.keystore%20provided%20through%20the%20Android%20SDK.%C3%82%C2%A0%20I%20creat&amp;source=Tech Blog" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://informationideas.com/news/2008/11/06/getting-android-emulator-working-with-google-maps-api-key/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Getting+Android+emulator+working+with+Google+Maps+API+Key+-+http://b2l.me/ab2vcm&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://informationideas.com/news/2008/11/06/getting-android-emulator-working-with-google-maps-api-key/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
