<?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>farp.blog &#187; Afternoon Apps</title>
	<atom:link href="http://fredandrandall.com/blog/category/afternoon-apps/feed/" rel="self" type="application/rss+xml" />
	<link>http://fredandrandall.com/blog</link>
	<description>Bloggin&#039; about whatever</description>
	<lastBuildDate>Tue, 04 Nov 2014 07:15:30 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.0.38</generator>
	<item>
		<title>Afternoon Apps: Notemark</title>
		<link>http://fredandrandall.com/blog/2013/12/30/afternoon-apps-notemark/</link>
		<comments>http://fredandrandall.com/blog/2013/12/30/afternoon-apps-notemark/#comments</comments>
		<pubDate>Mon, 30 Dec 2013 16:52:31 +0000</pubDate>
		<dc:creator><![CDATA[Randall]]></dc:creator>
				<category><![CDATA[Afternoon Apps]]></category>
		<category><![CDATA[appcache]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[localStorage]]></category>

		<guid isPermaLink="false">http://fredandrandall.com/blog/?p=778</guid>
		<description><![CDATA[I had an idea for an app the other day when I was trying to sort through the notes on my iPhone. I realized that I was using a few of the notes really often, while others just seemed to &#8230; <a href="http://fredandrandall.com/blog/2013/12/30/afternoon-apps-notemark/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://notemark.io"><img class="alignleft size-full wp-image-779" alt="NoteMarkLogo" src="http://fredandrandall.com/blog/wp-content/uploads/2013/12/NoteMarkLogo.png" width="100" height="100" /></a>I had an idea for an app the other day when I was trying to sort through the notes on my iPhone. I realized that I was using a few of the notes really often, while others just seemed to be throwaway. For example, I have a note that is a list of karaoke songs that I want to try and another note that is a list of places to eat.</p>
<p>I thought it would be neat if I could take a note and put it on the home screen as a separate app icon. I&#8217;ve done <a href="http://fredandrandall.com/blog/2012/02/05/how-to-preview-your-icon-on-the-iphone/">some work with home screen bookmarks</a> before and thought I might be able to get it done with a simple web app.</p>
<p>The result is <a href="http://notemark.io">Notemark.io</a>. Notemark lets you type out a note and saves it using HTML5 localStorage APIs. Not only does it use localStorage, but it also uses app caching. This allows Notemark to run even without an Internet connection.</p>
<p>So, in typical <a href="http://fredandrandall.com/blog/category/afternoon-apps/">Afternoon App</a> fashion, I hacked something together that&#8217;s somewhere between a proof of concept and an actual working product. Use it all you can, but just be aware that there are probably some bugs. If you notice something wrong, feel free to open an issue on <a href="https://github.com/blladnar/Notemark/issues">Github</a> or send me a message, but just be warned that I might not get around to fixing the problem.</p>
<p>I&#8217;m not a web developer by trade so the code is messy with plenty of inefficiencies. You can critique my code all you want though!</p>
]]></content:encoded>
			<wfw:commentRss>http://fredandrandall.com/blog/2013/12/30/afternoon-apps-notemark/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Afternoon Apps: Captionator</title>
		<link>http://fredandrandall.com/blog/2012/08/20/afternoon-apps-captionator/</link>
		<comments>http://fredandrandall.com/blog/2012/08/20/afternoon-apps-captionator/#comments</comments>
		<pubDate>Mon, 20 Aug 2012 04:47:19 +0000</pubDate>
		<dc:creator><![CDATA[Randall]]></dc:creator>
				<category><![CDATA[Afternoon Apps]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[coregraphics]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[quartzcore]]></category>

		<guid isPermaLink="false">http://fredandrandall.com/blog/?p=752</guid>
		<description><![CDATA[A couple weeks ago, a friend of mine showed me the app I&#8217;d Cap That. After making some hilarious pictures, and after a few drinks, I made the claim that I could probably clone the app in a couple of &#8230; <a href="http://fredandrandall.com/blog/2012/08/20/afternoon-apps-captionator/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://fredandrandall.com/blog/wp-content/uploads/2012/08/photo-3.jpg"><img class="alignleft size-medium wp-image-756" title="Captionator" src="http://fredandrandall.com/blog/wp-content/uploads/2012/08/photo-3-300x225.jpg" alt="" width="300" height="225" /></a>A couple weeks ago, a friend of mine showed me the app <a href="http://itunes.apple.com/us/app/id-cap-that/id510544616?mt=8">I&#8217;d Cap That</a>. After making some hilarious pictures, and after a few drinks, I made the claim that I could probably clone the app in a couple of hours.</p>
<p>So the other day, that&#8217;s what I tried to do. The app is very simple. It takes a randomly generated caption and burns it on to an image. You can pick an image from your camera or your library.</p>
<p>When I wrote the BD&#8217;s Mongolian BBQ app, I took stamps and burned them onto an image to create funny mustache pictures. The way I did that was to position UIImageViews inside of a UIView and then render the view to an image. That strategy works fine, but it also drops the image resolution down quite a bit. (It will be whatever the size of the view is)</p>
<p>So this time, I decided to render the text directly onto the image by hand. This involves getting a graphics context, drawing the image into it, then drawing the text into it, and finally getting the resulting UIImage from the graphics context.</p>
<p>My first approach was to use a UILabel to render the text onto the image. That would take care of all the font sizing issues and save some code. This worked great, until I had white text on a light image. There&#8217;s a couple ways to solve this problem like putting a stroke around the text or adding a shadow to the text. I&#8217;d Cap That uses a shadow. I decided to go for a more meme style look and stroke the text.</p>
<p>Unfortunately, UILabel doesn&#8217;t support adding a stroke around the text. So I looked for some classes online that might get the job done. I found a couple, but they didn&#8217;t work like I wanted. Luckily, CoreGraphics lets you draw stroked text, you just have to handle more by yourself.</p>
<pre class="brush: objc; title: ; notranslate">
-(UIImage*)getImage:(UIImage*)image withCaption:(NSString*)captionString
{
   UIGraphicsBeginImageContext([image size]);
   [image drawInRect:CGRectMake(0, 0, image.size.width, image.size.height)];

   CGFloat captionFontSize = 300;
   CGSize captionSize = [captionString sizeWithFont:[UIFont boldSystemFontOfSize:captionFontSize]];

   while( captionSize.width &gt; image.size.width )
   {
      captionFontSize -= 5;
      captionSize = [captionString sizeWithFont:[UIFont boldSystemFontOfSize:captionFontSize]];
   }

   CGRect captionRect = CGRectMake((image.size.width - captionSize.width)/2.0, (image.size.height * .95)-captionSize.height, captionSize.width, captionSize.height);

   CGContextRef context = UIGraphicsGetCurrentContext();
   CGContextSetFillColorWithColor(context, [UIColor whiteColor].CGColor);
   CGContextSetStrokeColorWithColor(context, [UIColor blackColor].CGColor);
   CGContextSetLineWidth(context, 3.0f);
   CGContextSetTextDrawingMode(context, kCGTextFillStroke);

   [captionString drawInRect:captionRect withFont:[UIFont boldSystemFontOfSize:captionFontSize]];

   UIImage *outputImage = UIGraphicsGetImageFromCurrentImageContext();

   UIGraphicsEndImageContext();
   return outputImage;
}
</pre>
<p>The problem with rendering the text yourself is that you need to size the font yourself. The way I&#8217;m doing it is picking a large font size (300 in this case) then measuring it and adjusting the font size until it fits on the image. There&#8217;s likely a better way, but this works and is fast enough.</p>
<p>I haven&#8217;t decided if I&#8217;m gonna release this app or not, like I did with my other <a title="Afternoon Apps: Descrumbled" href="http://fredandrandall.com/blog/2011/11/06/afternoon-apps-descrumbled/">Afternoon</a> <a title="Afternoon Apps 2: Scrumbled" href="http://fredandrandall.com/blog/2011/11/21/afternoon-apps-2-scrumbled/">Apps</a>. I have the <a href="https://github.com/blladnar/Captionator">source code up on GitHub</a> though, so feel free to take a look and use whatever you want from it.</p>
<p>There&#8217;s some issues with it. The camera view doesn&#8217;t work quite right. There aren&#8217;t any icons. One little feature in there is you can add to the list of captions. Of course the real secret sauce of I&#8217;d Cap That isn&#8217;t the app, it&#8217;s the hilarious captions.</p>
]]></content:encoded>
			<wfw:commentRss>http://fredandrandall.com/blog/2012/08/20/afternoon-apps-captionator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Afternoon Apps 2: Scrumbled</title>
		<link>http://fredandrandall.com/blog/2011/11/21/afternoon-apps-2-scrumbled/</link>
		<comments>http://fredandrandall.com/blog/2011/11/21/afternoon-apps-2-scrumbled/#comments</comments>
		<pubDate>Tue, 22 Nov 2011 02:02:04 +0000</pubDate>
		<dc:creator><![CDATA[Randall]]></dc:creator>
				<category><![CDATA[Afternoon Apps]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Descrumbled]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Scrumbled]]></category>

		<guid isPermaLink="false">http://fredandrandall.com/blog/?p=668</guid>
		<description><![CDATA[A few weeks ago I made an app called Descrumbled for cheating at Boggle. I wanted to see if I could build an app in a single afternoon. I built it and released it in one day. The next weekend, &#8230; <a href="http://fredandrandall.com/blog/2011/11/21/afternoon-apps-2-scrumbled/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://fredandrandall.com/blog/wp-content/uploads/2011/11/ScrumbledIcon@2x.png"><img class="alignleft size-full wp-image-670" title="ScrumbledIcon@2x" src="http://fredandrandall.com/blog/wp-content/uploads/2011/11/ScrumbledIcon@2x.png" alt="" width="114" height="114" /></a>A few weeks ago I made an app called Descrumbled for cheating at Boggle. I wanted to see <a title="Afternoon Apps: Descrumbled" href="http://fredandrandall.com/blog/2011/11/06/afternoon-apps-descrumbled/">if I could build an app in a single afternoon</a>. I built it and released it in one day. The next weekend, I found myself with some more free time and I decided to see if I could do it again. The idea was that I would take my Boggle cheating app and turn it in to a Boggle <em>playing </em>app. So I branched <a href="http://itunes.apple.com/us/app/descrumbled/id478640010?ls=1&amp;mt=8">Descrumbled</a> and got to work.</p>
<p>The hardest part of a Boggle app is knowing what words are valid. You need to take a grid of 16 letters and evaluate the thousands of possible combinations against a dictionary of over <a href="http://en.wikipedia.org/wiki/SOWPODS">200,000 words</a>. Luckily, that was already done.</p>
<p>I didn&#8217;t want this to be quite as simple as Descrumbled. I wanted to make it actually worth playing. To do this I added Game Center achievements and a social challenge option.</p>
<p>Basically, there are achievements designed to get you to play the game more. The achievements require you to do things like play 100 games and get certain high scores. There is also a leader board that people can use to see how they stack up against the rest of the world.</p>
<p>Achievements and leader boards are great, but I wanted to add a little bit of a multiplayer aspect to the game. So I added a feature so you can send someone a game board as a challenge. When they click the link in a text, tweet, or email it will open up that game board and let you play it.</p>
<p>The only other sort of interesting thing I did was with advertising. Instead of relying only on iAds, I put in an ad of my own, for Descrumbled. Sometimes iAds fail to load. When that happens, I show a button with an ad for Descrumbled asking the user if their puzzles are too hard. It&#8217;s not super exciting, but it might drive a few more people to download one of my apps and it looks better than a blank space where the ad didn&#8217;t load.</p>
<p>This app didn&#8217;t take a single afternoon. I think I spent probably 3 afternoons on it. When I had it mostly working, I decided to add the social challenge feature and had to change the way the app was architected. That took a little bit more time than I wanted it to.</p>
<p>Be sure to <a href="http://itunes.apple.com/us/app/scrumbled/id480473422?ls=1&amp;mt=8">check it out</a> and let me know what you think.</p>
]]></content:encoded>
			<wfw:commentRss>http://fredandrandall.com/blog/2011/11/21/afternoon-apps-2-scrumbled/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Afternoon Apps: Descrumbled</title>
		<link>http://fredandrandall.com/blog/2011/11/06/afternoon-apps-descrumbled/</link>
		<comments>http://fredandrandall.com/blog/2011/11/06/afternoon-apps-descrumbled/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 02:39:00 +0000</pubDate>
		<dc:creator><![CDATA[Randall]]></dc:creator>
				<category><![CDATA[Afternoon Apps]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPhone SDK]]></category>

		<guid isPermaLink="false">http://fredandrandall.com/blog/?p=650</guid>
		<description><![CDATA[At events like Startup Weekend, you try to build an idea in a weekend. I wanted to see if I could do something even faster. So I bring you Afternoon Apps, where I build an app in a single afternoon. &#8230; <a href="http://fredandrandall.com/blog/2011/11/06/afternoon-apps-descrumbled/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://fredandrandall.com/blog/wp-content/uploads/2011/11/DescrumbledLogo1.png"><img class="alignleft size-full wp-image-654" title="DescrumbledLogo" src="http://fredandrandall.com/blog/wp-content/uploads/2011/11/DescrumbledLogo1.png" alt="" width="198" height="60" /></a>At events like Startup Weekend, you try to build an idea in a weekend. I wanted to see if I could do something even faster. So I bring you <a href="http://fredandrandall.com/blog/category/afternoon-apps/">Afternoon Apps</a>, where I build an app in a single afternoon.</p>
<p><a href="http://descrumbled.com">Descrumbled</a> is an app for solving Boggle puzzles. Boggle is a word game where you have to find words hidden in a grid of letters. The app lets you enter a board and quickly generate all possible words that can be found in the puzzle. It uses the <a href="http://en.wikipedia.org/wiki/SOWPODS">SOWPODS</a> dictionary to see if a word is valid or not.</p>
<p>I was able to build the app in an afternoon because it is very simple. It lets you pick two board sizes, 4&#215;4 and 5&#215;5. Then you can enter the board, press solve, and seconds later you get a list of all the words. Pressing a word will give you the definition thanks to iOS 5&#8217;s dictionary integration.</p>
<p>The hard part was actually solving the puzzle. Generating all the possible words in the puzzle and checking them against a 230,000 word dictionary is no trivial task. I&#8217;m going to let you in on a little secret. I didn&#8217;t write the boggle solver in a single afternoon. I had written it before by working on it a few hours a day for 3 or so days. It was a programming challenge I found online and I tried to do it. It&#8217;s actually a lot of fun solving a problem like this. I get to think about tries and binary searches. Things I haven&#8217;t actually had to think much about since college. My first stab at it took about 3 minutes to solve a 4&#215;4 puzzle. Since most online Boggle rounds are 1 or 2 minutes, this obviously wasn&#8217;t acceptable. I improved my algorithm and now it takes ~1 second to solve a 5&#215;5 puzzle.</p>
<p>So what did I actually do in an afternoon? I built a UI around my boggle solver class. I had to get a C++ class working on the iPhone (which is actually really easy) and build a UI for entering the board. The squares on the board auto advance the cursor through a grid of UITextFields. It also makes sure the board is complete before it tries to solve. Then I had to make a way to clear the board and switch between a 4&#215;4 grid and a 5&#215;5 grid. The word list UI is just a very simple UITableView. When you press a row, it will open up the definition of the word in a UIReferenceLibraryViewController (new in iOS 5).</p>
<p>That&#8217;s it. The app is meant to be simple and easy to use. It really is a <a href="http://en.wikipedia.org/wiki/Minimum_viable_product">minimum viable product</a>. I did this as an exercise to see if I could build a simple app and submit it to the app store in an afternoon. I want to keep doing these Afternoon Apps every few weeks. I&#8217;d love to see if other people have done similar things and find out how your experience went.</p>
<p>The app should be live any day now. <a href="http://descrumbled.com">Check it out!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://fredandrandall.com/blog/2011/11/06/afternoon-apps-descrumbled/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
