<?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>KernelCrash &#187; iphone</title>
	<atom:link href="http://www.kernelcrash.com/blog/category/iphone/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kernelcrash.com/blog</link>
	<description>the difference that is no difference makes no difference</description>
	<lastBuildDate>Mon, 03 May 2010 04:59:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Google App Engine</title>
		<link>http://www.kernelcrash.com/blog/google-app-engine/2009/03/26/</link>
		<comments>http://www.kernelcrash.com/blog/google-app-engine/2009/03/26/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 04:46:21 +0000</pubDate>
		<dc:creator>kernel</dc:creator>
				<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://www.kernelcrash.com/blog/?p=216</guid>
		<description><![CDATA[I&#8217;m still working on this iphone game with a fellow iphone developer and another guy doing the graphics. As we get closer to release, I&#8217;m looking into how to implement an online top scores engine. It&#8217;s quite a complex problem. Here&#8217;s a few considerations

Do you always submit the user&#8217;s score to an online server?
How do [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m still working on this iphone game with a fellow iphone developer and another guy doing the graphics. As we get closer to release, I&#8217;m looking into how to implement an online top scores engine. It&#8217;s quite a complex problem. Here&#8217;s a few considerations</p>
<ol>
<li>Do you always submit the user&#8217;s score to an online server?</li>
<li>How do you submit the score so that no one can snoop the traffic and spoof fake top scores?</li>
<li>What kind of resources are required to handle score submission and top score retrieval?</li>
</ol>
<p>For point 1, so far I&#8217;m asking the user for a username and email address, and only submitting the score if the email is filled in. For point 2, I have something in mind using a hash function, but haven&#8217;t fully decided yet. Point 3 is the interesting one. I read a recent interview on <a href="http://www.mobileorchard.com">Mobile Orchard</a> with an iphone game developer, and he said that he was relieved to have chosen to implement his top score engine using Google App Engine. Once a few thousand people are using your game, the load on a scoring server can be quite high.</p>
<p><a href="http://code.google.com/appengine/">Google App Engine</a> is a confusingly named google service, mainly because google also have &#8216;<a href="http://www.google.com/apps/intl/en/business/index.html">Google Apps</a>&#8216; which is not the same as &#8216;Google App Engine&#8217;. &#8216;Google Apps&#8217; is the name for the bundling of Gmail, google docs, google calendar, google sites etc. Google App Engine (AppEngine) is a virtualised service cloud thing, a bit like Amazon EC2,  except it uses google&#8217;s servers obviously, and perhaps the dealbraker for a lot of people; your app needs to be written in Python. I guess its a bit like if your web hosting provider only let you write cgi scripts in python &#8230; well sort of.</p>
<p>The really good stuff about AppEngine is that you can use it for free initially, though there are billing options if you use a lot of traffic or CPU time, and it seems quite fast. So I started looking into it as a platform for a topscores engine. I&#8217;d already hacked together some code for doing topscore submission and checking using PHP on a backend server of my own. So how to convert that into Python?</p>
<p>Well for starters I needed to learn Python. Yes, I am a sysadmin and I haven&#8217;t looked into Python at all in the past few years. Yes I too read that it was meant to be great <img src='http://www.kernelcrash.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  So I had a look at the <a href="http://oreilly.com/catalog/9780596513986/">Oreilly Learning Python</a> book. That got me started. The key observations about python;</p>
<ul>
<li>looks very object oriented</li>
<li>indentation is important (this is about the only thing I knew already)</li>
<li>There is good doco on docs.python.org</li>
<li>Python noddies probably don&#8217;t like perl</li>
</ul>
<p>For the AppEngine you download a small SDK that includes a demo web server that you can run on your own computer to test things out. There&#8217;s also a script to upload your app directory to google. Essentially you have a python script or two along with some static html/images or whatever you need for your app in a directory and just run the appcfg.py update process to update your app on google servers. I really like how a sort of version control is incorporated into this so that if you bump the version number up on your local copy, it won&#8217;t become the &#8216;production&#8217; version of your app. There&#8217;s a dashboard control for specifying which version is the production one.</p>
<p>To get an app uploaded you first need to get an account with AppEngine. For starting off, you just use your gmail account (if you have one) and sign in. There&#8217;s a confirmation step that involves sending you an SMS with a magic number in it. I guess this is stop the AppEngine being abused and to also allow google to invite you round for dinner if they like your Python program. Google keeps track of the phone numbers used for these SMS&#8217;s and suffice to say you can only use a phone number once to receive an SMS.</p>
<p>You also can only create 10 applications. I imagine that might change in the future. You have to pick a unique name that no one else has picked. Your app becomes googlebugle.appspot.com or whatever. You upload your python code and other related files and it just works.  If you don&#8217;t want to use the appspot.com domain you need to sign up for google apps using your own domain name and then use your google apps admin account to sign up for the Google App Engine. Then it is reasonably flexible how you redirect subdomains to your app.</p>
<p>So within two days I&#8217;ve learnt a bit of python and set up a rudimentary top score engine on Google App Engine. I&#8217;m quite impressed. Note, that they have added in billable options recently and I&#8217;m not sure if the &#8216;free usage&#8217; thresholds have dropped.</p>
<p>It&#8217;s actually encouraged me to look at Python more closely (a bit like how buying a Mac has enocuraged me to learn Objective C). All good so far.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kernelcrash.com/blog/google-app-engine/2009/03/26/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iphone ad-hoc&#8217;ing</title>
		<link>http://www.kernelcrash.com/blog/iphone-ad-hocing/2009/03/08/</link>
		<comments>http://www.kernelcrash.com/blog/iphone-ad-hocing/2009/03/08/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 09:21:43 +0000</pubDate>
		<dc:creator>kernel</dc:creator>
				<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://www.kernelcrash.com/blog/?p=199</guid>
		<description><![CDATA[One of the key tasks with iphone software development is getting other people to test your app before you release it on the app store. Apple have a reasonably straight forward setup for testing your code on your own iphone or ipod touch, but to get others to test it you need to create ad-hoc [...]]]></description>
			<content:encoded><![CDATA[<p>One of the key tasks with iphone software development is getting other people to test your app before you release it on the app store. Apple have a reasonably straight forward setup for testing your code on your own iphone or ipod touch, but to get others to test it you need to create ad-hoc builds. Basically &#8216;Apple ad-hoc means the same as &#8216;beta version&#8217;.  It&#8217;s a shame they called it ad-hoc because it is atypically difficult to get right and you end up googling for answers, but find yourself swamped in search results relating to adhoc wifi networking.</p>
<p>With my first app, I had one adhoc tester with an iphone. Amazingly this first attempt at making an adhoc app worked first go. You have to create an adhoc provisioning profile and then compile your app against that profile and check a few things. Apple have that part reasonably well explained.</p>
<p>My problems started with this new game I&#8217;m working on. The graphics guy working on  it had an ipod touch and a PC (ie. no Mac) and I wanted to get some of the builds I was doing so he could check his graphics out and the general playability of the game. So I found out the unique id of his ipod touch, added it to my adhoc provisioning profile and built the app against this, and sent it to him.</p>
<p>He said the app sync&#8217;ed fine from itunes and the icon appeared on his ipod touch, but it kept saying &#8220;the blah application cannot be opened&#8217; when he tapped it to run it on his device. From that point I tried a whole heap of different things. iphone developers probably get used to this after a while; restart Xcode, try a clean all a few times, double check the Info pages on the project and target settings to make sure the right provisioning profile is selected. I even created a new provisioning profile with just this guy in it. But no go.</p>
<p>Eventually I found out that the ipod touch had been jailbroken. Ahah!!! Of course if you google for &#8216;jailbreak cannot open application&#8217; you get a zillion results. I could not be bothered trying to work them out, so he just restored the ipod touch&#8217;s OS and the app installed first go.</p>
<p>The other common hoop I hit with ad-hoc testing is to make sure the testers delete the app from their device and in itunes before adding a new version. I kind of know why this is required. Its not required all the time, but it certainly makes testing easier if the beta testers get used to doing it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kernelcrash.com/blog/iphone-ad-hocing/2009/03/08/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An iphone game</title>
		<link>http://www.kernelcrash.com/blog/an-iphone-game/2009/02/20/</link>
		<comments>http://www.kernelcrash.com/blog/an-iphone-game/2009/02/20/#comments</comments>
		<pubDate>Sat, 21 Feb 2009 06:43:25 +0000</pubDate>
		<dc:creator>kernel</dc:creator>
				<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://www.kernelcrash.com/blog/?p=190</guid>
		<description><![CDATA[After my first iphone app got out the door, Ive been quite stagnant in the ideas department. And it&#8217;s not like I&#8217;m raking money in on my one app. Let&#8217;s just say it could be a while before I get to Apples minimum threshold for payment.
But as luck would have it, I recently met another [...]]]></description>
			<content:encoded><![CDATA[<p>After my first iphone app got out the door, Ive been quite stagnant in the ideas department. And it&#8217;s not like I&#8217;m raking money in on my one app. Let&#8217;s just say it could be a while before I get to Apples minimum threshold for payment.</p>
<p>But as luck would have it, I recently met another iphone developer here in NZ. He had some good ideas &#8230; but not a lot of time. I don&#8217;t have a lot of Unix work on at the moment, so seemingly have plenty of time. So at the moment I&#8217;m working on a game with him, based on his idea.</p>
<p>There&#8217;s definately a big learning curve at the moment. Firstly, I&#8217;ve never written a complex game before (I have started some back in the Amiga era), and there&#8217;s logically a fair bit more code involved than my simple &#8216;get something on the app store&#8217; app. Per usual, all the retain/release stuff is a challenge. I typically write some code that kind of works, then go back later to try and sort out the retain/release mess I&#8217;ve created. I end up adding a lot of debug code. A good hint is to override the retain and release methods in your own classes. For example;</p>
<blockquote>
<pre>- (id) retain
{</pre>
<pre>    NSLog(@"RETAIN MyClass %p rc before:%d", self, [ self retainCount]);</pre>
<pre>    return [ super retain ];</pre>
<pre>}</pre>
<pre>- (void) release</pre>
<pre>{</pre>
<pre>    NSLog(@"RELEASE MyClass %p rc before:%d", self, [self retainCount ]);</pre>
<pre>    [ super release ];</pre>
<pre>}</pre>
</blockquote>
<p>I also put some NSLog&#8217;s in my dealloc&#8217;s like so. Whatever you do, DON&#8217;T put the [super dealloc] before the NSLog as I originally did and scratched my head for ages wondering why my dealloc always crashed. Doh!</p>
<blockquote>
<pre>- (void)dealloc {
    NSLog(@"DEALLOC MyClass %p", self);</pre>
<pre>    [someVar release ];</pre>
<pre>    [super dealloc];</pre>
<pre>}</pre>
</blockquote>
<p>So there&#8217;s some challenges ahead &#8230; but it&#8217;s all looking good so far.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kernelcrash.com/blog/an-iphone-game/2009/02/20/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finally have an iphone app out</title>
		<link>http://www.kernelcrash.com/blog/finally-have-an-iphone-app-out/2008/12/12/</link>
		<comments>http://www.kernelcrash.com/blog/finally-have-an-iphone-app-out/2008/12/12/#comments</comments>
		<pubDate>Sat, 13 Dec 2008 01:55:11 +0000</pubDate>
		<dc:creator>kernel</dc:creator>
				<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://www.kernelcrash.com/blog/finally-have-an-iphone-app-out/2008/12/12/</guid>
		<description><![CDATA[Well I finally got an App out the door and it&#8217;s sitting on itunes. I think one person has bought it!!! Wow. One person has already complained about it too (I think there must be people that just trawl itunes looking for things to complain about). I don&#8217;t think he bought it. It&#8217;s a pretty [...]]]></description>
			<content:encoded><![CDATA[<p>Well I finally got an App out the door and it&#8217;s sitting on itunes. I think one person has bought it!!! Wow. One person has already complained about it too (I think there must be people that just trawl itunes looking for things to complain about). I don&#8217;t think he bought it. It&#8217;s a pretty basic &#8216;first&#8217; app, so now I need to get my head down to think up something a bit more interesting for my &#8217;second&#8217; app.</p>
<p>It&#8217;ll be interesting to see where the App Store phenomenon goes.There&#8217;s now over 10000 apps on the store &#8230; and so you end up with a lot of similar apps &#8230; and also it makes it more difficult to find the app you want. There&#8217;s also a natural tendency for apps to end up at 99cents or free now. We shall see.  At the moment, it&#8217;s got me interested in programming again &#8230; and that&#8217;s good.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kernelcrash.com/blog/finally-have-an-iphone-app-out/2008/12/12/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
