<?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>new to tap</title>
	<atom:link href="http://www.newtotap.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.newtotap.com</link>
	<description>The design and development of our first iPhone App</description>
	<lastBuildDate>Sat, 10 Dec 2011 10:07:22 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.2.35</generator>
	<item>
		<title>Less is always an option</title>
		<link>http://www.newtotap.com/?p=654</link>
		<comments>http://www.newtotap.com/?p=654#comments</comments>
		<pubDate>Sat, 10 Dec 2011 10:07:21 +0000</pubDate>
		<dc:creator><![CDATA[Andrea Rapuzzi]]></dc:creator>
				<category><![CDATA[Business Models]]></category>
		<category><![CDATA[Learning References]]></category>
		<category><![CDATA[Organization Models]]></category>

		<guid isPermaLink="false">http://www.newtotap.com/?p=654</guid>
		<description><![CDATA[&#160; &#160; Stand for simplicity, try to make a difference, everything you do is marketing, start making something and launch now. Sounds conventional? What about: find the growing rate that fits you, be bootstrapped profitable and proud, stay frugal, fight for a &#8230; <a href="http://www.newtotap.com/?p=654">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>&nbsp;</p>
<div id="attachment_676" style="width: 442px" class="wp-caption aligncenter"><a href="http://www.newtotap.com/?attachment_id=676" rel="attachment wp-att-676"><img class="size-full wp-image-676" title="Stones" src="http://www.newtotap.com/wp-content/uploads/2011/12/Stones.jpg" alt="" width="432" height="278" /></a><p class="wp-caption-text">More what?</p></div>
<p>&nbsp;</p>
<p>Stand for simplicity, try to make a difference, everything you do is marketing, start making something and launch now.</p>
<p>Sounds conventional?</p>
<p>What about: find the growing rate that fits you, be bootstrapped profitable and proud, stay frugal, fight for a lot of uninterrupted work time, don&#8217;t expect overnight success, doing good enough is fine, beat the competition by teaching?</p>
<p>Something more upstream? Don&#8217;t be a workaholic, avoid meetings, don&#8217;t expect to create a culture, don&#8217;t be a hero, go to sleep!!</p>
<p>These and a lot of others useful insights are the by-product of the experience gained day by day at <a href="http://37signals.com/">37signals</a> and condensed in the amazing book <a href="http://www.amazon.com/Rework-Jason-Fried/dp/0307463745/ref=sr_1_1?ie=UTF8&amp;qid=1323505538&amp;sr=8-1">Rework</a> by <a href="https://twitter.com/#!/jasonfried">Jason Fried</a> and<a href="https://twitter.com/#!/dhh"> David Heinemeier Hansson</a> (the latter being actually the creator of <a href="http://rubyonrails.org/">Ruby on Rails</a>).</p>
<p>There&#8217;s a constant attention in the book about being concrete, about doing few things exceptionally well, about discriminating what works from what doesn&#8217;t (even if everyone says it does).</p>
<p>To have a first taste, look at the following <a href="https://twitter.com/#!/jasonfried">Jason Fried</a> talk at <a href="http://tedxmidwest.com/">TEDx Midwest</a> about the working place and the uninterrupted work time (around 17 min). Does it remind you of something???</p>
<p><a href="http://www.newtotap.com/?p=654"><img src="http://i.ytimg.com/vi/5XD2kNopsUs/hqdefault.jpg" alt="YouTube Video"></a></p>
<p>&nbsp;</p>
<p><a href="https://twitter.com/#!/jasonfried">Jason Fried</a> does a great work at demystifying work &#8216;institutions&#8217; like</p>
<ul>
<li>the hero that resolves the crisis working till 2 AM</li>
<li>the need for unlimited growth</li>
<li>the need for massive founding from the outside</li>
<li>continuous meetings</li>
<li>the abundance of people, products, features (more is better)</li>
</ul>
<p>Speaking of the latter, simplicity is one of the key practices suggested by the <a href="http://www.amazon.com/Rework-Jason-Fried/dp/0307463745/ref=sr_1_1?ie=UTF8&amp;qid=1323505538&amp;sr=8-1">Rework book</a>. Choose a bunch of simple, important, core feature and implement them astonishingly well. Aim at the centre, cut all the distractions, be remarkable.</p>
<p>The following video is an example of this. It&#8217;s about 50 minutes long (absolutely worth them). If nothing less, have a look at it starting from 46:50 when Jason is asked for some final thoughts to leave to his audience. There it is: &#8220;Less is always an option&#8221;. Have fun!!!</p>
<p><iframe src="https://player.vimeo.com/video/28150404" width="584" height="329" frameborder="0" title="CreativeMornings Chicago with Jason Fried" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.newtotap.com/?feed=rss2&#038;p=654</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Stream of unconsciousness (Part 2)</title>
		<link>http://www.newtotap.com/?p=526</link>
		<comments>http://www.newtotap.com/?p=526#comments</comments>
		<pubDate>Sat, 26 Nov 2011 10:14:49 +0000</pubDate>
		<dc:creator><![CDATA[Andrea Rapuzzi]]></dc:creator>
				<category><![CDATA[Audio Streaming]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[iOS Development]]></category>
		<category><![CDATA[Learning References]]></category>

		<guid isPermaLink="false">http://www.newtotap.com/?p=526</guid>
		<description><![CDATA[Previously on Stream of unconsciousness: a first (simple) audio streaming implementation has been put in place using the Audio File Stream Example. The main parser mechanism has been analysed but a lot of mysteries about the callbacks have to be uncovered. If &#8230; <a href="http://www.newtotap.com/?p=526">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<div id="attachment_627" style="width: 582px" class="wp-caption aligncenter"><a href="http://www.newtotap.com/?attachment_id=627" rel="attachment wp-att-627"><img class="size-full wp-image-627" title="Stream" src="http://www.newtotap.com/wp-content/uploads/2011/11/Stream.jpg" alt="" width="572" height="193" /></a><p class="wp-caption-text">Bits to notes. To money?</p></div>
<p>Previously on Stream of unconsciousness: a first (simple) audio streaming implementation has been put in place using the <a href="http://developer.apple.com/library/mac/#samplecode/AudioFileStreamExample/Introduction/Intro.html">Audio File Stream Example</a>. The main parser mechanism has been analysed but a lot of mysteries about the callbacks have to be uncovered. If you are unsatisfied with this micro-summary, you can read the whole story on <a href="http://www.newtotap.com/?p=392">this post</a>.</p>
<p>Time has come to introduce another audio-related library: the <a href="http://developer.apple.com/library/mac/#documentation/MusicAudio/Conceptual/AudioQueueProgrammingGuide/Introduction/Introduction.html">Audio Queue Services library</a>. This is a C API under the under the <a href="https://developer.apple.com/library/ios/#documentation/MusicAudio/Reference/CAAudioTooboxRef/_index.html">Audio Toolbox framework</a> (the same framework of the <a href="https://developer.apple.com/library/ios/#documentation/MusicAudio/Reference/AudioStreamReference/Reference/reference.html">Audio File Stream library</a> introduced in the <a href="http://www.newtotap.com/?p=392">previous post</a>).</p>
<p>This library can be used to record and, as in our case, to play audio. Two fundamental documents to understand audio playing are: <a href="http://developer.apple.com/library/mac/#documentation/MusicAudio/Conceptual/AudioQueueProgrammingGuide/AboutAudioQueues/AboutAudioQueues.html">About Audio Queues</a> that introduces the library main concepts and structure, and <a href="http://developer.apple.com/library/mac/#documentation/MusicAudio/Conceptual/AudioQueueProgrammingGuide/AQPlayback/PlayingAudio.html">Playing Audio</a> that, as its name implies deals with the details of audio playing.</p>
<p>As described in these documents, playing audio is just a matter of:</p>
<ol>
<li>Define a custom structure to manage state, format, and path information.</li>
<li>Write an audio queue callback function to perform the actual playback.</li>
<li>Write code to determine a good size for the audio queue buffers.</li>
<li>Open an audio file for playback and determine its audio data format.</li>
<li>Create a playback audio queue and configure it for playback.</li>
<li>Allocate and enqueue audio queue buffers. Tell the audio queue to start playing. When done, the playback callback tells the audio queue to stop.</li>
<li>Dispose of the audio queue. Release resources.</li>
</ol>
<p>Let&#8217;s see how these tasks are dealt with in the code example starting with the first callback we still have to describe: PropertyListenerProc.</p>
<p>The PropertyListenerProc callback definition is:</p>
<pre>typedef void (*AudioFileStream_PropertyListenerProc) (
   void                         *inClientData,
   AudioFileStreamID            inAudioFileStream,
   AudioFileStreamPropertyID    inPropertyID,
   UInt32                       *ioFlags
);</pre>
<p>This callback has to be implemented in your code and is invoked by the parser each time it parses (it is its job, after all) or sets an audio property. The meaning is (parser speaking now): &#8220;Let&#8217;s see these bytes, and these, and these..oh wait I&#8217;ve found/set an audio property!!&#8221;.</p>
<p>The example code does the following:</p>
<ul>
<li>retrieves the user data (as a MyData structure, more on this later)</li>
<li>if the property that has been set is a Ready to Produce Packets property (kAudioFileStreamProperty_ReadyToProducePackets), meaning that the parser has covered all the useful properties and is going to parse the audio data:</li>
<ul>
<li>the audio queue and the audio queue buffers are initialized</li>
<li>a listener (MyAudioQueueIsRunningCallback callback) is attached to the change of state of the audio queue &#8216;running&#8217; property.</li>
</ul>
</ul>
<p>The first thing worth some explanation is the MyData structure and its use in the code example. Remember that the <a href="https://developer.apple.com/library/ios/#documentation/MusicAudio/Reference/AudioStreamReference/Reference/reference.html">Audio File Stream library</a> is function oriented; in particular note that the inPropertyListenerProc and inPacketsProc parameters of the AudioFileStreamOpen function are bound to specific function signature and cannot be ObjC instance methods. Each time a callback is called it has no context per-se (it is somehow stateless); the context of this callback (i.e. all the relevant information that describe the streaming session) has to be passed as a parameter, and that&#8217;s the meaning of the inClientData parameter passed to the AudioFileStreamOpen function. The client code uses this parameter to track a certain streaming session state and to retrieve its context in the different callbacks. In the case of this code example, a struct, called MyData, is used to keep track of everything the process is in need of (e.g. the audio file stream identifier, the audio queue and queue buffers, the mutexes to synchronize the bytes consumption with the music being played and so on).</p>
<p>The structure is declared as follows:</p>
<pre>struct MyData
{
    AudioFileStreamID audioFileStream;  // the audio file stream parser

    AudioQueueRef audioQueue;                               // the audio queue
    AudioQueueBufferRef audioQueueBuffer[kNumAQBufs];       // audio queue buffers

    AudioStreamPacketDescription packetDescs[kAQMaxPacketDescs];    // packet descriptions for enqueuing audio

    unsigned int fillBufferIndex;   // the index of the audioQueueBuffer that is being filled
    size_t bytesFilled;             // how many bytes have been filled
    size_t packetsFilled;           // how many packets have been filled

    bool inuse[kNumAQBufs];         // flags to indicate that a buffer is still in use
    bool started;                   // flag to indicate that the queue has been started
    bool failed;                    // flag to indicate an error occurred

    pthread_mutex_t mutex;          // a mutex to protect the inuse flags
    pthread_cond_t cond;            // a condition varable for handling the inuse flags
    pthread_cond_t done;            // a condition varable for handling the inuse flags
};
typedef struct MyData MyData;</pre>
<p>The definition of this structure clears the point 1 of the above list.</p>
<p>Two other important things that happen under the PropertyListenerProc callback are the audio queue and queue buffers initialization and the MyAudioQueueIsRunningCallback set up.</p>
<p>The audio queue is initialized (AudioQueueNewOutput function) with the format of the audio to play (&amp;asbd), an audio queue callback (MyAudioQueueOutputCallback, see point 2 of the above list) and the timeless MyData structure. An output parameter is used to save a reference to the newly created playback audio queue; guess where??? In a field of the MyData structure, of course!! This covers the points 4 (more or less) and 5 of the list.</p>
<p>As a part of the audio queue initialization, the magic cookie is also initialized. Some file formats (e.g. MPEG 4 AAC) need a structure that contains some audio metadata: that&#8217;s the magic cookie. In the code example its value is read from the audio stream session (AudioFileStreamGetProperty function) and it is written in the audio queue (AudioQueueSetProperty function).</p>
<p>Three (as suggested by the documentation) audio queue buffers are also initialized (AudioQueueAllocateBuffer function) with a constant size (this should shortcut the point 3 of the list). Part of the point 6 of the list is also covered (later for the other part).</p>
<p>That&#8217;s the whole setup thing that comes with the PropertyListenerProc callback, called when the parser is &#8216;ready to play&#8217;.</p>
<p>When everything is in place, the real audio packets make their appearance. Each time some packets are parsed the PacketsProc callback is called.</p>
<p>It is declared as follows:</p>
<pre>typedef void (*AudioFileStream_PacketsProc) (
   void                          *inClientData,
   UInt32                        inNumberBytes,
   UInt32                        inNumberPackets,
   const void                    *inInputData,
   AudioStreamPacketDescription  *inPacketDescriptions
);</pre>
<p>This callback fills the queue buffer in use with the audio data (the bytes of the audio packets) and, each time a buffer is full, it enqueues it (MyEnqueueBuffer function that calls the AudioQueueEnqueueBuffer function and starts the queue if needed) and asks for the next buffer to be filled. The latter task is performed by the WaitForFreeBuffer function, this function asks for a &#8216;used&#8217; buffer (a buffer with already played content) and waits for it stopping the thread with a mutex. Keep in mind that the bytes producer (the stream parser) is faster than the bytes consumer (the audio &#8216;player&#8217;) and some &#8216;retard&#8217; has to be artificially put on the producer size (and that is exactly what this function does). That completes the point 6 of the above list. The point 7 (dispose and release) is managed at the end of the loop in the main function.</p>
<p>Each time an audio buffer has been &#8216;played&#8217;, the audio queue callback (MyAudioQueueOutputCallback) is called. It allows unlocking the mutex set by the WaitForFreeBuffer function. Remember the listener on the change of state of the audio queue &#8216;running&#8217; property (MyAudioQueueIsRunningCallback)? This function is also used to unlock the mutex when the audio queue has done playing.</p>
<p>More or less that&#8217;s the whole story of the <a href="http://developer.apple.com/library/mac/#samplecode/AudioFileStreamExample/Introduction/Intro.html">Audio File Stream Example</a>. It seems a lot convoluted (OK, it IS actually convoluted), but the more you study it and the more you feel at ease with it.</p>
<p>The example is just this, an example to introduce two audio libraries; it is far from complete (for example it doesn&#8217;t handle CBR data) and has some limitations. For a detailed analysis of its problems and a brilliant example of how to overcome them have a look at <a href="http://cocoawithlove.com/2008/09/streaming-and-playing-live-mp3-stream.html">Streaming and playing an MP3 stream</a> and its revision: <a href="http://cocoawithlove.com/2009/06/revisiting-old-post-streaming-and.html">Revisiting an old post: Streaming and playing an MP3 stream</a>. They offer a very interesting analysis of the  <a href="http://developer.apple.com/library/mac/#samplecode/AudioFileStreamExample/Introduction/Intro.html">Audio File Stream Example</a> and its limitations and provide an extension to the example to implement a sample application that streams and plays an audio file from a URL on the iPhone or Mac (source code downloadable by Github!!!). The whole blog (<a href="http://cocoawithlove.com/">Cocoa with Love</a>) by <a href="http://twitter.com/#!/cocoawithlove">Matt Gallager</a> is a GREAT place to find technical advice, hints, code examples and more; definitely a place to go if you are involved in OS X / iOS development (we&#8217;ve also added the link to our blogroll section on the right).</p>
<p>That&#8217;s it. See you next time with our inglorious first implementation of the audio streaming.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.newtotap.com/?feed=rss2&#038;p=526</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Stream of unconsciousness (Part 1)</title>
		<link>http://www.newtotap.com/?p=392</link>
		<comments>http://www.newtotap.com/?p=392#comments</comments>
		<pubDate>Sat, 22 Oct 2011 12:31:40 +0000</pubDate>
		<dc:creator><![CDATA[Andrea Rapuzzi]]></dc:creator>
				<category><![CDATA[Audio Streaming]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[iOS Development]]></category>
		<category><![CDATA[Learning References]]></category>

		<guid isPermaLink="false">http://www.newtotap.com/?p=392</guid>
		<description><![CDATA[&#160; With the Bluetooth connection in place (even in its simplest form), it was time for ourselves to penetrate the audio streaming deepest secrets. It was much a tougher challenge than we had anticipated, one full of trials and errors &#8230; <a href="http://www.newtotap.com/?p=392">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>&nbsp;</p>
<div id="attachment_569" style="width: 435px" class="wp-caption aligncenter"><a href="http://www.newtotap.com/?attachment_id=569" rel="attachment wp-att-569"><img class="size-full wp-image-569" title="Tin can phone" src="http://www.newtotap.com/wp-content/uploads/2011/10/Tin-can-phone.jpg" alt="" width="425" height="282" /></a><p class="wp-caption-text">It just works!!!</p></div>
<p>With the Bluetooth connection in place (even in its simplest form), it was time for ourselves to penetrate the audio streaming deepest secrets. It was much a tougher challenge than we had anticipated, one full of trials and errors and wrong assumptions, one that deserves more than one single post.</p>
<p>After some browsing, the first relevant document we found was the <span style="color: #000000;"><a href="https://developer.apple.com/library/ios/#documentation/MusicAudio/Reference/AudioStreamReference/Reference/reference.html">Audio File Stream Services Reference</a></span><span style="color: #000000;">. It details the use of the <a href="https://developer.apple.com/library/ios/#documentation/MusicAudio/Reference/AudioStreamReference/Reference/reference.html">Audio File Stream library</a> under the </span><span style="color: #000000;"><a href="https://developer.apple.com/library/ios/#documentation/MusicAudio/Reference/CAAudioTooboxRef/_index.html">Audio Toolbox framework</a></span><span style="color: #000000;">. </span></p>
<p><span style="color: #000000;">Trying to write some reasonable code, we stumbled upon a really useful </span><span style="color: #000000;"><a href="http://developer.apple.com/library/mac/#samplecode/AudioFileStreamExample/Introduction/Intro.html">code example</a>. The <a href="http://developer.apple.com/library/mac/#samplecode/AudioFileStreamExample/Introduction/Intro.html">AudioFileStreamExample</a>, even if targeted at the Mac OS X, allowed us to quick start some audio streaming experiment. It contains just 2 .cpp files (aptly named afsclient and afsserver) and provides a straightforward example of the library usage.</span></p>
<p>Let&#8217;s delve into this example.</p>
<p>The server does really the barely minimum. It:</p>
<ul>
<li>listens for socket connection requests by clients</li>
<li>accepts them</li>
<li>for each connection sends an entire audio file to the corresponding client. The file is actually sent in chunks of 32768 (2 ^ 15) bytes.</li>
</ul>
<p>The client manages the hard part and actually demonstrates the use of the <a href="https://developer.apple.com/library/ios/#documentation/MusicAudio/Reference/AudioStreamReference/Reference/reference.html">Audio File Stream library</a>.</p>
<p>At a very high level the client:</p>
<ul>
<li>Opens an audio file stream (AudioFileStreamOpen)</li>
<li>Parses (in loop) each file chunk (bytes array) that receives from the server (AudioFileStreamParseByte)</li>
<li>Closes the audio file stream (AudioFileStreamClose)</li>
</ul>
<div>The AudioFileStreamOpen function is used to open an audio file stream parsing session.</div>
<div>Its signature is:</div>
<pre>OSStatus  AudioFileStreamOpen (
   void                                  *inClientData,
   AudioFileStream_PropertyListenerProc  inPropertyListenerProc,
   AudioFileStream_PacketsProc           inPacketsProc,
   AudioFileTypeID                       inFileTypeHint,
   AudioFileStreamID                     *outAudioFileStream
);</pre>
<p>inClientData is used to pass a context to the parsing session. The parsing process will involve some callback invocation (see below) and the inClientData object (or structure) will be passed along in the callbacks. Keep in mind that this library is not object-oriented but function-oriented. The state relative to a particular parsing session should be managed by your code and the use of this parameter can provide a great help.</p>
<p>inPropertyListenerProc is the callback that will be invoked by the parser each time it manages to parse an audio property (more on the callback structure later on).</p>
<ul>
<li>inPacketsProc is the callback that will be invoked by the parser each time it manages to parse some audio packets (more on the callback structure later on).</li>
<li>inFileTypeHint is used to give the parser any hint about the audio file type (pass 0 if you are unsure of the actual type). It is very useful in case the file type is not univocally recognizable from its content.</li>
<li>outAudioFileStream returns an identifier created by the library and associated to the newly opened parsing session. You have to use this identifier in all the other library function calls to specify the streaming session you are referring to.</li>
</ul>
<p>A little clarification is needed: when I talk about a &#8216;parser&#8217; (and I&#8217;ll also depict one in the coming diagrams) I don&#8217;t mean an actual parser object (since I&#8217;ve just said that the library is function-oriented). Think of it as an abstraction or as the library itself or as a service provided by the library, anything that helps visualizing the problem at hand. But remember that you won&#8217;t invoke any methods of any objects, just public functions provided by the library.</p>
<div>The AudioFileStreamParseBytes function has to be invoked in loop for each file chunk.</div>
<div>Its signature is:</div>
<pre>OSStatus AudioFileStreamParseBytes (
   AudioFileStreamID  inAudioFileStream,
   UInt32             inDataByteSize,
   const void         *inData,
   UInt32             inFlags
);</pre>
<ul>
<li>inAudioFileStream is the identifier returned by the AudioFileStreamOpen function (as the outAudioFileStream parameter). It identifies the streaming session you are referring to.</li>
<li>inDataByteSize is the number of bytes you are passing the function.</li>
<li>inData is the actual bytes array.</li>
<li>inFlags allows you to declare a discontinuity in the stream. Pass 0 by default.</li>
</ul>
<p>The following diagram gives an overview of the process:</p>
<div id="attachment_513" style="width: 773px" class="wp-caption aligncenter"><a href="http://www.newtotap.com/?attachment_id=513" rel="attachment wp-att-513"><img class="size-full wp-image-513" title="Parser2" src="http://www.newtotap.com/wp-content/uploads/2011/10/Parser2.png" alt="" width="763" height="386" /></a><p class="wp-caption-text">Parse this</p></div>
<ol>
<li>The AudioFileStreamParseBytes is invoked repeatedly for each file chunk (bytes array)</li>
<li>When the parser recognizes (parses) a property it invokes the PropertyListenerProc callback</li>
<li>When the parser recognizes (parses) some audio packets it invokes the PropertyListenerProc callback</li>
</ol>
<p>We will further analyse the callback in the next posts.</p>
<p>Finally, the AudioFileStreamClose function is used (any guess?) to close an audio file stream parsing session.</p>
<div>Its signature is:</div>
<pre>OSStatus AudioFileStreamClose (
   AudioFileStreamID inAudioFileStream
);</pre>
<ul>
<li>inAudioFileStream is the identifier returned by the AudioFileStreamOpen function (as the outAudioFileStream parameter). It identifies the streaming session you are referring to.</li>
</ul>
<p>That actually concludes the <a href="http://developer.apple.com/library/mac/#samplecode/AudioFileStreamExample/Introduction/Intro.html">AudioFileStreamExample</a> usage of the <a href="https://developer.apple.com/library/ios/#documentation/MusicAudio/Reference/AudioStreamReference/Reference/reference.html">Audio File Stream library</a>. Yes, because before having any meaningful sound produced by your device, at least another library (and its usage in the example) has to be introduced: the <a href="http://developer.apple.com/library/mac/#documentation/MusicAudio/Conceptual/AudioQueueProgrammingGuide/Introduction/Introduction.html">Audio Queue Services library</a>.</p>
<p>But that&#8217;s it for now. It&#8217;s late in the morning. It&#8217;s Saturday. The sun is shining. The sea is beautiful. I&#8217;ve to take my wife at school (teacher, NOT student). A lot of reasons to stop posting.</p>
<p>Will be right back for Part 2.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.newtotap.com/?feed=rss2&#038;p=392</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Rhapsody in Bluetooth</title>
		<link>http://www.newtotap.com/?p=321</link>
		<comments>http://www.newtotap.com/?p=321#comments</comments>
		<pubDate>Sat, 15 Oct 2011 10:08:31 +0000</pubDate>
		<dc:creator><![CDATA[Andrea Rapuzzi]]></dc:creator>
				<category><![CDATA[Audio Streaming]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[iOS Development]]></category>
		<category><![CDATA[Learning References]]></category>

		<guid isPermaLink="false">http://www.newtotap.com/?p=321</guid>
		<description><![CDATA[&#160; Operational, at last. It&#8217;s time to begin sharing some code, some trials and errors and some discoveries we made while experimenting with iOS audio streaming. No secret recipe here or in the coming posts, just some little value uncovered &#8230; <a href="http://www.newtotap.com/?p=321">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<div id="attachment_418" style="width: 435px" class="wp-caption aligncenter"><a href="http://www.newtotap.com/?attachment_id=418" rel="attachment wp-att-418"><img class="size-full wp-image-418" title="Bluetooth chat" src="http://www.newtotap.com/wp-content/uploads/2011/10/Bluetooth-chat.jpg" alt="" width="425" height="282" /></a><p class="wp-caption-text">Chitty chatty chitty chatty chittychittychitty chatty</p></div>
<p>&nbsp;</p>
<p>Operational, at last. It&#8217;s time to begin sharing some code, some trials and errors and some discoveries we made while experimenting with iOS audio streaming. No secret recipe here or in the coming posts, just some little value uncovered during the process and to be returned to the community (haven&#8217;t you still read the <a href="http://www.amazon.com/Wikinomics-Mass-Collaboration-Changes-Everything/dp/B004J8HXOA/ref=sr_1_1?ie=UTF8&amp;qid=1318430009&amp;sr=8-1">Wikinomics</a> book?? No?? Run and <a href="http://www.amazon.com/Wikinomics-Mass-Collaboration-Changes-Everything/dp/B004J8HXOA/ref=sr_1_1?ie=UTF8&amp;qid=1318430009&amp;sr=8-1">GET IT</a>!!!).</p>
<p>Since our initial equipment comprised a MacBook Air and an iPad (version 1), our first concern was about running and testing the code on 2 different device (since, you know, audio self-streaming isn&#8217;t so exciting after all, as well as other self-something stuff). Hence Mission n. 1 was to verify the feasibility of a Bluetooth connection between the iPad and the iPhone/iPad simulator that comes with the iOS SDK.</p>
<p>The code for the Bluetooth connection was derived by the <a href="http://www.amazon.com/Beginning-iOS-4-Application-Development/dp/0470918020/ref=sr_1_1?s=books&amp;ie=UTF8&amp;qid=1316102892&amp;sr=1-1">Beginning iOS 4 Application Development</a> book and is kind of standard use of the <a href="http://developer.apple.com/library/ios/#documentation/GameKit/Reference/GKPeerPickerController_Class/Reference/Reference.html">GKPeerPickerController</a> class of the <a href="http://developer.apple.com/library/ios/#documentation/GameKit/Reference/GameKit_Collection/_index.html#//apple_ref/doc/uid/TP40008303">GameKit Framework</a>. We will use this code only in the first scouting phase because, although it is really simple, it alerts the user about the connection requests and asks him/her to accept it (see picture below, could be very annoying for multiple connections). An alert-less connection is already implemented in some (but not all!!) of the apps described in the previous posts. I guess this will involve a departure from the &#8216;picker&#8217; approach and the direct use of the <a href="http://developer.apple.com/library/ios/#documentation/GameKit/Reference/GKSession_Class/Reference/Reference.html">GKSession</a> class, but I&#8217;ll leave it for later (any suggestion welcomed!!).</p>
<div id="attachment_417" style="width: 293px" class="wp-caption aligncenter"><a href="http://www.newtotap.com/?attachment_id=417" rel="attachment wp-att-417"><img class="size-full wp-image-417" title="Accept connection" src="http://www.newtotap.com/wp-content/uploads/2011/10/Accept-connection.png" alt="" width="283" height="221" /></a><p class="wp-caption-text">Do you accept connection? Do you? Do You?? DO YOU?????</p></div>
<p>Let&#8217;s look at some code:</p>
<pre>   GKPeerPickerController picker = [[GKPeerPickerController alloc] init];

   picker.delegate = self;

   picker.connectionTypesMask = GKPeerPickerConnectionTypeNearby;

   [picker show];</pre>
<p>It&#8217;s really as simple as this!! In the code sample above a picker variable (of type <a href="http://developer.apple.com/library/ios/#documentation/GameKit/Reference/GKPeerPickerController_Class/Reference/Reference.html">GKPeerPickerController</a>):</p>
<ul>
<li>is allocated and initialized (it&#8217;ll be released soon..)</li>
<li>its delegate is assigned to some class instance (self in my case, see below for the protocol involved)</li>
<li>its connection type is set to &#8216;nearby&#8217; (i.e. using Bluetooth; the other possibility is GKPeerPickerConnectionTypeOnline for an internet-based connection)</li>
<li>finally the picker view itself is shown (see picture below)</li>
</ul>
<div id="attachment_416" style="width: 293px" class="wp-caption aligncenter"><a href="http://www.newtotap.com/?attachment_id=416" rel="attachment wp-att-416"><img class="size-full wp-image-416" title="Picker" src="http://www.newtotap.com/wp-content/uploads/2011/10/Picker.png" alt="" width="283" height="230" /></a><p class="wp-caption-text">Let me pick something...</p></div>
<p>The picker interface allows to discover nearby devices and to send (and accept) connection requests. All this is managed under the surface of your code that is in charge of just managing the delegate events (via the <span class="Apple-style-span" style="color: #000000;"><a href="http://developer.apple.com/library/ios/#documentation/GameKit/Reference/GKPeerPickerControllerDelegate_Protocol/Reference/Reference.html">GKPeerPickerControllerDelegate</a> protocol).</span></p>
<p>You may, for example, be interested in detecting when a peer connects to you or cancel your connection request; you will only need handling these two protocol methods:</p>
<ul>
<li>peerPickerController:didConnectPeer:toSession:</li>
<li>peerPickerControllerDidCancel:</li>
</ul>
<pre>-(void)peerPickerController:(GKPeerPickerController *)pk didConnectPeer:(NSString *)peerID toSession:(GKSession *)session
{
   //Do something (for example alert the user that a peer has just connected
   //Or just do nothing, life is too short to be annoyed by alerts!!

   self.currentSession = session;

   session.delegate = self;

   [session setDataReceiveHandler:self withContext:nil];

   pk.delegate = nil;

   [pk dismiss];

   [pk release];
}</pre>
<p>Please don&#8217;t question about my opening bracket that is sooo C, C++, C# and so feeew Java, ObjectiveC and so on; my need for vertical symmetry doesn&#8217;t allow me to experiment with fancy formatting for now.</p>
<p>In the example above we have:</p>
<ul>
<li>saved the connection session (a <a href="http://developer.apple.com/library/ios/#documentation/GameKit/Reference/GKSession_Class/Reference/Reference.html">GKSession</a> object) in a member variable</li>
<li>set the delegate of the session to an object that implements the <a href="http://developer.apple.com/library/ios/#documentation/GameKit/Reference/GKSessionDelegate_Protocol/Reference/Reference.html">GKSessionDelegate</a> protocol (it will be detailed soon)</li>
<li>set the object that handles data received from other peers (in our case the self object, more on this later)</li>
<li>set the picker delegate to null (or nil or nothing or ..)</li>
<li>dismissed the picker view</li>
<li>released the picker object</li>
</ul>
<p>A similar, but simpler, code can be implemented for the peerPickerControllerDidCancel: method:</p>
<pre>-(void)peerPickerControllerDidCancel:(GKPeerPickerController *)pk didConnectPeer:(NSString *)peerID toSession:(GKSession *)session
{
   ...

   [session setDataReceiveHandler:self withContext:nil];

   pk.delegate = nil;

   [pk dismiss];

   [pk release];
}</pre>
<p>The peerPickerController:didConnectPeer:toSession: example (former above) contains two interesting lines of code: the first one is the one in which we assign the session delegate to an object (self in our case). This object must implement the <a href="http://developer.apple.com/library/ios/#documentation/GameKit/Reference/GKSessionDelegate_Protocol/Reference/Reference.html">GKSessionDelegate</a> protocol that allows tracking things like peers state changes, connection requests and connection failures. This protocol has 4 required (mandatory) methods:</p>
<ul>
<li>session:peer:didChangeState:</li>
<li>session:didReceiveConnectionRequestFromPeer:</li>
<li>session:connectionWithPeerFailed:withError:</li>
<li>session:didFailWithError:</li>
</ul>
<p>The second, much more interesting, code line in the peerPickerController:didConnectPeer:toSession: example sets the object that handles data received from other peers; the handler object must implement a method with the following signature:</p>
<pre>- (void) receiveData:(NSData *)data fromPeer:(NSString *)peer inSession: (GKSession *)session context:(void *)context;</pre>
<p>This is the method used to handle data received from a peer; we will see an example of it in the following posts when we will try to do some real audio streaming.</p>
<p>So, what about Mission n. 1? Is it actually possible to connect a real device and a simulator instance via Bluetooth? The good news is YES. Even with some weird behaviour I&#8217;ve not spent time to deal with (the device picker doesn&#8217;t detect the simulator but the simulator picker detects the device, and it&#8217;s all we need), the connection works!!</p>
<p>Here we are, eventually. We have 2 devices (please, don&#8217;t tell the simulator he&#8217;s not a real device), that ignored each the other, now fully connected. The deaf can hear and the dumb can speak. OK, they&#8217;ve nothing to say each to the other, but how many miracles do you expect in a single blog post???</p>
]]></content:encoded>
			<wfw:commentRss>http://www.newtotap.com/?feed=rss2&#038;p=321</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>One percent inspiration</title>
		<link>http://www.newtotap.com/?p=260</link>
		<comments>http://www.newtotap.com/?p=260#comments</comments>
		<pubDate>Sat, 08 Oct 2011 08:19:07 +0000</pubDate>
		<dc:creator><![CDATA[Andrea Rapuzzi]]></dc:creator>
				<category><![CDATA[App Ideas]]></category>
		<category><![CDATA[Business Models]]></category>
		<category><![CDATA[iOS Design]]></category>

		<guid isPermaLink="false">http://www.newtotap.com/?p=260</guid>
		<description><![CDATA[&#160; &#160; &#8220;Could it be possible to hear what people are listening to? I mean, sometime I&#8217;m on a train or a bus and I see someone totally absorbed by his music and I wonder &#8216;what is he listening to?&#8217; &#8230; <a href="http://www.newtotap.com/?p=260">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>&nbsp;</p>
<div id="attachment_282" style="width: 410px" class="wp-caption aligncenter"><a href="http://www.newtotap.com/?attachment_id=282" rel="attachment wp-att-282"><img class="size-full wp-image-282" title="Idea" src="http://www.newtotap.com/wp-content/uploads/2011/10/Idea.jpg" alt="" width="400" height="300" /></a><p class="wp-caption-text">C&#39;mon guys, no one wanna play with this young curly idea??</p></div>
<p>&nbsp;</p>
<p>&#8220;Could it be possible to hear what people are listening to? I mean, sometime I&#8217;m on a train or a bus and I see someone totally absorbed by his music and I wonder &#8216;what is he listening to?&#8217; Wouldn&#8217;t it be great to eavesdrop his music?&#8221;</p>
<p>That&#8217;s the question <a href="http://www.facebook.com/elena.lowenberger">Elena</a> asked during a summer lunch with friends.</p>
<p>Some friends could not resist &#8220;Wouldn&#8217;t it be great if you could see under people dresses? Wanna see boobs? There&#8217;s an app for that!!&#8221;. But the more I was thinking about this question, the more I was sure there was a good idea underneath. Let&#8217;s try to reverse the question: what if someone wants the other people around to KNOW what is he listening to? &#8216;Hey people can you hear how COOL is my playlist? I CARED for it, there&#8217;s my taste, my fine knowledge and my coolness in it&#8217;. It is not as much about eavesdropping but rather about exhibitionism.</p>
<p>The same evening I began searching for similar apps. The first link I found was <a href="http://thenextweb.com/apps/2011/03/31/mystream-launches-the-first-free-ios-app-to-share-music-over-wifi/">this one</a>. It talked about the <a href="http://itunes.apple.com/us/app/mystream/id423918810">MyStream</a> app. Two things stroked me immediately: 1) How many money were they investing in the project? There should be, for sure, a recognized added value for a similar app. 2) What a GENIAL business model: if you listen to someone else music and you like a certain song you can be redirected to iTunes and buy it; the 5% of the transaction goes to the app creators!! This one FOR SURE has to be included in our business model too.</p>
<p>Some further searches brought up some other similar apps (excluding other huge radio/broadcasting apps): <a href="http://itunes.apple.com/us/app/eavesdrop-enjoy-music-together/id422975583">Eavesdrop</a> (good name!!) and <a href="http://itunes.apple.com/it/app/pairshare/id424429744">PairShare</a>.</p>
<p>Of these apps, some simpler and some more advanced, the one I like the most is PairShare. It is arguably the simplest of the lot and perhaps some feature could be added to it (as &#8216;remembering&#8217; the playlists after a shut down), but it offers a simple, straight path to the point. Most of all it implements GREAT synchronism, if you listen to both the devices (the one streaming and the one getting the stream) they are always perfectly in sync (note to me: this feature HAS to be inserted in our app)!!!</p>
<p>So, at last, we had some idea on which to start a real research/design/development effort. We were in the exciting moment in which the sheet is blank and the head is crowded, the entire street is ahead and it seems to be open and well paved, ready for the fun to begin. No bug on our log, no nasty problem to investigate, no design compromise to be accepted. Like being at the beginning of a great movie, a good lunch, a new course of studies, a new relationship (sort these in your order of importance).</p>
<p>Thomas Edison is heavily quoted for having said:</p>
<blockquote><p>&#8220;Genius is one percent inspiration, ninety-nine percent perspiration&#8221;</p></blockquote>
<p>We were in the state of grace of having just been inspired and having not yet begun to perspire.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.newtotap.com/?feed=rss2&#038;p=260</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>Let&#8217;s get physical</title>
		<link>http://www.newtotap.com/?p=160</link>
		<comments>http://www.newtotap.com/?p=160#comments</comments>
		<pubDate>Mon, 03 Oct 2011 16:05:57 +0000</pubDate>
		<dc:creator><![CDATA[Andrea Rapuzzi]]></dc:creator>
				<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[iOS Development]]></category>

		<guid isPermaLink="false">http://www.newtotap.com/?p=160</guid>
		<description><![CDATA[&#160; The same moment I was able to run some code on a real device, I was looking for some real app to implement or, at least, some real fun challenge. The first idea was to exercise in game developing. What&#8217;s &#8230; <a href="http://www.newtotap.com/?p=160">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<div id="attachment_197" style="width: 435px" class="wp-caption aligncenter"><a href="http://www.newtotap.com/?attachment_id=197" rel="attachment wp-att-197"><img class="size-full wp-image-197 " title="Football" src="http://www.newtotap.com/wp-content/uploads/2011/10/Football.jpg" alt="" width="425" height="282" /></a><p class="wp-caption-text">I should&#39;ve studied iOS programming</p></div>
<p>&nbsp;</p>
<p>The same moment I was able to run some code on a real device, I was looking for some real app to implement or, at least, some real fun challenge.</p>
<p>The first idea was to exercise in game developing. What&#8217;s the path from &#8216;Hello World&#8217; to <a href="http://www.rovio.com/index.php?page=angry-birds">Angry Birds</a> (not to say <a href="http://www.epicgames.com/infinityblade/">Infinity Blade</a>)? I did not expect to cook the full recipe but was just curious about the ingredients. A couple of hour of browsing brought some great 2D (<a href="http://www.cocos2d-iphone.org/">cocos2d</a>, <a href="http://www.sparrow-framework.org/">Sparrow</a>, <a href="http://www.anscamobile.com/corona/">Corona</a>, &#8230;) and 3D (the most stunning being <a href="http://unity3d.com/">Unity</a>) frameworks to my attention; but my search was distracted by an unexpected encounter.</p>
<p>Navigating through forums and blogs I repeatedly stumbled upon sentences about a certain <a href="http://chipmunk-physics.net/">Chipmunk physics engine</a>. That&#8217;s the serendipity of superficial navigation I talked about in a <a href="http://www.newtotap.com/?p=104">previous post</a>.</p>
<p><a href="http://chipmunk-physics.net/">Chipmunk</a> is a great, robust,<a href="http://chipmunk-physics.net/release/ChipmunkLatest-Docs/"> well documented</a>, easy to use physics engine developed initially by <span class="Apple-style-span" style="color: #000000;"><a href="http://wiki.slembcke.net/main/published/HomePage">Scott Lembcke</a>, then under the <a href="http://howlingmoonsoftware.com/index.php">Howling Moon</a> umbrella. It is a C library that comes under an unrestrictive <a href="http://en.wikipedia.org/wiki/MIT_License">MIT license</a>. There is also </span><span class="Apple-style-span" style="color: #000000;">an Objective-C wrapper (<a href="http://files.slembcke.net/chipmunk/tutorials/SimpleObjectiveChipmunk/">Objective-Chipmunk</a>, now part the <a href="http://chipmunk-physics.net/chipmunkPro.php">Chipmunk Pro</a> package) that &#8220;</span><span class="Apple-style-span" style="color: #000000;">integrates with the Objective-C memory model and provides a number of higher level APIs that ease development and save you time&#8221;. The <a href="http://chipmunk-physics.net/chipmunkPro.php">Chipmunk Pro</a> package costs 200$, but that&#8217;s the great part: if, in the past, you have already donate to the Chipmunk project, the donation counts towards the purchase.</span></p>
<p>Besides giving you great collision algorithms, Chipmunk, also, as stated in <a href="http://code.google.com/p/chipmunk-physics/">this page</a>:</p>
<blockquote><p>Makes you smarter, stronger and more attractive to the opposite gender! (It worked for me anyway)</p></blockquote>
<p>The first time I told my wife I&#8217;d found a VERY exciting physics engine she replied &#8220;Go to work!!&#8221;, but at the time I hadn&#8217;t really started using it, so I&#8217;ll keep you updated about this last feature.</p>
<p>For now, just look these 2 amazing videos about the engine and tell me if some girl or boy or whateveryoulikeittobe starts wheeling around you:</p>
<p><a href="http://www.newtotap.com/?p=160"><img src="http://i.ytimg.com/vi/Cx5GBMybxXw/hqdefault.jpg" alt="YouTube Video"></a></p>
<p>&nbsp;</p>
<p><a href="http://www.newtotap.com/?p=160"><img src="http://i.ytimg.com/vi/dD-um_8KqpE/hqdefault.jpg" alt="YouTube Video"></a></p>
<p>&nbsp;</p>
<p>Using the <a href="http://chipmunk-physics.net/">Chipmunk engine</a>, I wrote a very simple exercise, something similar to an air hockey (with no fancy graphics at all, just to play with the engine). It was very simple and it allowed me to concentrate on the game rules and test weird scenarios (like playing with 100 pucks, with no friction or very high friction, with or without gravity and so on).</p>
<div id="attachment_206" style="width: 1034px" class="wp-caption aligncenter"><a href="http://www.newtotap.com/?attachment_id=206" rel="attachment wp-att-206"><img class="size-full wp-image-206" title="ChipmunkTest" src="http://www.newtotap.com/wp-content/uploads/2011/10/ChipmunkTest.png" alt="" width="1024" height="768" /></a><p class="wp-caption-text">38-0 and a lot to come</p></div>
<p>&nbsp;</p>
<p>It was really fun and instructive and I began to think about which app to build on it (on Chipmunk, NOT on my ugly example..) until in June, at a lunch with friends, the first mature app idea came, in the dress of a young, dear friend and her simple question.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.newtotap.com/?feed=rss2&#038;p=160</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>If you design it they&#8217;ll come</title>
		<link>http://www.newtotap.com/?p=135</link>
		<comments>http://www.newtotap.com/?p=135#comments</comments>
		<pubDate>Tue, 27 Sep 2011 16:32:23 +0000</pubDate>
		<dc:creator><![CDATA[Andrea Rapuzzi]]></dc:creator>
				<category><![CDATA[iOS Design]]></category>
		<category><![CDATA[iPhone App Design]]></category>
		<category><![CDATA[Learning References]]></category>

		<guid isPermaLink="false">http://www.newtotap.com/?p=135</guid>
		<description><![CDATA[When you begin browsing around Apple documentation for iOS design and development, three concepts may strike your attention: design, Design and DESIGN. In no other application environment I&#8217;ve found so much maniacal attention to the design phase as in the &#8230; <a href="http://www.newtotap.com/?p=135">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>When you begin browsing around Apple documentation for iOS design and development, three concepts may strike your attention: design, Design and DESIGN. In no other application environment I&#8217;ve found so much maniacal attention to the design phase as in the iOS apps.</p>
<div id="attachment_146" style="width: 435px" class="wp-caption aligncenter"><a href="http://www.newtotap.com/wp-content/uploads/2011/09/Counter.jpg"><img class="size-full wp-image-146" title="Counter" src="http://www.newtotap.com/wp-content/uploads/2011/09/Counter.jpg" alt="" width="425" height="282" /></a><p class="wp-caption-text">A designer&#39;s counter</p></div>
<p>But let&#8217;s start from the beginning: are you a registered apple developer? Have you enrolled to the iOS Developer Program? NO??!!??!</p>
<p>OK, that&#8217;s the story. To begin your journey in the iOS dev world, the first step is to <a href="http://developer.apple.com/programs/register/">Register as an Apple Developer</a>. This registration is completely free and gives you access to the development tools (SDK, XCode, &#8230;) and the documentation (manuals, videos, &#8230;) to grow strong and guide your efforts. You can now develop and debug/run your code on the iPhone and iPad simulators that ship with the SDK.</p>
<p>If you want to deploy and debug your code an a real device (iPhone, iPad, iPod Touch) you have to enroll to the <a href="http://developer.apple.com/programs/ios/">iOS Developer Program</a>. It costs 99$/year and allows you to deploy your code on real devices and to apply your final app for publication in the App Store.</p>
<p>So, perhaps, by now you have already registered as an Apple developer (after all IT&#8217;S FREE). A good way to start benefiting your new status could be starting watching the &#8216;Essentials&#8217; section of the <a href="https://developer.apple.com/videos/iphone/">iOS Development Videos</a>. They are 21 videos ranging from 12 minutes to 1 hour and 20 minutes that gives an overview of the best practices and common pitfalls in the different areas of iOS design and development. They are a really invaluable resource to quick start and grasp a lot of iOS information in small time.</p>
<p>But let&#8217;s go back to design.</p>
<p>Try to watch the Essential videos <a href="http://developer.apple.com/videos/iphone/#video-essentials-ingredients">Ingredients of Great iPhone Apps</a> and <a href="http://developer.apple.com/videos/iphone/includes/essentials-uidesign.html#video-essentials-uidesign">iPhone User Interface Design</a> (they are worth MUCH more than the 1h and 40m they last, so please WATCH them). The former dissects the Seven Qualities of Successful iPhone Apps (Delightful, Innovative, Designed, Integrated, Optimized, Connected and Localized) also brilliantly commented in <a href="http://tapity.com/iphone-app-design/7-ingredients-of-successful-iphone-apps-source-apple/">this tapity post</a>.</p>
<p>Both push the limit for the design time (AT LEAST 60% !??!!?!??!) in an app project and give the stunning example of tap tap tap <a href="http://taptaptap.com/#whereto">WhereTo?</a> app that iterated the user interface design from standard to gorgeous (you have to watch the first app version to believe it!!!). The latter video gives another precious advice: use the <a href="http://developer.apple.com/library/IOS/#documentation/UserExperience/Conceptual/MobileHIG/Introduction/Introduction.html">iOS Human Interface Guidelines (HIG)</a> as a reference ONLY AFTER you have read it COVER TO COVER (that&#8217;s why you may find <a href="http://developer.apple.com/library/ios/documentation/userexperience/conceptual/mobilehig/MobileHIG.pdf">the pdf version</a> useful) (see also <a href="http://www.newtotap.com/?p=104">my previous post</a> on this subject).</p>
<p>That&#8217;s the path to excellence. People who have reached it say it is very close to success.</p>
<p>Update: Speaking of design I URGE you to read <a href="http://shop.oreilly.com/product/0636920001133.do">Tapworthy</a> by <a href="http://twitter.com/#!/globalmoxie">Josh Clark</a>. It&#8217;s a must have if you are going to cure an app design but also it&#8217;s also valuable if you are going to interact with the people who design it.</p>
<p><a href="http://www.smashingmagazine.com/2011/09/28/youre-pricing-it-wrong-software-pricing-demystified/">Another interesting link</a> on product pricing and the customer’s perception of the product (moredesignmoredesignmoredesign).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.newtotap.com/?feed=rss2&#038;p=135</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>On books</title>
		<link>http://www.newtotap.com/?p=104</link>
		<comments>http://www.newtotap.com/?p=104#comments</comments>
		<pubDate>Mon, 19 Sep 2011 16:01:50 +0000</pubDate>
		<dc:creator><![CDATA[Andrea Rapuzzi]]></dc:creator>
				<category><![CDATA[Learning References]]></category>

		<guid isPermaLink="false">http://www.newtotap.com/?p=104</guid>
		<description><![CDATA[Recently I have subscribed to Safary Books Online. The subscription gives access to a ton of technical books and videos and represents an excellent source of information. This fact and the presence of an Amazon Kindle on my desk (a much appreciated gift, &#8230; <a href="http://www.newtotap.com/?p=104">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Recently I have subscribed to <a href="http://www.safaribooksonline.com/">Safary Books Online</a>. The subscription gives access to a ton of technical books and videos and represents an excellent source of information. This fact and the presence of an <a href="http://www.amazon.com/kindle">Amazon Kindle</a> on my desk (a much appreciated gift, thank you all, my friends!!!) drives some thoughts about paper books, electronic books and the information scattered through the web (in the form of tech publication, reference, forum, blog, question and answer and so on).</p>
<p>Let&#8217;s start by saying that I LOVE paper books. I love to touch them, to smell them, to look at the bookmark as a sign of progress and achievement, to look at my bookshelves as pictures of journeys I made, places I visited or lived, faces I met. I like to see a book as a wizard spell-book: it contains something you don&#8217;t already know, something of value that could be very useful to you and that can be accessed if you have the ability and the patience to decipher its runes.</p>
<div id="attachment_111" style="width: 928px" class="wp-caption aligncenter"><a href="http://www.newtotap.com/wp-content/uploads/2011/09/Libreria.jpg"><img class="size-full wp-image-111" title="Safari Books Offline" src="http://www.newtotap.com/wp-content/uploads/2011/09/Libreria.jpg" alt="" width="918" height="567" /></a><p class="wp-caption-text">Safari Books Offline</p></div>
<p>How do electronic books fit in this love story? Even if they miss the physical charm (hey, I mean: NO SCENT, believe it???) they contain, after all, the same &#8216;spells&#8217; (‘different smell same spell’, hey <a href="http://twitter.com/#!/timoreilly">Tim</a>, I’ve found the perfect payoff for the service!!!). Most of all, they are really unbeatable for search and reference not to say &#8216;transportation&#8217; and they offer access to different media (e.g. videos) that have no paper equivalent. I find <a href="http://www.safaribooksonline.com/">Safari</a> incredibly useful for: A) Help me choose which book to read; B) Read interesting excerpts of book I don&#8217;t want to read in full; C) As a reference of books I&#8217;ve already read. Still, when I decide to read a full book (even guided by some &#8216;preview&#8217; in Safari) I usually prefer to buy the paper version.</p>
<p>Now you probably bet I dislike the deluge of un-uniform, un-structured, un-ordered information that float through the web? You will lose your bet (please, contact <a title="Pay the bet" href="mailto:andrea.rapuzzi@a-sign.it?subject=I'd%20like%20to%20pay%20the%20bet%20I%20lost">me</a> to pay for it). I like very much this hoard of accessible knowledge atoms and my work won&#8217;t be the same without the possibility to instantly find an answer to a precise question, to quickly grasp a simple concept, to refresh my memory, to find the best translation of a given word (synonyms of ‘word’, if my memory helps me are: concept, designation, expression, idiom, lexeme, locution, morpheme, name, phrase, sound, term, usage, utterance, vocable) and 1M of other ways to derive value from the web (even very small value, but multiply it for 1M!!).</p>
<p>I agree with the concept, brilliantly introduced by <a href="http://www.oceanomare.com/home.htm">Alessandro Baricco</a> in the article <a href="http://mag.wired.it/rivista/storie/i-nuovi-barbari.html">I nuovi barbari</a> (The new barbarians) on the <a href="http://mag.wired.it/">Italian Wired magazine</a>, that there’s a new way to access the information, in which superficiality plays a central role and allows to cover, easily and with unprecedented speed, different and distant (and uncorrelated) domains of knowledge. Thus, running on the surface (and with the help of the new media the surface seems to run by itself under our feet), we have the chance to scratch an incredibly vast information area. And that’s really amazing (not to say useful and fun!!).</p>
<p>It is not, however, a substitute (neither a surrogate) for the linear, slow, un-agile, single-domained and very focused  travel in the deep that occurs while reading a book, delving seriously into a problem, mastering a discipline.</p>
<p>The new ways of accessing and sharing information and knowledge represent a tremendous opportunity for people operating in the knowledge markets but cannot, by their selves, replace their roots.</p>
<p>Update: I have just found <a title="Why Browsing Is So Important to Content Discovery" href="http://mashable.com/2011/09/06/browsing-content-discovery/">this beautiful article</a> about search, browsing and the beautifulness of books being physical.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.newtotap.com/?feed=rss2&#038;p=104</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>The importance of being Objective</title>
		<link>http://www.newtotap.com/?p=69</link>
		<comments>http://www.newtotap.com/?p=69#comments</comments>
		<pubDate>Thu, 15 Sep 2011 16:59:43 +0000</pubDate>
		<dc:creator><![CDATA[Andrea Rapuzzi]]></dc:creator>
				<category><![CDATA[iOS Development]]></category>
		<category><![CDATA[Learning References]]></category>

		<guid isPermaLink="false">http://www.newtotap.com/?p=69</guid>
		<description><![CDATA[What did I need to start the journey? I neither KNEW it!! After some googling I decided the first two steps would be to learn Objective-C and have some first familiarity with XCode and the Cocoa Touch Framework. After having &#8230; <a href="http://www.newtotap.com/?p=69">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>What did I need to start the journey? I neither KNEW it!! After some googling I decided the first two steps would be to learn Objective-C and have some first familiarity with XCode and the Cocoa Touch Framework.</p>
<p>After having learned others C flavours (&#8216;original recipe&#8217;, ++, #) the Objective thing didn&#8217;t seem to prove too hard a challenge. But how to exercise? I wasn&#8217;t still completely positive at the time about our involvement in the iOS thing and I wanted to have a try before dedicating a MacSomething purchase to the cause. Then I acquired on ORIGINAL (see exhibit n.1) copy of Snow Leopard and, guided by some internet ToDos and files, I installed it on a Virtual Machine. The VM had several stability problems, and it frequently failed to boot, but it allowed me to acquire a base skill in Objective-C.</p>
<div id="attachment_78" style="width: 458px" class="wp-caption aligncenter"><a href="http://www.newtotap.com/wp-content/uploads/2011/09/P91401621.jpg"><img class="size-full wp-image-78" title="Exhibit n.1" src="http://www.newtotap.com/wp-content/uploads/2011/09/P91401621.jpg" alt="" width="448" height="336" /></a><p class="wp-caption-text">Exhibit n.1 - The purchase evidence</p></div>
<p>As usual it all began with a book: <a href="http://www.amazon.com/Programming-Objective-C-3rd-Developers-Library/dp/0321711394/ref=sr_1_1?ie=UTF8&amp;qid=1316102783&amp;sr=8-1">Programming in Objective-C 2.0</a> (Second Edition, now it is in third). If you come from another C-like syntax and your are at ease with another object oriented language you should have no problem to adapt to Objective-C. There is also plenty of sites and forums and tech advices on the web. What stroked me most about Obj-C was the methods syntax. I meant: are you really SERIOUS about that??? But after a while it seemed less strange, in some cases even pretty. I found also memory management retain and (auto)release features also very useful even in absence of the cosy-ness/lazy-ness of a garbage collector (for iOS).</p>
<div id="attachment_90" style="width: 1034px" class="wp-caption aligncenter"><a href="http://www.newtotap.com/wp-content/uploads/2011/09/P9110163.jpg"><img class="size-full wp-image-90" title="Bridge and Drums" src="http://www.newtotap.com/wp-content/uploads/2011/09/P9110163.jpg" alt="" width="1024" height="615" /></a><p class="wp-caption-text">Build a bridge or play drums?</p></div>
<p>After that I began playing around XCode and the Cocoa Touch Framework smoothly introduced by <a href="http://www.amazon.com/Beginning-iOS-4-Application-Development/dp/0470918020/ref=sr_1_1?s=books&amp;ie=UTF8&amp;qid=1316102892&amp;sr=1-1">Beginning iOS 4 Application Development</a>. AND I purchased a MacBook Air (the VM thing was really viable no more). The book is absolutely at the introductory level (as the title implies) but covers a lot of ground and, how to say it, it is in TECHNICOLOR!!!</p>
<div id="attachment_77" style="width: 1034px" class="wp-caption aligncenter"><a href="http://www.newtotap.com/wp-content/uploads/2011/09/P91401631.jpg"><img class="size-full wp-image-77" title="The real one" src="http://www.newtotap.com/wp-content/uploads/2011/09/P91401631.jpg" alt="" width="1024" height="768" /></a><p class="wp-caption-text">The real one</p></div>
<p>Finally, I was able to write some code in Objective-C (even if I always had to write it twice for it to be correct), to grasp some Cocoa Touch concept, I even had a Mac made of atoms, what next???</p>
<p>Find the right app to challenge my new (still uncertain) capabilities.</p>
<p>But that’s another post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.newtotap.com/?feed=rss2&#038;p=69</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>new to tap (not &#8220;what&#8217;s new to tap?&#8221; but &#8220;we are VERY new to tap&#8221;)</title>
		<link>http://www.newtotap.com/?p=65</link>
		<comments>http://www.newtotap.com/?p=65#comments</comments>
		<pubDate>Fri, 09 Sep 2011 17:35:11 +0000</pubDate>
		<dc:creator><![CDATA[Andrea Rapuzzi]]></dc:creator>
				<category><![CDATA[Announcements]]></category>

		<guid isPermaLink="false">http://www.newtotap.com/?p=65</guid>
		<description><![CDATA[“So we decided to tell the world about what we’re doing” is the beginning of the first post in tapity inspirational blog. And we also decided to share the journal of our journey (try to say it twice as fast) (started two months ago, &#8230; <a href="http://www.newtotap.com/?p=65">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>“So we decided to tell the world about what we’re doing” is the beginning of <a href="http://tapity.com/uncategorized/tapity-com-the-un-awesome-version-is-operational-and-why-you-should-care/">the first post</a> in <a href="http://tapity.com/">tapity</a> inspirational blog. And we also decided to share the journal of our journey (try to say it twice as fast) (started two months ago, in our spare time) to the planning, design, development, publication (we hope), planetary success (we STRONGLY hope) of our first iPhone app.</p>
<p>Not new to programming, but veryvery new to iPhone programming and software marketing, we’ll try to capture all the doubts, challenges, technical choices, useful references, lessons learned and FUN we will incur during the trip.</p>
<p>Thanks to Jeremy Olson for having shown the way!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.newtotap.com/?feed=rss2&#038;p=65</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
