<?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>Indie iPhone Development Blog &#187; core location</title>
	<atom:link href="http://blog.indieiphonedev.com/tag/core-location/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.indieiphonedev.com</link>
	<description>The musings of an independent iPhone developer</description>
	<lastBuildDate>Mon, 20 Jun 2011 18:48:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Elevation for routes</title>
		<link>http://blog.indieiphonedev.com/2010/04/09/elevation-for-routes/</link>
		<comments>http://blog.indieiphonedev.com/2010/04/09/elevation-for-routes/#comments</comments>
		<pubDate>Sat, 10 Apr 2010 00:57:25 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[core location]]></category>
		<category><![CDATA[google maps]]></category>
		<category><![CDATA[GPS]]></category>
		<category><![CDATA[iPhone app]]></category>

		<guid isPermaLink="false">http://blog.indieiphonedev.com/?p=173</guid>
		<description><![CDATA[I have been playing around with the GPS functionality of the iPhone for a while now and I think I have optimized the collection of in-plane GPS data as best as possible given the limitations of the hardware.  The iPhone was not created to be a garmin forerunner and this especially shines through when you [...]]]></description>
			<content:encoded><![CDATA[<p>I have been playing around with the GPS functionality of the iPhone for a while now and I think I have optimized the collection of in-plane GPS data as best as possible given the limitations of the hardware.  The iPhone was not created to be a garmin forerunner and this especially shines through when you try to get elevation data out of the iPhone GPS.  This became painfully obvious after I built the functionality for collecting and displaying elevation data from the GPS.  Even after creating sophisticated methods for filtering the GPS data and averaging the data and weighing the data by the vertical accuracy the graphs of the running data had no correlation with reality.  At first this was disappointing &#8211; I had created this great code for collecting, saving, and displaying the elevation data but clearly if I released an app which was going to show unrealistic elevation data &#8211; the app would get killed by bad reviews.</p>
<p>So I looked around for other places to get elevation data.  Turns out that the space station has used lasers to measure elevation all over the surface of the earth and that Google has an API which allows you to query that data.  This means much better resolution on the elevation data than a GPS (even a garmin) could ever provide and I can show elevation data for both current routes as well as routes that have been saved which have no elevation data saved with them.  The only issue is that a data connection is required in order to get at this data but the amount of data being sent back and forth is so small that the elevation data shows up almost instantly even on an EDGE connection.  Being a good citizen I only have the app request elevation data if the user is interested in seeing this type of data &#8211; this keeps data usage down and keeps load off Google&#8217;s servers.</p>
<p>The video below shows how the elevation data is displayed within the app.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/UzgwUBM23ww&amp;hl=en_US&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/UzgwUBM23ww&amp;hl=en_US&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.indieiphonedev.com%2F2010%2F04%2F09%2Felevation-for-routes%2F&amp;title=Elevation%20for%20routes" id="wpa2a_2"><img src="http://blog.indieiphonedev.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.indieiphonedev.com/2010/04/09/elevation-for-routes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to test location and accelerometer functions from the comfort of your home</title>
		<link>http://blog.indieiphonedev.com/2010/02/07/how-to-test-location-and-accelerometer-functions-from-the-comfort-of-your-home/</link>
		<comments>http://blog.indieiphonedev.com/2010/02/07/how-to-test-location-and-accelerometer-functions-from-the-comfort-of-your-home/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 03:01:11 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[accelerometer]]></category>
		<category><![CDATA[core location]]></category>
		<category><![CDATA[google maps]]></category>
		<category><![CDATA[iPhone app]]></category>
		<category><![CDATA[objective-C]]></category>
		<category><![CDATA[source code]]></category>

		<guid isPermaLink="false">http://blog.indieiphonedev.com/?p=123</guid>
		<description><![CDATA[The LogYourRun iPhone app uses both the GPS and the accelerometer functions of the iPhone.  Neither the GPS nor the accelerometer can be accessed on the iPhone simulator so to circumvent this I used the following methods: Accelerometer: Otto Chrons has a great Google code project which contains the code for an app that can [...]]]></description>
			<content:encoded><![CDATA[<p>The LogYourRun iPhone app uses both the GPS and the accelerometer functions of the iPhone.  Neither the GPS nor the accelerometer can be accessed on the iPhone simulator so to circumvent this I used the following methods:</p>
<p><strong>Accelerometer: </strong> Otto Chrons has a great <a href="http://code.google.com/p/accelerometer-simulator/wiki/Home" target="_blank">Google code project</a> which contains the code for an app that can be run on an iPod touch or iPhone which is on the same subnet as your development computer.  The app will transmit accelerometer data which can be caught by some code that you can insert into your Xcode project.  When you run your app on the iPhone simulator it will thus receive the accelerometer data from the real life device.  This was a great help in troubleshooting the setup of the pedometer functionality.  I was running around in my living room counting steps and comparing to the # of steps on the iPhone simulator.  Be sure to remove the accelerometer simulator code from your application before releasing.</p>
<p><strong>GPS:</strong> Everyone who has played with the location manager on the iPhone Simulator knows that you will only get only one location from the location manager on the iPhone Simulator.  Testing the GPS functionality is a critical part of testing the LogYourRun app.  I could run the app on an iPhone and then run/walk/drive around outside &#8211; but that would take much too long and the weather in Saint Louis is not conductive to such testing.  Instead I added a button to the pedometer screen of the application which when clicked runs the following code:</p>
<pre class="brush: objc; title: ; notranslate">
- (IBAction) locationButton:(id)sender {
   CLLocation *thisLocation;
   double latitude  = 37.33168900 + (float) ((random() % 100) +1) / 1000000.0;
   double longitude = -122.03073100 + (float) ((random() % 100) +1) / 1000000.0;
   thisLocation = [[CLLocation alloc] initWithLatitude:latitude longitude:longitude];
   [self locationManager:locationManager didUpdateToLocation:thisLocation fromLocation:thisLocation];
   [thisLocation release];
}</pre>
<p>This piece of code creates a random location close to the location that the iPhone Simulator will usually get from the core location (One Infinite Loop).  The location is sent to the location manager delegate function of the pedometer class and is handled as if it came from the real location manager.  Since the location is different from the previous location the getDistanceFrom: still works.  When I am ready to submit the application all I have to do is hide the two buttons (probably should be done programatically &#8211; since one of these days I will forget).</p>
<div id="attachment_122" class="wp-caption aligncenter" style="width: 210px"><a href="http://blog.indieiphonedev.com/wp-content/uploads/2010/02/Screenshot.png"><img class="size-medium wp-image-122" title="Pedometer showing location and step button" src="http://blog.indieiphonedev.com/wp-content/uploads/2010/02/Screenshot-200x300.png" alt="Pedometer showing location and step button" width="200" height="300" /></a><p class="wp-caption-text">The pedometer screen showing location and step button</p></div>
<p style="text-align: center;">
<div id="attachment_127" class="wp-caption aligncenter" style="width: 210px"><a href="http://blog.indieiphonedev.com/wp-content/uploads/2010/02/Screenshot-2010.02.07-21.45.30.png"><img class="size-medium wp-image-127" title="Locations shown on map" src="http://blog.indieiphonedev.com/wp-content/uploads/2010/02/Screenshot-2010.02.07-21.45.30-200x300.png" alt="Locations shown on map" width="200" height="300" /></a><p class="wp-caption-text">The random locations shown on map</p></div>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.indieiphonedev.com%2F2010%2F02%2F07%2Fhow-to-test-location-and-accelerometer-functions-from-the-comfort-of-your-home%2F&amp;title=How%20to%20test%20location%20and%20accelerometer%20functions%20from%20the%20comfort%20of%20your%20home" id="wpa2a_4"><img src="http://blog.indieiphonedev.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.indieiphonedev.com/2010/02/07/how-to-test-location-and-accelerometer-functions-from-the-comfort-of-your-home/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

