<?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</title>
	<atom:link href="http://blog.indieiphonedev.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.indieiphonedev.com</link>
	<description>Trials and tribulations of an independent iPhone developer</description>
	<lastBuildDate>Sat, 04 Sep 2010 04:41:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>MGTwitterEngine and Locations</title>
		<link>http://blog.indieiphonedev.com/2010/09/03/mgtwitterengine-and-locations/</link>
		<comments>http://blog.indieiphonedev.com/2010/09/03/mgtwitterengine-and-locations/#comments</comments>
		<pubDate>Sat, 04 Sep 2010 04:35:41 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[GPS]]></category>
		<category><![CDATA[iPhone app]]></category>
		<category><![CDATA[iPhone OS]]></category>
		<category><![CDATA[objective-C]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://blog.indieiphonedev.com/?p=212</guid>
		<description><![CDATA[How to implement location of tweets from iPhone applications using the MGTwitterEngine.]]></description>
			<content:encoded><![CDATA[<p>So Twitter just updated their API to disallow the use of authentication through the REST API.  They were nice enough to announce that in an email 2 days after they turned it off so that meant that I had to learn all about OAuth overnight and scramble to find something that could take over the Twitter functionality of the LogYourRun iPhone app.</p>
<p>Luckily most of the leg work in this are has been done by Matt Gemmell and his <a href="http://mattgemmell.com/2008/02/22/mgtwitterengine-twitter-from-cocoa">Twitter engine</a>.  Some slight modifications are required in order to get it <a href="http://github.com/bengottlieb/Twitter-OAuth-iPhone">running on the iPhone</a> and <a href="http://www.2bros1blog.com/2010/07/switching-from-basic-to-xauth-with-mgtwitterengine-on-iphone/">working with OAuth</a>.</p>
<p>With these libraries dropped in the new Twitter authentication system is fairly easy to implement.  The main problem is that the MGTwitterEngine does not support the Twitter location API.  Since this is an important piece of <a href="http://tweetmydistance.com/">TweetMyDistance</a> I modified the MGTwitterEngine.m and added a function for tweeting with location.  The new method takes latitude and longitude as well as the tweet and if this is a reply to a previous tweet.  As you can see from <a href="http://twitter.com/tim221175/statuses/22930742608">my tweet</a> it works great.  The code below should replace the code in MGTwitterEngine and don&#8217;t forget to also update your .h file.</p>
<p><PRE>
<pre class="brush: objc;">
- (NSString *)sendUpdate:(NSString *)status
{
    return [self sendUpdate:status inReplyTo:0];
}

- (NSString *)sendUpdate:(NSString *)status inReplyTo:(unsigned long)updateID
{

	return [self sendUpdate: status inReplyTo: updateID withLatitude: 0.0 andLongitude: 0.0];

}

- (NSString *)sendUpdate:(NSString *)status
			   inReplyTo:(unsigned long)updateID
			withLatitude:(double) lat
			andLongitude: (double) lng
{
	if (!status) {
        return nil;
    }

    NSString *path = [NSString stringWithFormat:@&quot;statuses/update.%@&quot;, API_FORMAT];

    NSString *trimmedText = status;
    if ([trimmedText length] &gt; MAX_MESSAGE_LENGTH) {
        trimmedText = [trimmedText substringToIndex:MAX_MESSAGE_LENGTH];
    }

    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:0];
    [params setObject:trimmedText forKey:@&quot;status&quot;];
    if (updateID &gt; 0) {
        [params setObject:[NSString stringWithFormat:@&quot;%u&quot;, updateID] forKey:@&quot;in_reply_to_status_id&quot;];
    }
    if (lat != 0.0 &amp;&amp; lng != 0.0) {
		// lat=%1.6f&amp;long=%1.6f&amp;display_coordinates=true
        [params setObject:[NSString stringWithFormat:@&quot;%1.6f&quot;, lat] forKey:@&quot;lat&quot;];
        [params setObject:[NSString stringWithFormat:@&quot;%1.6f&quot;, lng] forKey:@&quot;long&quot;];
        [params setObject:@&quot;true&quot; forKey:@&quot;display_coordinates&quot;];
    }
    NSString *body = [self _queryStringWithBase:nil parameters:params prefixed:NO];

	DLog(@&quot; twitterbody: %@&quot;, body);

    return [self _sendRequestWithMethod:HTTP_POST_METHOD path:path
                        queryParameters:params body:body
                            requestType:MGTwitterUpdateSendRequest
                           responseType:MGTwitterStatus];
}
</pre>
</pRE>
]]></content:encoded>
			<wfw:commentRss>http://blog.indieiphonedev.com/2010/09/03/mgtwitterengine-and-locations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LogYourRun Version 2.8 for iPhone</title>
		<link>http://blog.indieiphonedev.com/2010/06/17/logyourrun-version-2-8-for-iphone/</link>
		<comments>http://blog.indieiphonedev.com/2010/06/17/logyourrun-version-2-8-for-iphone/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 17:38:26 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[iPhone marketing]]></category>

		<guid isPermaLink="false">http://blog.indieiphonedev.com/?p=209</guid>
		<description><![CDATA[To make full use of the new features of the new iOS4, I have updated the LogYourRun iPhone application to support running the app in the background. Background GPS is supported on the new iPhone 4 as well as the 3GS. Running the app in the background means that you will no longer have to [...]]]></description>
			<content:encoded><![CDATA[<p>To make full use of the new features of the new iOS4, I have updated the LogYourRun iPhone application to support running the app in the background.  Background GPS is supported on the new iPhone 4 as well as the 3GS.  Running the app in the background means that you will no longer have to worry about leaving the app on the screen and what will happen when you get a text or a phone call while running.  Also, locking the screen will greatly improve the battery life and let you run longer without worrying about the battery draining.  In recent tests on a 3GS iPhone I was able to run the program in the background for 1 hour after which the battery was down 12%.  This is a 2x improvement over the battery consumption if the app is run with the screen on.</p>
<p>While running in the background the app turns off the pedometer &#8211; so you will only be getting GPS information.  But the option for automatically tweeting every mile or so will still work as long as there is a data connection available.</p>
<p>As you run the application badge (number in red circle in top left corner of the app) will show your distance so you will not forget that the application is collecting data.  Also the location services icon will be displayed in your status bar. Once the iOS4 NDA is lifted I will post some pictures of the app in action.</p>
<p>Additional features in 2.8 include:</p>
<p> * In case of emergency (ICE) contact information &#8211; enter name and phone number and you will be able to easily call your ICE person straight from the app.<br />
 * Power save button.  Get most of the benefits of running the app in the background even if your phone does not support background apps.  This button stops the screen from updating and turns off the pedometer for some extra power savings.</p>
<p>For more information please see:<br />
<a href=" http://www.logyourrun.com/iphone/"></p>
<p>http://www.logyourrun.com/iphone/</a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.indieiphonedev.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.indieiphonedev.com/2010/06/17/logyourrun-version-2-8-for-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrading 1st gen MacBook Air with SSDHD</title>
		<link>http://blog.indieiphonedev.com/2010/05/01/upgrading-1st-gen-macbook-air-with-ssdhd/</link>
		<comments>http://blog.indieiphonedev.com/2010/05/01/upgrading-1st-gen-macbook-air-with-ssdhd/#comments</comments>
		<pubDate>Sat, 01 May 2010 17:49:22 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://blog.indieiphonedev.com/?p=199</guid>
		<description><![CDATA[Like most computers, over time my first generation MacBook Air was starting to no-longer perform as well as when I got it. Partly this is a perception issue since I do most of my development on an dual quad core MacPro, but partly this was also due to a failing hard drive and the general [...]]]></description>
			<content:encoded><![CDATA[<p>Like most computers, over time my first generation MacBook Air was starting to no-longer perform as well as when I got it.  Partly this is a perception issue since I do most of my development on an dual quad core MacPro, but partly this was also due to a failing hard drive and the general accumulation of software and background processes.  Since I was going to get a new HD I thought that I might as well get a solid state drive.  These drives have no moving parts so should not be as prone to failure &#8211; but more importantly these drives are orders of magnitude faster than spinning disk HDs.</p>
<div id="attachment_202" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.indieiphonedev.com/wp-content/uploads/2010/05/DSC075461.jpg"><img class="size-medium wp-image-202" title="Transfering file system from internal HD to runcore SSD" src="http://blog.indieiphonedev.com/wp-content/uploads/2010/05/DSC075461-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">Transferring file system  from internal HD to runcore SSD</p></div>
<p>I got my drive from runcore &#8211; it comes with a nice kit for copying the contents of your old drive to the new drive &#8211; but the screwdriver that they send with the kit is not use able for opening the laptop so make sure you have a good screwdriver handy.  Before installation I did a speed test using the timer on the iPod touch to test the speed of opening iTunes, Word, Excel and Xcode.  Installation was pretty easy but not something you should attempt if you are non-technical.  Before final installation I did a time machine backup to ensure all my data was safe.</p>
<div id="attachment_203" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.indieiphonedev.com/wp-content/uploads/2010/05/DSC07548.jpg"><img class="size-medium wp-image-203" title="Internals of the MacBook Air" src="http://blog.indieiphonedev.com/wp-content/uploads/2010/05/DSC07548-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">Internals of the MacBook Air</p></div>
<p>After successful installation (for some reason the desktop background picture did not transfer) I did my speed tests again.  iTunes went from 20 seconds to load to less than 3 seconds.  This drive is fast as lightning!!!  As a matter of fact the MacBook Air now opens applications faster than my 8 core MacPro!  Data crunching such as building in Xcode is still faster on the MacPro &#8211; but it is now acceptable on the MacBook Air.  I am very impressed with the SSD and would definitely recommend this option to anyone getting a new MAcBook Air or as a replacement for people with older MacBook Airs &#8211; it has re-energized my old computer and now allows me to develop on the road!</p>
<p>I did a test where I put 5 files int my dropbox folder and opened them on both the MacPro and the MacBook Air at the same time.  The documents opened: Excel, Word, Preview, Xcode, and iTunes.  As you can see from the video the MacBook Air was only slightly slower at opening these documents and party this was because Excel needed to do some importing/data crunching before opening the document.  iTunes started almost at the same time on the two computers as did Xcode.</p>
<div id="attachment_205" class="wp-caption aligncenter" style="width: 303px"><a href="http://blog.indieiphonedev.com/wp-content/uploads/2010/05/Screen-shot-2010-05-01-at-12.37.51-PM.png"><img class="size-medium wp-image-205" title="The files used in the speed test" src="http://blog.indieiphonedev.com/wp-content/uploads/2010/05/Screen-shot-2010-05-01-at-12.37.51-PM-293x300.png" alt="" width="293" height="300" /></a><p class="wp-caption-text">The files used in the speed test.</p></div>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/8KJBeL5NG2s&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/8KJBeL5NG2s&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.indieiphonedev.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.indieiphonedev.com/2010/05/01/upgrading-1st-gen-macbook-air-with-ssdhd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Converting App from iPhone to Universal</title>
		<link>http://blog.indieiphonedev.com/2010/04/29/converting-app-from-iphone-to-universal/</link>
		<comments>http://blog.indieiphonedev.com/2010/04/29/converting-app-from-iphone-to-universal/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 03:54:47 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone app]]></category>
		<category><![CDATA[objective-C]]></category>
		<category><![CDATA[source code]]></category>

		<guid isPermaLink="false">http://blog.indieiphonedev.com/?p=194</guid>
		<description><![CDATA[With the iPad selling like hot cakes it seems like a good idea to get on the bandwagon and make some apps for the iPad.  The LogYourRun app is not particularly well suited for running on the iPad &#8211; I doubt that people will be strapping their iPads to their arms and run around the [...]]]></description>
			<content:encoded><![CDATA[<p>With the iPad selling like hot cakes it seems like a good idea to get on the bandwagon and make some apps for the iPad.  The LogYourRun app is not particularly well suited for running on the iPad &#8211; I doubt that people will be strapping their iPads to their arms and run around the park.  However, the heart rate app seems like something that people would enjoy using even on iPads.  Since I did not want to have to maintain two separate apps I decided to make the app universal.  This was actually quite an easy process and took only about 10-12 hours (could have been faster if I had known what I was doing &#8211; which is why I wanted to share what I learned).</p>
<p>First step is to make sure you copy your application folder so you will be able to go back to the original application if you mess up.  Then with your newly copied application upgrade your target to work on the iPad in addition to the iPhone.  Click on your target and go into the menu &#8211; under Project you will find an entry that says &#8220;upgrade current target for iPad&#8221;.  Select the &#8220;One Universal application&#8221; option.  This will generate a new group which contains your new iPad version of the MainWindow.xib file &#8211; MainWindow-iPad.xib.  You can use this new nib to load all your iPad specific views.</p>
<p>At this point I went through all my existing nibs and created iPad versions (can be done in the Interface Builder) and saved them as XxxViewController-iPad.xib in the Resources-iPad folder.  For iPad nibs you have to make sure that you have versions of the nib that look decent and are usable in both landscape and horizontal orientations.  This can be tricky if you have a lot of UI elements but is very important since iPad apps have to support all orientations.  Make sure you anchor your UI elements to the right edges and that they scale to look nice.</p>
<p>The heart rate app uses a tab bar.  It took me the longest time to figure out how to get this to rotate.  The reason for this was that I had not read <a href="http://developer.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html#//apple_ref/doc/uid/TP40007457-CH102-SW26" target="_blank">Apple&#8217;s documentation</a>.  Turns out that <strong>all</strong> the view controllers that the tab bar links to have to return YES for all shouldAutorotateToInterfaceOrientation: orientations.  This makes sense conceptually.  In addition you need to <a href="http://blog.costan.us/2009/01/auto-rotating-tab-bars-on-iphone.html">set your view controllers</a> to automatically resize when rotation occurs.  Once these are set you will be able to see what the rotation looks like in the iPad simulator (hopefully great).</p>
<p>Loading the iPad specific nibs using the view controller is a great way to get these to show up on the iPad only &#8211; but there are some cases where you will need to load a view controller programatically (in my case when the user clicks on the help button it brings up the help VC).  To make sure that you load the right nib you can check if the app is running on the iPad.  The following code is what I used:</p>
<pre>
<pre class="brush: objc;">
- (BOOL) isIPad {
#if (__IPHONE_OS_VERSION_MAX_ALLOWED &gt;= 30200)
  if ([[UIDevice currentDevice] respondsToSelector: @selector(userInterfaceIdiom)])
    return ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad);
#endif

  return NO;
}
</pre>
</pre>
<p>This code will check if the iDevice responds to the userInterfaceIdiom selector and if it does it checks if the device is an iPad.  If it is I load the iPad version of the helpVC if not then I load the iPhone version of the helpVC.  Make sure you also put the respondToRotation in these VCs since they will need to respond predictably also.</p>
<p>Finally you will need to create a default image that can be presented on the iPhone.  In your info.plist you can set the &#8220;Launch image (iPad)&#8221; to the base name of the iPad graphic (e.g. Default-iPad.png).  You can then create two images named Default-iPad-Landscape and Default-iPad-Portrait and add them to your project.  The iPad will pick whichever of the default images that fits with the rotation of the device.</p>
<p>When uploading your app &#8211; build the app in OS3.2.  The app will run on both iPhone and iPad from one binary. You will also have to upload screenshots for the iPad version for display in the iPad app store and create two new icons (50&#215;50 and 72&#215;72).  Once you have all that together your app is ready for submission and you can start praying that it will be a speedy path to acceptance.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.indieiphonedev.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.indieiphonedev.com/2010/04/29/converting-app-from-iphone-to-universal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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 addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.indieiphonedev.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></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>iPhone OS 4.0</title>
		<link>http://blog.indieiphonedev.com/2010/04/09/iphone-os-4-0/</link>
		<comments>http://blog.indieiphonedev.com/2010/04/09/iphone-os-4-0/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 15:45:39 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[google maps]]></category>
		<category><![CDATA[iPhone OS]]></category>
		<category><![CDATA[multitasking]]></category>

		<guid isPermaLink="false">http://blog.indieiphonedev.com/?p=171</guid>
		<description><![CDATA[Great news for all the running/biking/hiking iPhone applications yesterday &#8211; OS 4.0 will not only allow you to run location based apps in the background &#8211; but you can now also have much richer overlays for maps.  These updates to the  iPhone OS will make it possible to make running apps that will really take [...]]]></description>
			<content:encoded><![CDATA[<p>Great news for all the running/biking/hiking iPhone applications yesterday &#8211; OS 4.0 will not only allow you to run location based apps in the background &#8211; but you can now also have much richer overlays for maps.  These updates to the  iPhone OS will make it possible to make running apps that will really take advantage of the iPhone hardware and bring great experiences to the active people using these apps.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.indieiphonedev.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.indieiphonedev.com/2010/04/09/iphone-os-4-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My take on iPhone vs android phones</title>
		<link>http://blog.indieiphonedev.com/2010/03/30/my-take-on-iphone-vs-android-phones/</link>
		<comments>http://blog.indieiphonedev.com/2010/03/30/my-take-on-iphone-vs-android-phones/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 22:10:47 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[iPhone app]]></category>

		<guid isPermaLink="false">http://blog.indieiphonedev.com/?p=163</guid>
		<description><![CDATA[The android phone to me is a me-to device.  When meeting people with android phones the first thing that comes to mind is not &#8220;wow cool phone&#8221; it is &#8220;poor guy &#8211; he was not able to get an iPhone&#8221;.  I am in the same boat &#8211; I am on T-mobile and I refuse to [...]]]></description>
			<content:encoded><![CDATA[<p>The android phone to me is a me-to device.  When meeting people with android phones the first thing that comes to mind is not &#8220;wow cool phone&#8221; it is &#8220;poor guy &#8211; he was not able to get an iPhone&#8221;.  I am in the same boat &#8211; I am on T-mobile and I refuse to buy a $300  hand-me-down iPhone on e-bay so I still use my 2 year old blackberry  phone.  I do not believe that anyone goes to their carrier to get a new phone and think &#8220;I really want an android phone&#8221; (except for a few hardcore geeks and lifehackers) &#8211; but people are very excited to get their first iPhone.</p>
<p>Now, I was very excited at the end of 2008 when rumors were that Google was going to launch their new phone and totally change the customer/carrier cell phone relationship.  Obviously I was sorely disappointed when the Nexus One came out and it was still tied to a carrier plan (true it is not absolutely tied but at the price of $500+ for a phone I consider it as such).  In retrospect the interesting thing is that I was not excited to get an android phone &#8211; I was excited to get an iPhone-like phone and to be able to break the contractual relationship between me and my carrier.  Don&#8217;t get me wrong &#8211; I love T-mobile &#8211; that is the only reason why I am still using my old blackberry.  But for a phone to really be revolutionary it would be great to get it without a 2 year jail sentence called a &#8220;contract&#8221;.</p>
<p>Depending on what comes out this summer and for what carrier I may sign up for another go to jail card and finally get the device that I have been developing for for the last 2 years.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.indieiphonedev.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.indieiphonedev.com/2010/03/30/my-take-on-iphone-vs-android-phones/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using audio services to play alert sound</title>
		<link>http://blog.indieiphonedev.com/2010/03/22/using-audio-services-to-play-alert-sound/</link>
		<comments>http://blog.indieiphonedev.com/2010/03/22/using-audio-services-to-play-alert-sound/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 04:24:36 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[iPhone app]]></category>
		<category><![CDATA[objective-C]]></category>
		<category><![CDATA[sounds]]></category>
		<category><![CDATA[source code]]></category>

		<guid isPermaLink="false">http://blog.indieiphonedev.com/?p=150</guid>
		<description><![CDATA[Some times it your application may inadvertently quit with out the user meaning to quit your app.  For example people run with the running/GPS app and the iPhone may be in a pocket / arm band / hand where the square button could be pressed unintentionally.  If the app quits while running it will not [...]]]></description>
			<content:encoded><![CDATA[<p>Some times it your application may inadvertently quit with out the user meaning to quit your app.  For example people run with the running/GPS app and the iPhone may be in a pocket / arm band / hand where the square button could be pressed unintentionally.  If the app quits while running it will not collect running data for the rest of the run and the user will be very disappointed.  To avoid this I have setup an alert which will make a sound if the user quits the app while the app is collecting running data.  I was able to find the original apple alert aiff files via Google and I chose to implement the Indigo sound as the alert &#8211; the cricket is not really loud enough to be an alert sound.</p>
<p>By implementing the playback of the sound as an alert sound the sound will be played even on the 1st gen iPod Touch which does not have a speaker.  Alert sounds can also be set to finish playback after the app finishes &#8211; which is an important feature for this use.  I was able to find how to set this property on <a href="http://nagano.monalisa-au.org/?p=721">Nagano&#8217;s blog</a>.  Not sure what most of the page says but the language of Objective C is universal. Remember to add the audiotoolbox to your project.</p>
<pre class="brush: objc;">

#include &amp;lt;AudioToolbox/AudioToolbox.h&amp;gt;
</pre>
<p>I then load the sound in the viewDidLoad init function for the view controller where I want to play the sound &#8211; this way you are not trying to load the sound as the app is quitting.  The soundFileObject isa global for this VC.</p>
<pre class="brush: objc;">
// SOUNDS
 NSString *path = [[NSBundle mainBundle] pathForResource:@&amp;quot;Indigo&amp;quot; ofType:@&amp;quot;aiff&amp;quot;];
 NSURL *fileURL = [NSURL fileURLWithPath:path];

 OSStatus err;
 err = AudioServicesCreateSystemSoundID((CFURLRef)fileURL, &amp;amp;soundFileObject);
 if(err) {
   DLog(@&amp;quot;AudioServicesCreateSystemSoundID err = %d&amp;quot;,err);
   exit(1);
 }

 UInt32 flag = 1;
 err = AudioServicesSetProperty(kAudioServicesPropertyCompletePlaybackIfAppDies,
     sizeof(UInt32),
     &amp;amp;soundFileObject,
     sizeof(UInt32),
     &amp;amp;flag);
 if(err){
   DLog(@&amp;quot;AudioServicesSetProperty err = %d&amp;quot;,err);
 }
</pre>
<p>Then under viewWillDisappear I have the following:</p>
<pre class="brush: objc;">
 if (runActivity.isStarted) {
   // play alert sound if exiting while running
   AudioServicesPlayAlertSound (self.soundFileObject);
 }
</pre>
<p>This way the sound will play if the view is unloading while the user is expecting the app to be collecting data.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.indieiphonedev.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.indieiphonedev.com/2010/03/22/using-audio-services-to-play-alert-sound/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Driving traffic to your app by launching free tools</title>
		<link>http://blog.indieiphonedev.com/2010/03/16/driving-traffic-to-your-app-by-launching-free-tools/</link>
		<comments>http://blog.indieiphonedev.com/2010/03/16/driving-traffic-to-your-app-by-launching-free-tools/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 18:13:46 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[iPhone marketing]]></category>
		<category><![CDATA[advertisement]]></category>
		<category><![CDATA[app store]]></category>
		<category><![CDATA[free app]]></category>
		<category><![CDATA[iPhone app]]></category>

		<guid isPermaLink="false">http://blog.indieiphonedev.com/?p=147</guid>
		<description><![CDATA[LogYourRun is a site for active people &#8211; runners, hikers, and cyclists.  To generate interest and app sales for the paid version of the LogYourRun iPhone app I have decided to launch a series of free running tools.  The hope is that the target audience of LogYourRun will be looking for apps that can solve [...]]]></description>
			<content:encoded><![CDATA[<p>LogYourRun is a site for active people &#8211; runners, hikers, and cyclists.  To generate interest and app sales for the paid version of the LogYourRun iPhone app I have decided to launch a series of free running tools.  The hope is that the target audience of LogYourRun will be looking for apps that can solve simple problems for them &#8211; such as measure heart rate and calculate heart rate zones and calculate pace based on distance and time &#8211; and they download these apps they will see advertisement for the paid LogYourRun app which will potentially dive sales of this app.</p>
<p>Here are the free apps:</p>
<ol>
<li>A free version of the GPS/pedometer app.</li>
<li>A free heart rate measurement tool.</li>
<li>A free Pace Calculator</li>
</ol>
<p>All of these are tools that runners might look for on the app store and all of these apps have links to the full LogYourRun app and the YouTube video showing what a great app that is.</p>
<p>The LYR Free (GPS/pedometer) has been in the app store for several months but interestingly has not  been hugely successful maybe because of the lack of brand name  recognition or because the paid version is so cheap</p>
<p>The Heart Rate tool (HR) has proved to be hugely successful &#8211; probably because it is one of the few free apps that will let you measure your heart rate and calculate your heart rate zones.  I still need to integrate pinch analytics to see if this is actually driving traffic to the full app &#8211; but since the HR app has launched the sales for the full app has gone up 3 fold.</p>
<p>The Pace Calculator will go live this week and I look forward to seeing the response to this app.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.indieiphonedev.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.indieiphonedev.com/2010/03/16/driving-traffic-to-your-app-by-launching-free-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WebKitErrorDomain error 101</title>
		<link>http://blog.indieiphonedev.com/2010/02/19/webkiterrordomain-101/</link>
		<comments>http://blog.indieiphonedev.com/2010/02/19/webkiterrordomain-101/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 00:48:21 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[error code]]></category>
		<category><![CDATA[iPhone app]]></category>
		<category><![CDATA[objective-C]]></category>
		<category><![CDATA[source code]]></category>

		<guid isPermaLink="false">http://blog.indieiphonedev.com/?p=136</guid>
		<description><![CDATA[The LogYourRun app uses both UIWebView and NSURLRequest to communicate with the LogYourRun database.  To let users upload and access their data.  These requests often contain fields that the user enter such as running notes, distance, time etc.  I had the WebKitErrorDomain 101 error come up on occasions when users tried to send requests that [...]]]></description>
			<content:encoded><![CDATA[<p>The LogYourRun app uses both UIWebView and NSURLRequest to communicate with the LogYourRun database.  To let users upload and access their data.  These requests often contain fields that the user enter such as running notes, distance, time etc.  I had the WebKitErrorDomain 101 error come up on occasions when users tried to send requests that contained spaces that were not properly encoded.  I was not able to find any documentation on this error so it took a while to figure out what was going on.</p>
<div id="attachment_137" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.indieiphonedev.com/wp-content/uploads/2010/02/webkiterror.png"><img class="size-medium wp-image-137" title="webkiterror" src="http://blog.indieiphonedev.com/wp-content/uploads/2010/02/webkiterror-300x172.png" alt="" width="300" height="172" /></a><p class="wp-caption-text">WebKitErrorDomain error 101</p></div>
<p>Once I identified that the issue was that some users had a space in their username it is a very easy fix.  Just use the stringByAddingPercentEscapesUsingEncoding function to have the string properly encoded:</p>
<pre class="brush: objc;">
[username stringByAddingPercentEscapesUsingEncoding: NSASCIIStringEncoding];
</pre>
<p>So if you come along a WebKitErrorDomain 101 error &#8211; take a look at the URL you are trying to submit and see if all the parts of it are properly encoded.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.indieiphonedev.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.indieiphonedev.com/2010/02/19/webkiterrordomain-101/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
